From 77b4e7e7c2364587d49a03455c575ed8cf268ff6 Mon Sep 17 00:00:00 2001 From: Hyunjun Date: Fri, 6 Mar 2015 13:55:08 +0900 Subject: [PATCH 2/5] Initial release including wifi display based on gst-rtsp-server-1.4.1 Change-Id: Idc36178412a983c8751659322b2d18c09633989b --- AUTHORS | 2 + COPYING | 481 + COPYING.LIB | 481 + ChangeLog | 7649 ++++++++ INSTALL | 370 + LICENSE | 504 + LICENSE.LGPLv2.1 | 504 + Makefile.am | 80 + Makefile.in | 1139 ++ NEWS | 2 + README | 4 + RELEASE | 71 + REQUIREMENTS | 3 + TODO | 3 + acinclude.m4 | 66 + aclocal.m4 | 1231 ++ autogen.sh | 113 + common/ChangeLog | 1712 ++ common/Makefile.am | 22 + common/Makefile.in | 756 + common/README | 255 + common/c-to-xml.py | 36 + common/check-exports | 54 + common/check.mak | 252 + common/coverage/coverage-report-entry.pl | 69 + common/coverage/coverage-report.pl | 125 + common/coverage/coverage-report.xsl | 235 + common/coverage/lcov.mak | 47 + common/cruft.mak | 56 + common/download-translations | 152 + common/extract-release-date-from-doap-file | 32 + common/gettext.patch | 12 + common/glib-gen.mak | 44 + common/gst-autogen.sh | 345 + common/gst-indent | 49 + common/gst.supp | 3967 ++++ common/gstdoc-scangobj | 1617 ++ common/gtk-doc-plugins.mak | 382 + common/gtk-doc.mak | 227 + common/m4/Makefile.am | 40 + common/m4/Makefile.in | 594 + common/m4/README | 3 + common/m4/as-ac-expand.m4 | 43 + common/m4/as-auto-alt.m4 | 50 + common/m4/as-compiler-flag.m4 | 96 + common/m4/as-compiler.m4 | 44 + common/m4/as-docbook.m4 | 78 + common/m4/as-gcc-inline-assembly.m4 | 52 + common/m4/as-libtool-tags.m4 | 83 + common/m4/as-libtool.m4 | 46 + common/m4/as-python.m4 | 152 + common/m4/as-version.m4 | 75 + common/m4/ax_create_stdint_h.m4 | 734 + common/m4/check.m4 | 181 + common/m4/glib-gettext.m4 | 432 + common/m4/gst-arch.m4 | 140 + common/m4/gst-args.m4 | 360 + common/m4/gst-check.m4 | 294 + common/m4/gst-debuginfo.m4 | 46 + common/m4/gst-default.m4 | 120 + common/m4/gst-doc.m4 | 92 + common/m4/gst-dowhile.m4 | 24 + common/m4/gst-error.m4 | 298 + common/m4/gst-feature.m4 | 297 + common/m4/gst-function.m4 | 63 + common/m4/gst-gettext.m4 | 28 + common/m4/gst-glib2.m4 | 126 + common/m4/gst-libxml2.m4 | 52 + common/m4/gst-package-release-datetime.m4 | 89 + common/m4/gst-parser.m4 | 55 + common/m4/gst-platform.m4 | 67 + common/m4/gst-plugin-docs.m4 | 25 + common/m4/gst-plugindir.m4 | 17 + common/m4/gst-valgrind.m4 | 35 + common/m4/gst-x11.m4 | 70 + common/m4/gst.m4 | 36 + common/m4/gtk-doc.m4 | 70 + common/m4/introspection.m4 | 94 + common/m4/orc.m4 | 70 + common/m4/pkg.m4 | 157 + common/mangle-tmpl.py | 165 + common/orc.mak | 76 + common/parallel-subdirs.mak | 13 + common/plugins.xsl | 209 + common/po.mak | 4 + common/release.mak | 34 + common/scangobj-merge.py | 311 + common/upload-doc.mak | 64 + common/win32.mak | 78 + compile | 347 + config.guess | 1420 ++ config.h.in | 107 + config.sub | 1794 ++ configure | 19508 +++++++++++++++++++ configure.ac | 344 + depcomp | 791 + docs/Makefile.am | 20 + docs/Makefile.in | 751 + docs/README | 498 + docs/design/gst-rtp-server-design | 35 + docs/libs/Makefile.am | 106 + docs/libs/Makefile.in | 946 + docs/libs/gst-rtsp-server-docs.sgml | 49 + docs/libs/gst-rtsp-server-overrides.txt | 0 docs/libs/gst-rtsp-server-sections.txt | 697 + docs/libs/gst-rtsp-server.types | 25 + docs/libs/html/GstRTSPAuth.html | 613 + docs/libs/html/GstRTSPClient.html | 1371 ++ docs/libs/html/GstRTSPMedia.html | 2286 +++ docs/libs/html/GstRTSPMediaFactory.html | 1201 ++ docs/libs/html/GstRTSPMountPoints.html | 353 + docs/libs/html/GstRTSPServer.html | 1302 ++ docs/libs/html/GstRTSPSession.html | 881 + docs/libs/html/GstRTSPSessionPool.html | 730 + docs/libs/html/GstRTSPStream.html | 1832 ++ docs/libs/html/annotation-glossary.html | 70 + docs/libs/html/api-index-full.html | 1470 ++ docs/libs/html/ch01.html | 88 + docs/libs/html/gst-rtsp-server-1.0.devhelp2 | 391 + .../html/gst-rtsp-server-GstRTSPAddressPool.html | 734 + docs/libs/html/gst-rtsp-server-GstRTSPContext.html | 267 + .../gst-rtsp-server-GstRTSPMediaFactoryURI.html | 196 + docs/libs/html/gst-rtsp-server-GstRTSPParams.html | 149 + .../html/gst-rtsp-server-GstRTSPPermissions.html | 428 + docs/libs/html/gst-rtsp-server-GstRTSPSdp.html | 135 + .../html/gst-rtsp-server-GstRTSPSessionMedia.html | 589 + .../gst-rtsp-server-GstRTSPStreamTransport.html | 851 + .../html/gst-rtsp-server-GstRTSPThreadPool.html | 592 + docs/libs/html/gst-rtsp-server-GstRTSPToken.html | 443 + docs/libs/html/home.png | Bin 0 -> 256 bytes docs/libs/html/index.html | 93 + docs/libs/html/index.sgml | 533 + docs/libs/html/left-insensitive.png | Bin 0 -> 395 bytes docs/libs/html/left.png | Bin 0 -> 262 bytes docs/libs/html/right-insensitive.png | Bin 0 -> 373 bytes docs/libs/html/right.png | Bin 0 -> 261 bytes docs/libs/html/rtsp-server-hierarchy.html | 42 + docs/libs/html/style.css | 476 + docs/libs/html/up-insensitive.png | Bin 0 -> 374 bytes docs/libs/html/up.png | Bin 0 -> 260 bytes docs/version.entities.in | 2 + examples/Makefile.am | 14 + examples/Makefile.in | 832 + examples/test-appsrc.c | 137 + examples/test-auth.c | 186 + examples/test-cgroups.c | 276 + examples/test-launch.c | 71 + examples/test-mp4.c | 76 + examples/test-multicast.c | 104 + examples/test-multicast2.c | 125 + examples/test-ogg.c | 76 + examples/test-readme.c | 67 + examples/test-sdp.c | 98 + examples/test-uri.c | 114 + examples/test-video.c | 177 + examples/test-wfd.c | 133 + gst-rtsp-server.doap | 120 + gst-rtsp-server.manifest | 5 + gst/Makefile.am | 1 + gst/Makefile.in | 734 + gst/rtsp-server/Makefile.am | 128 + gst/rtsp-server/Makefile.in | 1065 + gst/rtsp-server/from_upstream.diff | 255 + gst/rtsp-server/gstwfdmessage.c | 2269 +++ gst/rtsp-server/gstwfdmessage.h | 660 + gst/rtsp-server/rtsp-address-pool.c | 751 + gst/rtsp-server/rtsp-address-pool.h | 182 + gst/rtsp-server/rtsp-auth.c | 636 + gst/rtsp-server/rtsp-auth.h | 173 + gst/rtsp-server/rtsp-client-wfd.c | 2087 ++ gst/rtsp-server/rtsp-client-wfd.h | 154 + gst/rtsp-server/rtsp-client.c | 3553 ++++ gst/rtsp-server/rtsp-client.h | 196 + gst/rtsp-server/rtsp-context.c | 92 + gst/rtsp-server/rtsp-context.h | 88 + gst/rtsp-server/rtsp-media-factory-uri.c | 645 + gst/rtsp-server/rtsp-media-factory-uri.h | 80 + gst/rtsp-server/rtsp-media-factory-wfd.c | 1007 + gst/rtsp-server/rtsp-media-factory-wfd.h | 126 + gst/rtsp-server/rtsp-media-factory.c | 1147 ++ gst/rtsp-server/rtsp-media-factory.h | 154 + gst/rtsp-server/rtsp-media.c | 3078 +++ gst/rtsp-server/rtsp-media.h | 235 + gst/rtsp-server/rtsp-mount-points.c | 370 + gst/rtsp-server/rtsp-mount-points.h | 91 + gst/rtsp-server/rtsp-params.c | 77 + gst/rtsp-server/rtsp-params.h | 38 + gst/rtsp-server/rtsp-permissions.c | 276 + gst/rtsp-server/rtsp-permissions.h | 101 + gst/rtsp-server/rtsp-sdp.c | 482 + gst/rtsp-server/rtsp-sdp.h | 40 + gst/rtsp-server/rtsp-server-wfd.c | 281 + gst/rtsp-server/rtsp-server-wfd.h | 153 + gst/rtsp-server/rtsp-server.c | 1430 ++ gst/rtsp-server/rtsp-server.h | 169 + gst/rtsp-server/rtsp-session-media.c | 505 + gst/rtsp-server/rtsp-session-media.h | 97 + gst/rtsp-server/rtsp-session-pool.c | 765 + gst/rtsp-server/rtsp-session-pool.h | 143 + gst/rtsp-server/rtsp-session.c | 649 + gst/rtsp-server/rtsp-session.h | 143 + gst/rtsp-server/rtsp-stream-transport.c | 503 + gst/rtsp-server/rtsp-stream-transport.h | 133 + gst/rtsp-server/rtsp-stream.c | 2730 +++ gst/rtsp-server/rtsp-stream.h | 186 + gst/rtsp-server/rtsp-thread-pool.c | 561 + gst/rtsp-server/rtsp-thread-pool.h | 179 + gst/rtsp-server/rtsp-token.c | 251 + gst/rtsp-server/rtsp-token.h | 97 + install-sh | 527 + ltmain.sh | 9661 +++++++++ m4/libtool.m4 | 7997 ++++++++ m4/ltoptions.m4 | 384 + m4/ltsugar.m4 | 123 + m4/ltversion.m4 | 23 + m4/lt~obsolete.m4 | 98 + missing | 215 + packaging/gst-rtsp-server.spec | 74 + packaging/orig/gst-rtsp.spec | 54 + packaging/orig/gst-rtsp.spec.in | 54 + pkgconfig/Makefile.am | 21 + pkgconfig/Makefile.in | 637 + pkgconfig/gstreamer-rtsp-server-uninstalled.pc.in | 12 + pkgconfig/gstreamer-rtsp-server.pc.in | 11 + test-driver | 139 + tests/Makefile.am | 19 + tests/Makefile.in | 840 + tests/check/Makefile.am | 62 + tests/check/Makefile.in | 1635 ++ tests/check/gst/addresspool.c | 286 + tests/check/gst/client.c | 929 + tests/check/gst/media.c | 434 + tests/check/gst/mediafactory.c | 336 + tests/check/gst/mountpoints.c | 147 + tests/check/gst/permissions.c | 107 + tests/check/gst/rtspserver.c | 1454 ++ tests/check/gst/sessionmedia.c | 399 + tests/check/gst/sessionpool.c | 197 + tests/check/gst/stream.c | 172 + tests/check/gst/threadpool.c | 236 + tests/check/gst/token.c | 99 + tests/test-cleanup.c | 68 + tests/test-reuse.c | 90 + 243 files changed, 135184 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 COPYING.LIB create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 LICENSE create mode 100644 LICENSE.LGPLv2.1 create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 RELEASE create mode 100644 REQUIREMENTS create mode 100644 TODO create mode 100644 acinclude.m4 create mode 100644 aclocal.m4 create mode 100755 autogen.sh create mode 100644 common/ChangeLog create mode 100644 common/Makefile.am create mode 100644 common/Makefile.in create mode 100644 common/README create mode 100644 common/c-to-xml.py create mode 100755 common/check-exports create mode 100644 common/check.mak create mode 100644 common/coverage/coverage-report-entry.pl create mode 100644 common/coverage/coverage-report.pl create mode 100644 common/coverage/coverage-report.xsl create mode 100644 common/coverage/lcov.mak create mode 100644 common/cruft.mak create mode 100755 common/download-translations create mode 100755 common/extract-release-date-from-doap-file create mode 100644 common/gettext.patch create mode 100644 common/glib-gen.mak create mode 100644 common/gst-autogen.sh create mode 100755 common/gst-indent create mode 100644 common/gst.supp create mode 100755 common/gstdoc-scangobj create mode 100644 common/gtk-doc-plugins.mak create mode 100644 common/gtk-doc.mak create mode 100644 common/m4/Makefile.am create mode 100644 common/m4/Makefile.in create mode 100644 common/m4/README create mode 100644 common/m4/as-ac-expand.m4 create mode 100644 common/m4/as-auto-alt.m4 create mode 100644 common/m4/as-compiler-flag.m4 create mode 100644 common/m4/as-compiler.m4 create mode 100644 common/m4/as-docbook.m4 create mode 100644 common/m4/as-gcc-inline-assembly.m4 create mode 100644 common/m4/as-libtool-tags.m4 create mode 100644 common/m4/as-libtool.m4 create mode 100644 common/m4/as-python.m4 create mode 100644 common/m4/as-version.m4 create mode 100644 common/m4/ax_create_stdint_h.m4 create mode 100644 common/m4/check.m4 create mode 100644 common/m4/glib-gettext.m4 create mode 100644 common/m4/gst-arch.m4 create mode 100644 common/m4/gst-args.m4 create mode 100644 common/m4/gst-check.m4 create mode 100644 common/m4/gst-debuginfo.m4 create mode 100644 common/m4/gst-default.m4 create mode 100644 common/m4/gst-doc.m4 create mode 100644 common/m4/gst-dowhile.m4 create mode 100644 common/m4/gst-error.m4 create mode 100644 common/m4/gst-feature.m4 create mode 100644 common/m4/gst-function.m4 create mode 100644 common/m4/gst-gettext.m4 create mode 100644 common/m4/gst-glib2.m4 create mode 100644 common/m4/gst-libxml2.m4 create mode 100644 common/m4/gst-package-release-datetime.m4 create mode 100644 common/m4/gst-parser.m4 create mode 100644 common/m4/gst-platform.m4 create mode 100644 common/m4/gst-plugin-docs.m4 create mode 100644 common/m4/gst-plugindir.m4 create mode 100644 common/m4/gst-valgrind.m4 create mode 100644 common/m4/gst-x11.m4 create mode 100644 common/m4/gst.m4 create mode 100644 common/m4/gtk-doc.m4 create mode 100644 common/m4/introspection.m4 create mode 100644 common/m4/orc.m4 create mode 100644 common/m4/pkg.m4 create mode 100644 common/mangle-tmpl.py create mode 100644 common/orc.mak create mode 100644 common/parallel-subdirs.mak create mode 100644 common/plugins.xsl create mode 100644 common/po.mak create mode 100644 common/release.mak create mode 100755 common/scangobj-merge.py create mode 100644 common/upload-doc.mak create mode 100644 common/win32.mak create mode 100755 compile create mode 100755 config.guess create mode 100644 config.h.in create mode 100755 config.sub create mode 100755 configure create mode 100644 configure.ac create mode 100755 depcomp create mode 100644 docs/Makefile.am create mode 100644 docs/Makefile.in create mode 100644 docs/README create mode 100644 docs/design/gst-rtp-server-design create mode 100644 docs/libs/Makefile.am create mode 100644 docs/libs/Makefile.in create mode 100644 docs/libs/gst-rtsp-server-docs.sgml create mode 100644 docs/libs/gst-rtsp-server-overrides.txt create mode 100644 docs/libs/gst-rtsp-server-sections.txt create mode 100644 docs/libs/gst-rtsp-server.types create mode 100644 docs/libs/html/GstRTSPAuth.html create mode 100644 docs/libs/html/GstRTSPClient.html create mode 100644 docs/libs/html/GstRTSPMedia.html create mode 100644 docs/libs/html/GstRTSPMediaFactory.html create mode 100644 docs/libs/html/GstRTSPMountPoints.html create mode 100644 docs/libs/html/GstRTSPServer.html create mode 100644 docs/libs/html/GstRTSPSession.html create mode 100644 docs/libs/html/GstRTSPSessionPool.html create mode 100644 docs/libs/html/GstRTSPStream.html create mode 100644 docs/libs/html/annotation-glossary.html create mode 100644 docs/libs/html/api-index-full.html create mode 100644 docs/libs/html/ch01.html create mode 100644 docs/libs/html/gst-rtsp-server-1.0.devhelp2 create mode 100644 docs/libs/html/gst-rtsp-server-GstRTSPAddressPool.html create mode 100644 docs/libs/html/gst-rtsp-server-GstRTSPContext.html create mode 100644 docs/libs/html/gst-rtsp-server-GstRTSPMediaFactoryURI.html create mode 100644 docs/libs/html/gst-rtsp-server-GstRTSPParams.html create mode 100644 docs/libs/html/gst-rtsp-server-GstRTSPPermissions.html create mode 100644 docs/libs/html/gst-rtsp-server-GstRTSPSdp.html create mode 100644 docs/libs/html/gst-rtsp-server-GstRTSPSessionMedia.html create mode 100644 docs/libs/html/gst-rtsp-server-GstRTSPStreamTransport.html create mode 100644 docs/libs/html/gst-rtsp-server-GstRTSPThreadPool.html create mode 100644 docs/libs/html/gst-rtsp-server-GstRTSPToken.html create mode 100644 docs/libs/html/home.png create mode 100644 docs/libs/html/index.html create mode 100644 docs/libs/html/index.sgml create mode 100644 docs/libs/html/left-insensitive.png create mode 100644 docs/libs/html/left.png create mode 100644 docs/libs/html/right-insensitive.png create mode 100644 docs/libs/html/right.png create mode 100644 docs/libs/html/rtsp-server-hierarchy.html create mode 100644 docs/libs/html/style.css create mode 100644 docs/libs/html/up-insensitive.png create mode 100644 docs/libs/html/up.png create mode 100644 docs/version.entities.in create mode 100644 examples/Makefile.am create mode 100644 examples/Makefile.in create mode 100644 examples/test-appsrc.c create mode 100644 examples/test-auth.c create mode 100644 examples/test-cgroups.c create mode 100644 examples/test-launch.c create mode 100644 examples/test-mp4.c create mode 100644 examples/test-multicast.c create mode 100644 examples/test-multicast2.c create mode 100644 examples/test-ogg.c create mode 100644 examples/test-readme.c create mode 100644 examples/test-sdp.c create mode 100644 examples/test-uri.c create mode 100644 examples/test-video.c create mode 100644 examples/test-wfd.c create mode 100644 gst-rtsp-server.doap create mode 100755 gst-rtsp-server.manifest create mode 100644 gst/Makefile.am create mode 100644 gst/Makefile.in create mode 100644 gst/rtsp-server/Makefile.am create mode 100644 gst/rtsp-server/Makefile.in create mode 100644 gst/rtsp-server/from_upstream.diff create mode 100644 gst/rtsp-server/gstwfdmessage.c create mode 100644 gst/rtsp-server/gstwfdmessage.h create mode 100644 gst/rtsp-server/rtsp-address-pool.c create mode 100644 gst/rtsp-server/rtsp-address-pool.h create mode 100644 gst/rtsp-server/rtsp-auth.c create mode 100644 gst/rtsp-server/rtsp-auth.h create mode 100644 gst/rtsp-server/rtsp-client-wfd.c create mode 100644 gst/rtsp-server/rtsp-client-wfd.h create mode 100644 gst/rtsp-server/rtsp-client.c create mode 100644 gst/rtsp-server/rtsp-client.h create mode 100644 gst/rtsp-server/rtsp-context.c create mode 100644 gst/rtsp-server/rtsp-context.h create mode 100644 gst/rtsp-server/rtsp-media-factory-uri.c create mode 100644 gst/rtsp-server/rtsp-media-factory-uri.h create mode 100644 gst/rtsp-server/rtsp-media-factory-wfd.c create mode 100644 gst/rtsp-server/rtsp-media-factory-wfd.h create mode 100644 gst/rtsp-server/rtsp-media-factory.c create mode 100644 gst/rtsp-server/rtsp-media-factory.h create mode 100644 gst/rtsp-server/rtsp-media.c create mode 100644 gst/rtsp-server/rtsp-media.h create mode 100644 gst/rtsp-server/rtsp-mount-points.c create mode 100644 gst/rtsp-server/rtsp-mount-points.h create mode 100644 gst/rtsp-server/rtsp-params.c create mode 100644 gst/rtsp-server/rtsp-params.h create mode 100644 gst/rtsp-server/rtsp-permissions.c create mode 100644 gst/rtsp-server/rtsp-permissions.h create mode 100644 gst/rtsp-server/rtsp-sdp.c create mode 100644 gst/rtsp-server/rtsp-sdp.h create mode 100644 gst/rtsp-server/rtsp-server-wfd.c create mode 100644 gst/rtsp-server/rtsp-server-wfd.h create mode 100644 gst/rtsp-server/rtsp-server.c create mode 100644 gst/rtsp-server/rtsp-server.h create mode 100644 gst/rtsp-server/rtsp-session-media.c create mode 100644 gst/rtsp-server/rtsp-session-media.h create mode 100644 gst/rtsp-server/rtsp-session-pool.c create mode 100644 gst/rtsp-server/rtsp-session-pool.h create mode 100644 gst/rtsp-server/rtsp-session.c create mode 100644 gst/rtsp-server/rtsp-session.h create mode 100644 gst/rtsp-server/rtsp-stream-transport.c create mode 100644 gst/rtsp-server/rtsp-stream-transport.h create mode 100644 gst/rtsp-server/rtsp-stream.c create mode 100644 gst/rtsp-server/rtsp-stream.h create mode 100644 gst/rtsp-server/rtsp-thread-pool.c create mode 100644 gst/rtsp-server/rtsp-thread-pool.h create mode 100644 gst/rtsp-server/rtsp-token.c create mode 100644 gst/rtsp-server/rtsp-token.h create mode 100755 install-sh create mode 100644 ltmain.sh create mode 100644 m4/libtool.m4 create mode 100644 m4/ltoptions.m4 create mode 100644 m4/ltsugar.m4 create mode 100644 m4/ltversion.m4 create mode 100644 m4/lt~obsolete.m4 create mode 100755 missing create mode 100755 packaging/gst-rtsp-server.spec create mode 100644 packaging/orig/gst-rtsp.spec create mode 100644 packaging/orig/gst-rtsp.spec.in create mode 100644 pkgconfig/Makefile.am create mode 100644 pkgconfig/Makefile.in create mode 100644 pkgconfig/gstreamer-rtsp-server-uninstalled.pc.in create mode 100644 pkgconfig/gstreamer-rtsp-server.pc.in create mode 100755 test-driver create mode 100644 tests/Makefile.am create mode 100644 tests/Makefile.in create mode 100644 tests/check/Makefile.am create mode 100644 tests/check/Makefile.in create mode 100644 tests/check/gst/addresspool.c create mode 100644 tests/check/gst/client.c create mode 100644 tests/check/gst/media.c create mode 100644 tests/check/gst/mediafactory.c create mode 100644 tests/check/gst/mountpoints.c create mode 100644 tests/check/gst/permissions.c create mode 100644 tests/check/gst/rtspserver.c create mode 100644 tests/check/gst/sessionmedia.c create mode 100644 tests/check/gst/sessionpool.c create mode 100644 tests/check/gst/stream.c create mode 100644 tests/check/gst/threadpool.c create mode 100644 tests/check/gst/token.c create mode 100644 tests/test-cleanup.c create mode 100644 tests/test-reuse.c diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..6b672b9 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Wim Taymans +Hyunjun Ko diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..c87cfe8 --- /dev/null +++ b/COPYING @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/COPYING.LIB b/COPYING.LIB new file mode 100644 index 0000000..c87cfe8 --- /dev/null +++ b/COPYING.LIB @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..9ec36fd --- /dev/null +++ b/ChangeLog @@ -0,0 +1,7649 @@ +=== release 1.4.1 === + +2014-08-27 Sebastian Dröge + + * configure.ac: + releasing 1.4.1 + +2014-08-05 16:12:19 +0200 Sebastian Dröge + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + rtsp-media: Query position and stop time only on the RTP parts of the pipeline + The RTCP parts, in specific the RTCP udpsinks, are not flushed when + seeking and will always continue counting the time. This leads to + the NPT after a backwards seek to be something completely different + to the actual seek position. + https://bugzilla.gnome.org/show_bug.cgi?id=732644 + +2014-07-02 22:45:07 +0530 Arun Raghavan + + * gst/rtsp-server/rtsp-media.c: + signals: Fix copy-pasto in target-state signal offset + +=== release 1.4.0 === + +2014-07-19 17:56:31 +0200 Sebastian Dröge + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-rtsp-server.doap: + Release 1.4.0 + +2014-07-16 20:39:42 +0900 Hyunjun Ko + + * gst/rtsp-server/rtsp-media.h: + media: correct misspelled words in description + https://bugzilla.gnome.org/show_bug.cgi?id=733244 + +=== release 1.3.91 === + +2014-07-11 12:19:08 +0200 Sebastian Dröge + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-rtsp-server.doap: + Release 1.3.91 + +2014-07-10 17:37:45 +0200 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + docs: update docs + +2014-07-10 17:10:06 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: implement client REMOVE filter + +2014-07-10 17:05:13 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: expose _close() method + Expose a previously internal close method to close the client + connection. + +2014-07-10 12:20:15 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-session-pool.c: + session-pool: signal session-removed outside of the lock + Release the lock before emiting the session-removed signal. + +2014-07-10 11:32:20 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-stream.c: + filter: Release lock in filter functions + Release the object lock before calling the filter functions. We need to + keep a cookie to detect when the list changed during the filter + callback. We also keep a hashtable to make sure we only call the filter + function once for each object in case of concurrent modification. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732950 + +2014-07-09 15:16:08 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-client.c: + client: check if watch is set in handle_teardown() + The unit tests run without a watch + +2014-07-09 14:19:10 +0200 Ognyan Tonchev + + * tests/check/gst/client.c: + client tests: send teardown to cleanup session + +2014-07-09 14:17:46 +0200 Ognyan Tonchev + + * tests/check/gst/rtspserver.c: + server tests: send teardown to cleanup session + +2014-07-09 15:01:31 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-client.c: + client: keep ref to client for the session removed handler + This extra ref will be dropped when all client sessions have been + removed. A session is removed when a client sends teardown, closes its + endpoint of the TCP connection or the sessions expires. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732226 + +2014-07-08 12:36:12 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-session.c: + * tests/check/gst/client.c: + client: manage media in session as a last step + Once we manage a media in a session, we can't unmanage it anymore + without destroying it. Therefore, first check everything before we + manage the media, otherwise if something is wrong we have no way to + unmanage the media. + If we created a new session and something went wrong, remove the session + again. Fixes a leak in the unit test. + +2014-07-03 19:52:42 +0100 Tim-Philipp Müller + + * examples/test-mp4.c: + * examples/test-ogg.c: + examples: print 'stream ready at url' for mp4 and ogg example + +2014-07-02 16:04:53 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-sdp.c: + rtsp: fix for MIKEY api change + +2014-07-01 16:12:13 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: free watch context only once + The watch context is freed when the source is destroyed. Avoids + a CRITICAL when we try to unref the context twice. + +2014-07-01 15:02:15 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: fix build + +2014-07-01 14:41:14 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: protect sessions with lock + Protect the list of sessions with the lock. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732226 + +2014-07-01 12:13:47 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + Client: keep a ref to the session + Don't just keep a weak ref to the session objects but use a hard ref. We + will be notified when a session is removed from the pool (expired) with + the new session-removed signal. + Don't automatically close the RTSP connection when all the sessions of + a client are removed, a client can continue to operate and it can create + a new session if it wants. If you want to remove the client from the + server, you have to use gst_rtsp_server_client_filter() now. + Based on patch from Ognyan Tonchev + See https://bugzilla.gnome.org/show_bug.cgi?id=732226 + +2014-06-30 15:14:34 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + session-pool: add session-removed signal + Add a signal to be notified when a session is removed from the pool. + +2014-06-30 00:37:59 -0700 Evan Nemerson + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-server.h: + Make rtsp-server.h a single-include header, use it for G-I + https://bugzilla.gnome.org/show_bug.cgi?id=732411 + +=== release 1.3.90 === + +2014-06-28 11:48:29 +0200 Sebastian Dröge + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-rtsp-server.doap: + Release 1.3.90 + +2014-06-27 16:54:22 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: crypto can be NULL + +2014-06-11 16:42:08 -0700 Evan Nemerson + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-mount-points.c: + introspection: add missing allow-none annotations + https://bugzilla.gnome.org/show_bug.cgi?id=730952 + +2014-06-11 16:38:36 -0700 Evan Nemerson + + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-token.c: + introspection: add (nullable) annotations to return values + https://bugzilla.gnome.org/show_bug.cgi?id=730952 + +2014-06-24 09:48:45 +0200 Evan Nemerson + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-stream.c: + gi: improve annotations + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=730953 + +2014-06-24 09:43:44 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-server.c: + signals: use generic marshal function + Use the generic C marshal function. + Use more explicit type instead of G_TYPE_POINTER + +2014-06-24 09:42:47 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-context.h: + context: add type macro + +2014-06-24 09:34:50 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-sdp.h: + sdp: hide key length defines + They don't have a namespace. + +2014-06-22 19:37:31 +0200 Sebastian Dröge + + * configure.ac: + Back to development + +=== release 1.3.3 === + +2014-06-22 19:36:14 +0200 Sebastian Dröge + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-rtsp-server.doap: + Release 1.3.3 + +2014-05-20 14:48:37 -0700 Aleix Conchillo Flaqué + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-sdp.h: + mikey: add different key length parameters + Add encryption and authentication key length parameters to MIKEY. For + the encoders, the key lengths are obtained from the cipher and auth + algorithms set in the caps. For the decoders, they are obtained while + parsing the key management from the client. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=730472 + +2014-03-16 17:29:48 +0100 Ognyan Tonchev + + * tests/check/gst/stream.c: + stream tests: Make sure we get right multicast address from stream + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=731577 + +2014-06-12 13:49:17 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-client.c: + client: ref the context until rtsp watch is alive + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=731569 + +2014-06-12 13:48:44 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-client.c: + client: Destroy the rtsp watch after connection close + +2014-06-13 16:46:06 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: fix confusing comment + +2014-05-27 12:36:52 +0200 Göran Jönsson + + * gst/rtsp-server/rtsp-session.c: + rtsp-session: Timeout in header. + Adding the possbilty to always have timout in header. + This is configurabe with setting "timeout-always-visible". + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728264 + +2014-05-21 13:23:40 +0200 Sebastian Dröge + + * configure.ac: + Back to development + +=== release 1.3.2 === + +2014-05-21 13:06:36 +0200 Sebastian Dröge + + * ChangeLog: + * NEWS: + * RELEASE: + * common: + * configure.ac: + * gst-rtsp-server.doap: + Release 1.3.2 + +2014-05-21 10:54:05 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 211fa5f to 1f5d3c3 + +2014-05-20 15:57:30 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: store TCP ports in transport + Store the TCP ports in the transport when we are doing RTSP over TCP. + This way, we can easily get to the ports from the transport. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=729776 + +2014-05-15 18:15:04 -0700 Aleix Conchillo Flaqué + + * gst/rtsp-server/rtsp-stream.c: + stream: add signals for new RTP/RTCP encoders + New signals to allow the user to configure the dynamically created + encoders. + https://bugzilla.gnome.org/show_bug.cgi?id=730228 + +2014-05-14 09:31:31 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: Make suspend()/unsuspend() virtual + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=730109 + +2014-05-09 17:25:07 -0700 Aleix Conchillo Flaqué + + * gst/rtsp-server/rtsp-client.c: + client: fix send-message signal marshaller + Use generic marshalling for the send-message signal. It has + two POINTER arguments, not just one. + https://bugzilla.gnome.org/show_bug.cgi?id=729900 + +2014-05-09 15:08:48 +0200 Wim Taymans + + * tests/check/gst/media.c: + tests: add and remove pads only once + In this test we simulate a dynamic pad by watching the caps event. + Because of renegotiation in the base payloader now, this caps is sent + multiple times but we can only deal with 1 invocation, use a variable to + only 'add and remove' the pad once. + +2014-05-02 20:06:29 +0100 Tim-Philipp Müller + + * tests/check/gst/rtspserver.c: + tests: add unit test for correct handling of Require headers + https://bugzilla.gnome.org/show_bug.cgi?id=729426 + +2014-05-02 19:59:23 +0100 Tim-Philipp Müller + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: handle Require headers and respond with OPTION_NOT_SUPPORTED + Servers must handle Require headers and must report a failure + if they don't handle any of the Required options, see RFC 2326, + section 12.32: https://tools.ietf.org/html/rfc2326#page-54 + https://bugzilla.gnome.org/show_bug.cgi?id=729426 + +2014-05-03 20:48:43 +0200 Sebastian Dröge + + * configure.ac: + Back to development + +=== release 1.3.1 === + +2014-05-03 18:40:24 +0200 Sebastian Dröge + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-rtsp-server.doap: + Release 1.3.1 + +2014-05-03 10:18:00 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From bcb1518 to 211fa5f + +2014-05-02 19:58:15 +0100 Tim-Philipp Müller + + * .gitignore: + Update .gitignore + +2014-05-02 19:57:23 +0100 Tim-Philipp Müller + + * tests/check/gst/sessionmedia.c: + tests: fix memory leak in sessionmedia unit test + +2014-05-01 06:17:06 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: emit a signal before sending a message + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728970 + +2014-05-01 06:07:08 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: pass context to send_message + Pass the current context to send_message, we will need it later. + +2014-05-01 05:29:54 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: fix typo in comment + +2014-04-14 15:17:14 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + media: Do not stop thread twice if default_prepare() fails + +2014-04-15 16:51:17 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: set the watch to flushing before going to NULL + First set the watch to flushing so that we unblock any current and + future attempt to send data on the watch, Then set the pipeline to + NULL. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728153 + +2014-04-11 23:52:49 +0200 Linus Svensson + + * gst/rtsp-server/rtsp-session-pool.c: + * tests/check/gst/sessionpool.c: + rtsp-session-pool: Fixes annotation + Fixes annotation for gst_rtsp_session_pool_create() and memory leaks + in the sessionpool test. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728060 + +2014-04-09 16:44:21 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: make media_prepare virtual + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728029 + +2014-04-12 05:57:00 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + * tests/check/gst/media.c: + media: stop the thread in more error cases + +2014-04-12 05:53:15 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + * tests/check/gst/media.c: + media: allow NULL as the thread + Use the default context whan passing a NULL thread. + +2014-04-10 16:39:11 +0100 Vincent Penquerc'h + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: indent cleanup + Coverity was moaning about unreachable code, and I think it was just + confused by { being before the label. We'll see if it pops up again. + Coverity 1197705 + +2014-04-01 13:04:21 +0200 Göran Jönsson + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + client: Add drop-backlog property + When we have too many messages queued for a client (currently hardcoded + to 100) we overflow and drop the messages. Add a drop-backlog property + to control this behaviour. Setting this property to FALSE will retry + to send the messages to the client by waiting for more room in the + backlog. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725898 + +2014-04-03 12:19:51 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-client.c: + client: support for POST before GET when setting up a tunnel + +2014-04-02 12:03:32 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-client.c: + client: remove watch of the second client after http tunnel setup + The second client will be freed after the HTTP tunnel has been set up. + Make sure it's RTSP watch is never dispatched again. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727488 + +2014-03-31 11:00:11 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + * tests/check/gst/media.c: + media: Make media_prepare() fail if port allocation fails + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727376 + +2014-04-01 16:55:13 +0200 Linus Svensson + + * tests/check/gst/media.c: + media test: cleanup the thread pool in tests + +2014-04-01 13:16:26 +0200 Linus Svensson + + * gst/rtsp-server/rtsp-media.c: + * tests/check/gst/media.c: + rtsp-media: Unblock blocked streams in unprepare + The streams will be blocked when a live media is prepared. + The streams should be unblocked in gst_rtsp_media_unprepare. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727231 + +2014-04-08 14:49:41 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: release the state lock when going to NULL + Set our state to UNPREPARING and release the state-lock before + setting the pipeline to the NULL state. This way, any pad-added + callback will be able to take the state-lock and check that we are now + unpreparing instead of deadlocking. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727102 + +2014-04-08 12:08:17 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: protect status with lock + Make sure we only update the status with the lock. + +2014-04-04 17:39:36 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-sdp.c: + rtsp: update for MIKEY API changes + +2014-04-03 12:52:51 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: parse the mikey response from the client + Parse the mikey response from the client and update the policy for + each SSRC. + +2014-04-02 12:36:16 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add method to set crypto info + Make a method to configure the crypto information of a stream. + Set udpsrc in READY instead of PAUSED so that we can configure caps + later. + +2014-04-03 12:57:13 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: cleanup error paths + +2014-04-02 12:27:24 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: fix docs + +2014-03-25 12:42:39 +0100 Wim Taymans + + * examples/test-video.c: + test: enable SRTP only on RTSPS + We only want to enable SRTP when doing rtsp over TLS so that we can + exchange the keys in a secure way. + +2014-03-25 12:41:33 +0100 Wim Taymans + + * examples/test-video.c: + test: print an error on failure + +2014-03-13 17:35:21 +0100 Wim Taymans + + * configure.ac: + * examples/test-video.c: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-stream.c: + * tests/check/Makefile.am: + stream: add SRTP support + Install srtp encoder and decoder elements in rtpbin + Add MIKEY in SDP + +2014-03-16 19:45:26 +0100 Sebastian Rasmussen + + * tests/check/Makefile.am: + * tests/check/gst/sessionpool.c: + tests: Add unit tests for sessionpool + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726470 + +2014-03-22 13:24:27 +0100 Sebastian Rasmussen + + * tests/check/gst/threadpool.c: + tests: Improve code coverage of rtsp-threadpool tests + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726873 + +2014-03-23 21:26:00 +0100 Sebastian Rasmussen + + * tests/check/gst/sessionmedia.c: + tests: Improve code coverage for rtsp-session-media + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726940 + +2014-03-23 21:24:48 +0100 Sebastian Rasmussen + + gobject-introspection: Add annotations to support language bindings + In addition a few cosmetic changes: + * Adjust the order of arguments + * Fix typo: occured -> occurred + * Fix indentation after Return:-clauses + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726941 + +2014-03-14 19:03:24 +0100 Sebastian Rasmussen + + * gst/rtsp-server/rtsp-stream.c: + rtsp-stream: Don't mix IPv4 and IPv6 addresses + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726362 + +2014-03-13 14:27:15 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: take caps after the session manager + Take the caps for the SDP after they leave the rtpbin so that we can + also get the properties added by rtpbin elements. + +2014-03-13 14:20:17 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: release lock while pushing out packets + Keep a cache of the transports and use this to iterate the transport + while pushing packets. This allows us to release the lock early. + See https://bugzilla.gnome.org/show_bug.cgi?id=725898 + +2014-03-06 13:52:02 +0100 David Svensson Fors + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + rtsp-client: vmethod for modifying tunnel GET response + Add a vmethod tunnel_http_response where the response to the HTTP GET + for tunneled connections can be modified. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725879 + +2014-03-03 16:56:53 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-sdp.c: + sdp: make 1 media line per profile + If we have multiple profiles (AVP or AVPF) for a stream, make one m= + line in the SDP for each profile. The client is then supposed to pick + one of the profiles in the SETUP request. Because the m= lines have the + same pt, the client also knows that only 1 option is possible. + +2014-03-03 16:55:48 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + factory: add profile property and pass to media and streams + +2014-03-03 15:12:55 +0100 Wim Taymans + + * examples/test-multicast.c: + * gst/rtsp-server/rtsp-sdp.c: + sdp: pass multicast connection for multicast-only stream + Pass the multicast address of the stream in the connection info in the + SDP so that clients try a multicast connection first. + Only allow multicast connections in the test-multicast example. Also + increase the TTL a little. + +2014-03-02 05:12:01 +0100 Sebastian Rasmussen + + * .gitignore: + .gitignore: Ignore gcov intermediate files + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725484 + +2014-03-03 12:17:48 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: release some locks in error cases + +2014-03-02 05:12:10 +0100 Sebastian Rasmussen + + docs: Enable and fix gtk-doc warnings + * Makefile: Enable gtk-doc warnings, like the rest of GStreamer + * addresspool/mediafactory: Add missing annotation colon + * stream: Annotate return value + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725528 + +2014-02-28 09:36:49 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From fe1672e to bcb1518 + +2014-02-26 22:15:51 +0100 Stefan Sauer + + * common: + Automatic update of common submodule + From 1a07da9 to fe1672e + +2014-02-25 15:13:40 +0000 Tim-Philipp Müller + + * examples/Makefile.am: + examples: use LDADD for libs instead of LDFLAGS + +2014-02-25 14:42:09 +0000 Tim-Philipp Müller + + * configure.ac: + configure: make sure releases are in .doap file + +2014-02-25 14:11:00 +0000 Tim-Philipp Müller + + * examples/test-cgroups.c: + examples: test-cgroups: don't put code with side effects into g_assert() + The g_assert() might get compiled out with the right + compiler/preprocessor flags. + +2014-02-25 14:07:50 +0000 Tim-Philipp Müller + + * examples/.gitignore: + examples: add cgroup test binary to .gitignore + +2014-02-25 14:06:47 +0000 Tim-Philipp Müller + + * examples/test-cgroups.c: + examples: fix cgroup test build + Fixes build failure caused by compiler warning: + test-cgroups.c:82:35: error: no previous prototype for ‘gst_rtsp_cgroup_pool_get_type’ [-Werror=missing-prototypes] + +2014-02-21 16:46:45 +0000 Tim-Philipp Müller + + * .gitignore: + .gitignore: ignore temp files created in the course of 'make check' + +2014-02-18 09:44:34 +0100 Branko Subasic + + * gst/rtsp-server/rtsp-media.c: + rtsp-media: don't loose frames handling new PLAY request + If client supplied a range check if the range specifies the start point. + If not, then do an accurate seek to the current position. If a start + point was specified do do a key unit seek to make sure the streaming + starts with decodeable frames. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=724611 + +2014-02-18 16:58:45 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + Revert "media: only flush when setting a new start position" + This reverts commit f67fc23aab59f28796bebf130504ff46ccb97b0a. + We need to do the flush in all cases, demuxer block currently for + non-flushing seeks. + +2014-02-18 16:38:39 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: only flush when setting a new start position + Only flush the pipeline when we change the start position with + a seek. + See https://bugzilla.gnome.org/show_bug.cgi?id=724611 + +2014-02-17 10:43:05 +0100 Göran Jönsson + + * gst/rtsp-server/rtsp-stream.c: + stream: set ttl-mc before adding the socket + Set ttl-mc before adding the socket. Otherwise the value ttl-mc will + never be set on socket. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=724531 + +2014-02-11 14:20:39 -0800 Aleix Conchillo Flaqué + + * gst/rtsp-server/rtsp-media.c: + media: stop thread if media is already prepared + in gst_rtsp_media_prepare() the thread is not used if media is already + prepared (e.g. media shared) so we want to stop the thread. otherwise, a + leak occurs. + https://bugzilla.gnome.org/show_bug.cgi?id=724182 + +2014-02-09 10:52:29 +0100 Sebastian Dröge + + * Makefile.am: + build: Ship gst-rtsp-server.doap file + +2014-02-09 10:47:09 +0100 Sebastian Dröge + + * tests/check/gst/rtspserver.c: + tests: Fix another compiler warning with gcc + +2014-02-09 10:45:28 +0100 Sebastian Dröge + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-mount-points.c: + * gst/rtsp-server/rtsp-stream.c: + * tests/check/gst/client.c: + rtsp-server: Fix lots of compiler warnings with clang + +2014-02-09 10:41:14 +0100 Sebastian Dröge + + * configure.ac: + * gst-rtsp-server.doap: + * tests/Makefile.am: + configure: Synchronise with the configure scripts of the other modules + +2014-02-09 10:25:44 +0100 Sebastian Dröge + + * configure.ac: + configure: Update version to 1.3.0.1 and require GStreamer 1.3.0 + +2014-02-09 10:19:50 +0100 Sebastian Dröge + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-stream.c: + Revert "rtsp-server: support build against last stable release" + This reverts commit 099a10f61f11413ad0ada8ee0b7b7ad1210b1b2f. + Let us require 1.2.3 now, which is going to be released in a few + minutes. + +2014-02-07 16:39:49 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-stream-transport.c: + session: improve RTP-Info + Ignore streams that can't generate RTP-Info instead of failing. + Don't return the empty string when all streams are unconfigured but + return NULL so that we don't generate and empty RTP-Info header. + Improve docs a little. + +2014-02-03 22:41:48 +0200 Andrey Utkin + + * gst/rtsp-server/rtsp-session-media.c: + Don't free rtpinfo GString when it is NULL + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=723554 + +2014-02-06 09:48:05 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: only set keyframe flag when modifying start + Only set the keyframe flag when we modify the start position. The + keyframe flag should probably be ignored when no change is requested but + until we can claim this is all documented properly and all demuxer + implement this, avoid setting the flag. + See also https://bugzilla.gnome.org/show_bug.cgi?id=723075 + +2014-02-06 09:03:50 +0100 Ognyan Tonchev + + * gst/rtsp-server/rtsp-thread-pool.c: + thread-pool: Unref source after mainloop has quit to avoid races in GLib + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=723741 + +2014-02-04 16:27:12 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: handle NULL seqnum and rtptime arguments + +2014-01-31 15:02:22 +0100 Ognyan Tonchev + + * gst/rtsp-server/rtsp-thread-pool.c: + * tests/check/gst/threadpool.c: + thread-pool: Unref reused threads in gst_rtsp_thread_stop() + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=723519 + +2014-02-04 10:14:45 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: add fallback for missing stats property + Use a fallback when the payloader does not have a stats property + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=723554 + +2014-01-30 10:45:56 +0100 Edward Hervey + + * common: + Automatic update of common submodule + From f7bc1c3 to 1a07da9 + +2014-01-28 14:51:26 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: don't leak stats structure + Don't leak the stats structure and deal with NULL stats. + +2014-01-22 22:03:14 +0100 Sebastian Rasmussen + + * gst/rtsp-server/rtsp-stream.c: + stream: Get rtpinfo properties atomically from payloader + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=722844 + +2014-01-21 14:46:47 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: refactor state change functions and signals + Make functions to set the target state and the pipeline state and emit + the signals from those functions. + +2014-01-21 12:01:25 +0100 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add signal to notify of pending state changes + +2014-01-12 16:55:21 +0000 Tim-Philipp Müller + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-stream.c: + rtsp-server: support build against last stable release + Until 1.2.3 is out with the new get_type function and we + can require that. + +2014-01-07 15:28:05 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: fix compilation + +2014-01-07 12:21:09 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add property to configure profiles + +2014-01-07 12:28:47 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: let stream check supported transport + Delegate the check if a transport is allowed to the stream. + See https://bugzilla.gnome.org/show_bug.cgi?id=720696 + +2014-01-07 12:14:15 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add method to check supported transport + Add a method to check if a transport is supported + +2013-12-27 13:11:45 +0100 Sebastian Dröge + + * configure.ac: + configure.ac: Only check for gstreamer-check, not check + We include check in gstreamer-check since quite some time now. + +2013-12-26 17:02:50 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: return clock-rate from get_rtpinfo + And use it to correct the rtptime to the requested start-time. + See https://bugzilla.gnome.org/show_bug.cgi?id=712198 + +2013-12-26 16:28:59 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + session-media: calculate start-time + +2013-12-26 14:43:35 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: also return the running-time + Return the running-time in the rtpinfo as well. + +2013-12-26 15:41:14 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-media.h: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + session-media: let the session-media make the RTPInfo + Add method to create the RTPInfo for a stream-transport. + Add method to create the RTPInfo for all stream-transports in a + session-media. + Use the session-media RTPInfo code in client. This allows us to refactor + another method to link the TCP callbacks. + +2013-12-20 16:39:07 -0800 Aleix Conchillo Flaqué + + mount-points: sort sequence before g_sequence_lookup + * gst/rtsp-server/rtsp-mount-points.c (gst_rtsp_mount_points_remove_factory): + sort sequence if dirty, otherwise lookup will fail. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=720855 + +2013-12-22 23:16:56 +0000 Tim-Philipp Müller + + * configure.ac: + configure: rename package from gst-rtsp to gst-rtsp-server + To match git module name and avoid confusion with the + rtsp lib in gst-plugins-base and rtsp plugin in -good. + +2013-12-22 23:15:02 +0000 Tim-Philipp Müller + + * configure.ac: + configure: bump core/base/good requirement to 1.2.0 + Bump to released stable version and make implicit + requirements explicit. + +2013-12-22 23:04:48 +0000 Tim-Philipp Müller + + * autogen.sh: + * common: + * configure.ac: + Fix broken gettext setup which is not used anyway + +2013-12-22 22:36:06 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From dbedaa0 to d48bed3 + +2013-12-18 16:37:27 +0100 Aleix Conchillo Flaqué + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add setup_sdp vmethod + gst/rtsp-server/rtsp-media.[ch]: added setup_sdp vmethod and public + gst_rtsp_media_setup_sdp. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=720155 + +2013-12-19 14:26:34 +0100 Edward Hervey + + * gst/rtsp-server/rtsp-stream.c: + rtsp-stream: Check return value of sscanf + streamid is only valid if sscanf matched something. + +2013-12-19 14:24:54 +0100 Edward Hervey + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: Fix iteration + Wouldn't even enter the code block otherwise (i++ was used as the check + and not the postfix). + +2013-12-18 15:57:03 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: add vmethod to configure media and streams + Implement a vmethod that can be used to configure the media and the + streams based on the current context. Handle the blocksize handling in + the default handler. + See https://bugzilla.gnome.org/show_bug.cgi?id=720667 + +2013-12-12 00:38:07 +0000 Tim-Philipp Müller + + * .gitignore: + Make git ignore more unit test binaries + +2013-12-12 00:36:07 +0000 Tim-Philipp Müller + + * gst/rtsp-server/rtsp-address-pool.h: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-context.h: + * gst/rtsp-server/rtsp-media-factory-uri.h: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-mount-points.h: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-media.h: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.h: + * gst/rtsp-server/rtsp-stream-transport.h: + * gst/rtsp-server/rtsp-stream.h: + * gst/rtsp-server/rtsp-thread-pool.h: + * gst/rtsp-server/rtsp-token.h: + rtsp-server: add padding to many public structures + Not mini objects though, since they are not subclassable + anyway, nor kept on the stack or inlined in a structure. + +2013-12-03 11:54:42 -0800 Aleix Conchillo Flaqué + + media: add new create_rtpbin vmethod + * gst/rtsp-server/rtsp-media.[ch]: add new create_rtpbin vmethod. + https://bugzilla.gnome.org/show_bug.cgi?id=719734 + +2013-12-03 00:34:52 +0100 Sebastian Rasmussen + + * tests/check/gst/media.c: + tests: fix memory leak, free test's thread pool + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=719733 + +2013-11-29 15:50:52 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream-transport.c: + stream-transport: free url in finalize + +2013-11-29 15:50:23 +0100 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + media: also do state change in suspended state + +2013-11-29 10:53:08 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + media: also handle prepare and range in suspended state + When we are suspended, we are already prepared. + We can get the range in the suspended state. + +2013-11-27 15:04:04 +0100 Branko Subasic + + * tests/check/Makefile.am: + * tests/check/gst/sessionmedia.c: + check: add test for uri in setup + Added unit tests for the new functionality in GstRTSPStreamTransport. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=715168 + +2013-11-28 17:47:18 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: store setup uri and use in PLAY response + Store the uri used when doing the setup and use that in the PLAY + response. + fixes https://bugzilla.gnome.org/show_bug.cgi?id=715168 + +2013-11-28 17:35:45 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + stream-transport: add method to get/set url + +2013-11-28 14:14:35 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: suspend after SDP and unsuspend before PLAYING + Based on patches by Ognyan Tonchev + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=711257 + +2013-11-28 14:10:19 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session.c: + * tests/check/gst/media.c: + * tests/check/gst/mediafactory.c: + media: add suspend modes + Add support for different suspend modes. The stream is suspended right after + producing the SDP and after PAUSE. Different suspend modes are available that + affect the state of the pipeline. NONE leaves the pipeline state unchanged and + is the current and old behaviour, PAUSE will set the pipeline to the PAUSED + state and RESET will bring the pipeline to the NULL state. + A stream is also unsuspended when it goes back to PLAYING, for RESET streams, + this means that the pipeline needs to be prerolled again. + Base on patches by Ognyan Tonchev + See https://bugzilla.gnome.org/show_bug.cgi?id=711257 + +2013-11-28 14:06:53 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: start live streams in blocked state + Start live streams in the blocked state and make them preroll using the + messages. This ensure that no data is played by the sink until we explicitly + unblock the stream right before going to PLAYING. + See https://bugzilla.gnome.org/show_bug.cgi?id=711257 + +2013-11-28 13:58:05 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: refactor starting and waiting for preroll + Based on patches from Ognyan Tonchev + See https://bugzilla.gnome.org/show_bug.cgi?id=711257 + +2013-11-28 13:42:21 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add API to block streams + Add an API to block on the streams and make it post a message. + Based on patch by Ognyan Tonchev + See https://bugzilla.gnome.org/show_bug.cgi?id=711257 + +2013-11-27 15:42:45 +0100 Edward Hervey + + * docs/libs/Makefile.am: + docs: Specify the override file + Even if it's empty (for now) it avoids make distcheck complaining + +2013-11-26 17:23:04 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: move default implementations to where they are used + +2013-11-26 16:25:37 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: take the right lock in gst_rtsp_media_set_pipeline_state() + We need to take the state_lock when calling this method. + +2013-11-26 16:24:35 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: handle add-added on non-bins too + Handle dynamic payloaders that are not bins, as used in the unit-test. + +2013-11-22 01:30:53 +0100 Sebastian Rasmussen + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + rtsp-media/-factory: Fix request pad name comments + These must be escaped for gtk-doc to parse the comments without warnings. + +2013-11-20 15:51:54 -0800 Aleix Conchillo Flaque + + rtsp-media: remove transports if media is in error status + * gst/rtsp-server/rtsp-media.c (gst_rtsp_media_set_state): if we are + trying to change to GST_STATE_NULL and media is in error status, we + remove all transports. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=712776 + +2013-11-22 11:16:20 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + rtsp-media: use element metadata to find payloader + Use the element metadata to find the payloader instead of checking + for the base class. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=712396 + +2013-11-15 12:14:32 -0800 Aleix Conchillo Flaque + + rtsp-stream: add getter for payload type + * gst/rtsp-server/rtsp-stream.c: add new method gst_rtsp_stream_get_pt. + * gst/rtsp-server/rtsp-media.c (pad_added_cb): find real payloader + element and create the stream with this one instead of the dynpay%d + element. + https://bugzilla.gnome.org/show_bug.cgi?id=712396 + +2013-11-22 02:28:28 +0100 Sebastian Rasmussen + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-context.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-mount-points.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-token.c: + rtsp-*: Refer to NULL as a constant in comments + Plus one typo fix. + https://bugzilla.gnome.org/show_bug.cgi?id=714988 + +2013-11-22 03:10:01 +0100 Sebastian Rasmussen + + rtsp-*: Fix type name typos in comments + * rtsp-auth: Refer to GstRTSPToken, not GstRTSPtoken + * rtsp-auth: Refer to part of constant name as text + * rtsp-auth/-permissions/-token: Refer to Permissions not Permission + * rtsp-session-media: Fix GstRTSPSessionMedia typo + * rtsp-stream: Fix typo when refering to GstBin + https://bugzilla.gnome.org/show_bug.cgi?id=714988 + +2013-11-22 00:45:17 +0100 Sebastian Rasmussen + + * docs/README: + * docs/libs/gst-rtsp-server-docs.sgml: + * docs/libs/gst-rtsp-server-sections.txt: + docs: Improve documentation + * Include annotation-glossary to quiet gtk-doc + * Rename remaining ClientState -> Context + * Rename object hierarchy file + * Remove stale chapter references + * Add missing function and object references + * Include missing GstRTSPAddressPoolResult + https://bugzilla.gnome.org/show_bug.cgi?id=714988 + +2013-11-18 10:47:04 +0000 Tim-Philipp Müller + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-stream.c: + rtsp-server: sprinkle some allow-none annotations for g-i + +2013-11-18 11:18:15 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add method to filter transports + Add a method to safely iterate and collect the stream transports + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=711664 + +2013-11-15 16:35:05 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session.c: + rtsp: allow NULL func in filters + Passing a null function make the filters return a list of + refcounted objects. + +2013-11-12 16:52:35 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-address-pool.c: + * tests/check/gst/addresspool.c: + address-pool: fix address increment + Use a guint instead of guint8 to increment the address. It's still not + completely correct because a guint might not be able to hold the complete + address range, but that's an enhacement for later. + Add unit test to test improved behaviour. + https://bugzilla.gnome.org/show_bug.cgi?id=708237 + +2013-11-12 10:55:14 +0100 Patricia Muscalu + + * gst/rtsp-server/rtsp-client.c: + * tests/check/gst/client.c: + client: allow absolute path in requests + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=711689 + +2013-11-07 13:22:09 +0100 Patricia Muscalu + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: make make_path_from_uri a vmethod + +2013-11-12 12:04:55 +0100 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + * tests/check/Makefile.am: + * tests/check/gst/stream.c: + stream: Add functions to get rtp and rtcp sockets + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=710100 + +2013-11-12 11:21:55 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-context.c: + * gst/rtsp-server/rtsp-context.h: + context: defing a GType for the context + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=710018 + +2013-10-12 23:56:00 +0200 Sebastian Pölsterl + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-context.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-mount-points.c: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-stream.c: + Fixed several GIR warnings + +2013-11-12 11:15:46 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + auth: small typos + +2013-10-19 19:25:27 +0200 Sebastian Rasmussen + + * tests/check/Makefile.am: + * tests/check/gst/token.c: + tests: Add unit tests for token + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=710520 + +2013-10-19 19:24:34 +0200 Sebastian Rasmussen + + * gst/rtsp-server/rtsp-token.c: + token: Validate args for gst_rtsp_token_is_allowed + See https://bugzilla.gnome.org/show_bug.cgi?id=710520 + +2013-10-19 19:21:53 +0200 Sebastian Rasmussen + + * gst/rtsp-server/rtsp-token.c: + token: Fix bug when creating empty token + We always want to have a valid GstStructure in the token. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=710520 + +2013-11-12 10:28:55 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-thread-pool.c: + thread-pool: avoid race in shutdown + If we call g_main_loop_quit before the thread has entered g_main_loop_run, we + don't actually stop the mainloop ever. Solve this race by adding an idle source + to the mainloop that calls the _quit. This way we immediately exit the mainloop + if quit was called before we started it. + +2013-10-19 17:36:05 +0200 Sebastian Rasmussen + + * tests/check/Makefile.am: + * tests/check/gst/permissions.c: + tests: Add unit tests for permissions + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=710202 + +2013-10-15 18:50:47 +0200 Sebastian Rasmussen + + * tests/check/gst/mediafactory.c: + tests: Test mediafactory permissions + See https://bugzilla.gnome.org/show_bug.cgi?id=710202 + +2013-10-19 17:39:35 +0200 Sebastian Rasmussen + + * gst/rtsp-server/rtsp-permissions.c: + permissions: Fix refcounting when adding/removing roles + Previously a role that was removed was unreffed twice, and when + replacing an existing role the replaced role was freed while still being + referenced. Both bugs are now fixed. + See https://bugzilla.gnome.org/show_bug.cgi?id=710202 + +2013-10-15 18:01:38 +0200 Sebastian Rasmussen + + * tests/check/gst/media.c: + * tests/check/gst/mediafactory.c: + * tests/check/gst/rtspserver.c: + tests: Check gst_rtsp_url_parse return value + See https://bugzilla.gnome.org/show_bug.cgi?id=710202 + +2013-11-05 11:22:51 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 865aa20 to dbedaa0 + +2013-10-14 12:03:07 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-server.c: + rtsp-server: Fix socket leak + https://bugzilla.gnome.org/show_bug.cgi?id=710088 + +2013-10-30 22:16:54 +0100 Sebastian Dröge + + * gst/rtsp-server/rtsp-session-pool.c: + rtsp-session-pool: Make sure session IDs are properly URI-escaped + https://bugzilla.gnome.org/show_bug.cgi?id=643812 + +2013-10-15 16:37:34 -0700 Aleix Conchillo Flaque + + * examples/.gitignore: + * examples/test-video.c: + examples: fix compilation when WITH_AUTH is defined + https://bugzilla.gnome.org/show_bug.cgi?id=710228 + +2013-10-30 19:10:59 +0100 Sebastian Dröge + + * .gitignore: + gitignore: Add new test binary + +2013-10-09 15:19:12 +0200 Ognyan Tonchev + + * tests/check/Makefile.am: + * tests/check/gst/threadpool.c: + thread-pool: Add unit test for the thread pools + https://bugzilla.gnome.org/show_bug.cgi?id=710228 + +2013-10-09 15:25:10 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-thread-pool.c: + thread-pool: Fix thread leak when reusing threads + https://bugzilla.gnome.org/show_bug.cgi?id=709730 + +2013-10-14 08:30:33 +0200 Patricia Muscalu + + * gst/rtsp-server/rtsp-server.c: + * tests/check/gst/rtspserver.c: + tests: fixed racy behavior in rtspserver tests + https://bugzilla.gnome.org/show_bug.cgi?id=710078 + +2013-10-14 19:36:24 +0200 Sebastian Rasmussen + + * tests/check/gst/addresspool.c: + tests: Improve address pool unit tests + Add a range with mixed IPV4 and IPV6 addresses to pool. + Get an IPV4 address from an IPV6-only pool. + Get an IPV6 address from an IPV4-only pool. + Reserve a IPV6 address from an IPV4-only pool. + Check for unicast addresses in multicast-only pool. + Check for unicast addresses in uni-/multicast-mixed pool. + https://bugzilla.gnome.org/show_bug.cgi?id=710128 + +2013-10-04 06:29:30 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: append query string in PAUSE/PLAY/TEARDOWN as well + +2013-10-01 14:04:17 +0200 Jonas Holmberg + + * gst/rtsp-server/rtsp-client.c: + client: Add query to control path + If the SETUP url contains a query it must be appended to the control + path so that it matches any already created stream in the media. The + query will also be appended to the session media path. + +2013-10-04 05:48:52 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + rtsp-media: remove old line + +2013-10-01 13:15:19 +0200 Jonas Holmberg + + * gst/rtsp-server/rtsp-stream.c: + stream: Correct control comparison + https://bugzilla.gnome.org/show_bug.cgi?id=709176 + +2013-09-09 21:51:44 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-media.c: + media: Check dynamically if the pipeline supports seeking + We should not depend on whether or not the pipeline state change + returned NO_PREROLL or not. A media could dynamically change its + element and switch from seekable to non seekable so it's best to test + the seekable nature of the pipeline dynamically when we try to do a seek. + +2013-09-09 21:51:23 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-media.c: + media: Return FALSE if seeking is not supported + +2013-10-01 17:16:11 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + rtsp-media: don't seek accurate by default + Accurate seeking is perhaps a little overkill in the most common situation and + causes some formats (mp3) over slow media to seek extremely slowly. + +2013-09-26 14:36:58 +0200 Ognyan Tonchev + + * tests/check/gst/rtspserver.c: + tests: fix unit test + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=708742 + +2013-09-26 11:20:05 +0200 Jonas Holmberg + + * gst/rtsp-server/rtsp-client.c: + client: Reply 400 if media cannot be constructed + Reply 400 Bad Request instead of 503 Service Unavailable if media + cannot be constructed in SETUP. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=708821 + +2013-09-26 09:41:10 +0200 Jonas Holmberg + + * gst/rtsp-server/rtsp-client.c: + client: Send setup reply once only + If find_media() failed in handle_setup_request() two replies was sent. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=708819 + +2013-09-24 18:35:36 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 6b03ba7 to 865aa20 + +2013-09-23 14:28:04 +0200 Jonas Holmberg + + * gst/rtsp-server/rtsp-server.c: + server: Emit client-connected signal earlier + Emit client-connected before the client ref is given to a GSource, + otherwise client-connected can be emitted after the client object has + been freed. + +2013-09-24 17:30:18 +0200 Patrick Radizi + + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-address-pool.h: + * gst/rtsp-server/rtsp-stream.c: + * tests/check/gst/addresspool.c: + addresspool: return reason of failure + Let gst_rtsp_address_pool_reserve_address() return the reason why + the address could not be reserved. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=708229 + +2013-09-20 16:47:56 +0200 Edward Hervey + + * autogen.sh: + autogen.sh: Sync behaviour with other GStreamer modules + Allows building from outside of tree amongst other things + +2013-09-20 16:18:54 +0200 Edward Hervey + + * common: + Automatic update of common submodule + From b613661 to 6b03ba7 + +2013-09-19 18:46:14 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 74a6857 to b613661 + +2013-09-19 17:39:24 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 01a7a46 to 74a6857 + +2013-09-19 15:44:26 +0200 Jonas Holmberg + + * gst/rtsp-server/rtsp-client.c: + client: Do not read beyond end of path string + If the setup was done without a control url, make sure we don't try to read the + non-existing control string and crash. + +2013-09-17 14:39:44 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: Fix RTPInfo header + Refactor the method to make the content_base. + Use the content-base and the control url to construct the RTPInfo + url. + +2013-09-17 12:21:02 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: map url to path only in describe + Only map the request url to a path in the DESCRIBE method. The SDP then + contains the base and control urls that should be used to SETUP/PAUSE/ + PLAY/TEARDOWN the media. + +2013-09-17 11:41:57 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + Revert "client: map URL to path in requests" + This reverts commit e3fded2cec897a2ec003450607b916cc1601fd2d. + This is not correct, we only remap the URL to a path in DESCRIBE, the SDP then + contains the base and control urls which are used in the SETUP, PLAY, + PAUSE and TEARDOWN requests. + +2013-09-16 17:16:49 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: map URL to path in requests + +2013-09-16 16:47:40 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-mount-points.c: + * gst/rtsp-server/rtsp-mount-points.h: + mount-points: make vmethod to make path from uri + Make a vmethod to transform an url into a path. The path is then used to lookup + the factory. This makes it possible to also use other bits of the url, such as + the query parameters, to locate the factory. + +2013-09-09 11:05:26 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-thread-pool.c: + * gst/rtsp-server/rtsp-thread-pool.h: + thread-pool: Add cleanup to wait for the threadpool to finish + Also fix race condition if two threads are asking for the first + thread from the thread pool at once. This would case two internal + GThreadPools to be created. + https://bugzilla.gnome.org/show_bug.cgi?id=707753 + +2013-09-05 08:56:02 +0200 Jonas Holmberg + + * gst/rtsp-server/rtsp-client.c: + * tests/check/gst/client.c: + client: free threadpool + https://bugzilla.gnome.org/show_bug.cgi?id=707638 + +2013-09-06 17:23:20 +0200 Jonas Holmberg + + * tests/check/gst/mountpoints.c: + mountpoints tests: unref matched factories + https://bugzilla.gnome.org/show_bug.cgi?id=707638 + +2013-09-05 18:01:18 +0200 Jonas Holmberg + + * tests/check/gst/media.c: + media tests: unref thread pool and caps + https://bugzilla.gnome.org/show_bug.cgi?id=707638 + +2013-09-05 08:53:55 +0200 Jonas Holmberg + + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media.c: + auth, media, media-factory: unref permissions + https://bugzilla.gnome.org/show_bug.cgi?id=707638 + +2013-08-23 15:15:12 +0200 Wim Taymans + + * examples/Makefile.am: + Makefile: add rule for appsrc example + +2013-08-23 15:14:29 +0200 Wim Taymans + + * examples/test-appsrc.c: + tests: add appsrc example + Add an example on how to use appsrc to feed the server pipeline with data. + +2013-08-22 12:10:39 +0200 Patricia Muscalu + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: remove query part from content-base string + Make sure that after the control url has been resolved, it's + not a part of the query-string. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=706568 + +2013-08-23 10:38:43 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: don't check url in response + There is no url or method in the response to check + +2013-08-08 10:57:42 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + Add handle-response signal for when we receive a GET_PARAMETER response + +2013-08-16 12:42:22 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-server.c: + Fix gst_rtsp_server_client_filter, using wrong variable type + +2013-08-22 18:39:59 +0100 Tim-Philipp Müller + + * gst/rtsp-server/rtsp-media-factory-uri.c: + rtsp-media-factory-uri: check AAC properly for whether it's parsed or not + For AAC we need to check for framed=true instead of parsed=true. + https://bugzilla.gnome.org/show_bug.cgi?id=701384 + +2013-08-16 17:05:24 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: optimize pipeline for protocols + When TCP is not an allowed protocol for the stream, avoid creating the + appsrc/appsink/queue and tee elements. + +2013-08-16 16:34:56 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: set protocols on streams + +2013-08-16 16:16:31 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: use protocols supported by stream + +2013-08-16 16:16:00 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-stream.c: + media-factory: allow all protocols + +2013-08-16 16:10:43 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: configure protocols in new streams + +2013-08-16 16:08:43 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add protocols property + +2013-08-05 10:46:33 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-media.c: + rtsp-media: send state in "new-state" signal + https://bugzilla.gnome.org/show_bug.cgi?id=705110 + +2013-08-02 14:11:01 +0200 Lubosz Sarnecki + + * configure.ac: + build: add subdir-objects to AM_INIT_AUTOMAKE + Fixes warnings with automake 1.14 + https://bugzilla.gnome.org/show_bug.cgi?id=705350 + +2013-08-02 17:15:09 +0200 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + server: add method to iterate clients of server + +2013-06-11 19:10:01 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + Add vmethod for rtsp-media subclass to access rtpbin + +2013-07-11 16:12:04 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-client.h: + small documentation fix + +2013-07-11 16:11:55 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-client.c: + Do not take range header if range is invalid + +2013-08-02 16:57:26 +0200 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-media.c: + media: add docs for new method + +2013-07-02 18:55:28 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + Add API to rtsp-media set the pipeline's state + +2013-06-11 19:09:42 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-media.c: + Update current position/duration when gst_rtsp_media_get_range_string is called + +2013-07-22 17:27:27 +0200 Wim Taymans + + * examples/test-cgroups.c: + tests: add some more docs + +2013-07-22 14:25:04 +0200 Wim Taymans + + * examples/test-cgroups.c: + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-context.c: + * gst/rtsp-server/rtsp-context.h: + * gst/rtsp-server/rtsp-params.c: + * gst/rtsp-server/rtsp-params.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-thread-pool.c: + * gst/rtsp-server/rtsp-thread-pool.h: + * tests/check/gst/client.c: + ClientState -> Context + Rename the clientstate to context and put the code in a separate file. + +2013-07-18 12:19:25 +0200 Wim Taymans + + * examples/test-auth.c: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + auth: add support for default token + The default token is used when the user is not authenticated and can be used to + give minimal permissions. + +2013-07-18 11:44:50 +0200 Wim Taymans + + * examples/test-auth.c: + * gst/rtsp-server/rtsp-auth.c: + auth: use defines when possible + +2013-07-18 11:44:21 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-address-pool.c: + address-pool: improve docs + +2013-07-18 12:26:45 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-permissions.c: + permissions: add the role to the copy + +2013-07-17 19:35:33 -0400 Olivier Crête + + * gst/rtsp-server/rtsp-permissions.c: + permissions: Also copy the roles + +2013-07-17 19:32:09 -0400 Olivier Crête + + * gst/rtsp-server/rtsp-permissions.c: + permissions: Make it build + +2013-07-16 12:36:56 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-address-pool.h: + docs: small fixes + +2013-07-16 12:32:51 +0200 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + * gst/rtsp-server/rtsp-stream.c: + * tests/check/gst/client.c: + docs: improve docs + +2013-07-16 12:32:00 +0200 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-address-pool.h: + * tests/check/gst/addresspool.c: + * tests/check/gst/rtspserver.c: + address-pool: cleanups + Remove redundant method, improve docs. + +2013-07-15 17:31:35 +0200 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-permissions.c: + * gst/rtsp-server/rtsp-permissions.h: + * gst/rtsp-server/rtsp-token.c: + docs: improve docs + +2013-07-15 17:12:57 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-permissions.c: + permissions: implement _remove_role + +2013-07-15 17:12:43 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-permissions.c: + permissions: update docs + +2013-07-15 16:48:37 +0200 Wim Taymans + + * tests/check/gst/client.c: + tests: simplify tests + Client settings are now disabled by default so we don't need an auth + module to disable them. + +2013-07-15 16:47:07 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + auth: add default authorizations + When no auth module is specified, use our table of defaults to look up the + default value of the check instead of always allowing everything. This was + we can disallow client settings by default. + +2013-07-15 16:05:02 +0200 Wim Taymans + + * docs/README: + README: update readme + +2013-07-15 15:25:00 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-thread-pool.c: + * gst/rtsp-server/rtsp-thread-pool.h: + thread-pool: add more docs + +2013-07-15 14:50:38 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-thread-pool.c: + * gst/rtsp-server/rtsp-thread-pool.h: + thread-pool: fix race in thread reuse + If we try to reuse a thread right after we made it stop, we end up using a + stopped thread. Catch this case and only reuse threads that are not stopping. + +2013-07-15 14:50:26 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: add small debug + +2013-07-15 11:58:58 +0200 Wim Taymans + + * tests/check/gst/client.c: + client: fix test + Add some permissions to media so we can use the auth and enable + client settings. + +2013-07-15 11:57:49 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: support pushed context in handle_request + If we already have a pushed state, reuse it and add our own things. This makes + it easier to write tests. + +2013-07-15 11:56:06 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + auth: don't auth on methods + Don't authorize on methods anymore but on the resources that we + try to access, this is more flexible. + Move the authorization checks to where they are needed and let the + check return the response on error. + +2013-07-15 11:51:34 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-mount-points.c: + mount-points: add some debug + +2013-07-12 17:26:55 +0200 Wim Taymans + + * tests/check/gst/client.c: + tests: almost fix test + +2013-07-12 17:07:53 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + auth: let the auth module check client_settings + Let the auth module decide if client settings are allowed for the + current client. + +2013-07-12 17:06:37 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-token.c: + * gst/rtsp-server/rtsp-token.h: + token: add method to check boolean permission + +2013-07-12 16:36:05 +0200 Wim Taymans + + * examples/test-auth.c: + * examples/test-cgroups.c: + * gst/rtsp-server/rtsp-token.c: + * gst/rtsp-server/rtsp-token.h: + token: simplify token constructor + Use variable arguments to make easier API. + +2013-07-12 16:17:57 +0200 Wim Taymans + + * examples/test-auth.c: + * examples/test-cgroups.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: add convenience API for factory + +2013-07-12 16:03:07 +0200 Wim Taymans + + * examples/test-auth.c: + * examples/test-cgroups.c: + * gst/rtsp-server/rtsp-permissions.c: + * gst/rtsp-server/rtsp-permissions.h: + permissions: simplify API a little + Avoid passing GstStructure in the add_role method, use varargs instead + to construct the structure behind the scenes. We can then also use the + structure name as the role and simplify some more logic. + +2013-07-12 16:01:14 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + auth: fix typo + +2013-07-12 15:19:29 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + auth: handle unauthorized response + Move handling of the unauthorized response to the auth module, it can add + the appropriate headers to request authorization for the required method + much better than the client. + +2013-07-12 15:13:48 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: allow for sending any message, not only requests + Change the _send_request() method to _send_message() so that we + can both send requests and replies. + +2013-07-12 14:10:13 +0200 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-server.h: + docs: fix docs + +2013-07-12 12:41:52 +0200 Wim Taymans + + * examples/test-video.c: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + auth: move TLS handling to auth module + Remove the TLS settings on the server and move it to the auth module because + that is where security related bits go. + +2013-07-12 12:38:54 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: add state push/pop + +2013-07-12 12:36:40 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: add connection to state + +2013-07-11 20:45:11 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-mount-points.c: + mount-points: fix debug + +2013-07-11 17:28:17 +0200 Wim Taymans + + * tests/check/gst/media.c: + tests: fix media test + +2013-07-11 17:28:04 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-thread-pool.c: + thread-pool: we don't require a state + +2013-07-11 17:18:58 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: let context ref the server + So that we don't risk losing the server object early anc crash. + +2013-07-11 17:05:00 +0200 Wim Taymans + + * tests/check/gst/client.c: + tests: fix client test + +2013-07-11 16:57:14 +0200 Wim Taymans + + * docs/README: + * docs/libs/gst-rtsp-server-docs.sgml: + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-mount-points.c: + * gst/rtsp-server/rtsp-params.c: + * gst/rtsp-server/rtsp-permissions.c: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-thread-pool.c: + * gst/rtsp-server/rtsp-token.c: + docs: improve docs + +2013-07-11 16:28:09 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + session-pool: make vmethod to create a session + Make a vmethod to create a sessions so that subclasses can create + custom session objects + +2013-07-11 12:24:33 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-mount-points.h: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-stream.h: + docs: more updates + +2013-07-11 12:18:26 +0200 Wim Taymans + + * docs/libs/gst-rtsp-server-docs.sgml: + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-address-pool.h: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-permissions.c: + * gst/rtsp-server/rtsp-permissions.h: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-media.h: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.h: + * gst/rtsp-server/rtsp-stream-transport.h: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-thread-pool.h: + docs: update docs + +2013-07-11 10:28:06 +0200 Wim Taymans + + * configure.ac: + * examples/Makefile.am: + configure: compile cgroup example conditionally + Only compile the cgroup example when we have libcgroup + +2013-07-10 20:57:12 +0200 Wim Taymans + + * configure.ac: + * examples/Makefile.am: + * examples/test-cgroups.c: + examples: add cgroups example + +2013-07-10 20:55:03 +0200 Wim Taymans + + * tests/check/gst/rtspserver.c: + tests: fix compilation + +2013-07-10 20:48:47 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-thread-pool.c: + thread-pool: fix vmethod invocation + +2013-07-10 20:48:18 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-thread-pool.c: + * gst/rtsp-server/rtsp-thread-pool.h: + thread-pool: store thread type in thread + +2013-07-10 17:09:27 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: pass thread from pool to media _prepare + Get a thread from the configured threadpool and pass it to the prepare method of + the media. + +2013-07-10 17:08:14 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: Accept a thread in _prepare + Remove out own threadpool handling and use the provided thread and + maincontext for the bus messages and the state changes. + +2013-07-10 17:07:13 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: configure client thread pool + +2013-07-10 17:06:36 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: add method to configure thread pool + +2013-07-10 16:49:55 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + server: use thread pool + Use the thread pool instead of doing our own thing. + +2013-07-10 16:47:43 +0200 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-thread-pool.c: + * gst/rtsp-server/rtsp-thread-pool.h: + thread-pool: add object to manage threads + Add an object to manage the client and media threads. + +2013-07-10 15:28:35 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + auth: debug authorization check + +2013-07-09 20:44:51 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: start media pipeline in context + Start the media pipeline in the provided context (or our default one + when NULL). This makes sure that we run the bus thread in this context and that + all media threads are children of this context. + +2013-07-09 16:38:39 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + factory: pass permissions to media by default + +2013-07-09 16:09:07 +0200 Wim Taymans + + * examples/test-auth.c: + test: add permissions to auth test + Ass some permissions to the media factory in the test. + +2013-07-09 16:04:35 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + auth: simplify auth checks + Remove client from methods, it's now in the state + Perform the check specified by the string, use the information from the + thread local context. + +2013-07-09 16:01:29 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: add state to current thread + Add the client to the ClientState object. + Place the ClientState on the current thread. + +2013-07-09 14:33:43 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: make it possible to set permissions + Make it possible to set permissions on media and media factory objects + +2013-07-09 14:31:15 +0200 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-permissions.c: + * gst/rtsp-server/rtsp-permissions.h: + permissions: add permissions object + Add a mini object to store permissions based on a role. + +2013-07-08 16:29:01 +0200 Wim Taymans + + * examples/test-auth.c: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + auth: add auth checks + Add an enum with auth checks and implement the checks in the auth object. + Perform the checks from the client. + +2013-07-05 20:48:18 +0200 Wim Taymans + + * examples/test-auth.c: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.h: + auth: use the token after authentication + After we authenticated a user, keep the Token around in the state. + +2013-07-05 20:43:39 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * tests/check/gst/media.c: + media: add optional context for bus messages + Add an optional mainloop to _prepare that will handle the bus messages instead + of always using the shared mainloop. + +2013-07-05 20:34:40 +0200 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-token.c: + * gst/rtsp-server/rtsp-token.h: + token: add authorization token + Add a simply miniobject that contains the authorizations. The object contains a + GstStructure that hold all authorization fields. When a user is authenticated, + the auth module will create a Token for the user. The token is then used to + check what operations the user is allowed to do and various other configuration + values. + +2013-07-05 12:08:36 +0200 Wim Taymans + + * examples/test-auth.c: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + auth: remove auth from media and factory + Remove the auth object from media and factory. We want to have the RTSPClient + authenticate and authorize resources, there is no need to place another auth + manager on the media/factory. + +2013-07-04 14:33:59 +0200 Wim Taymans + + * examples/test-auth.c: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.h: + auth: add support for multiple basic auth tokens + Make it possible to add multiple basic authorisation tokens to one authorization + object. Associate with each token an authorization group that will define what + capabilities are allowed. + +2013-07-03 16:15:04 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: error out on non-aggregate control + We require aggregate control (for now) for PLAY, PAUSE and TEARDOWN. + +2013-07-03 15:55:38 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: rework setup request a little + Cache the media in DESCRIBE based on the longest matching path with the uri + that we can find in the mount points. + Rework the setup request a little to get the media from the session or from + the longest matching path, this way we can derive the control string as + everything after the path instead of hardcoding it. + Find the stream based on the control string and only open a session when all + this can be done. + +2013-07-03 15:14:39 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add method to find a stream by control url + +2013-07-03 15:13:45 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add method to check control url of stream + +2013-07-03 12:37:48 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-media.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + session: use path matching for session media + Use a path string instead of a uri to lookup session media in the sessions. Also + use path matching to find the largest possible path that matches. + +2013-07-03 11:04:53 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-mount-points.c: + * gst/rtsp-server/rtsp-mount-points.h: + * tests/check/gst/mountpoints.c: + mount-points: remove useless vmethod + Making lookups in the mount points should not be done with a URL, if there is a + mapping to be done from URL to mount points, we'll need to do it somewhere + else. + +2013-07-03 10:25:46 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-mount-points.c: + * gst/rtsp-server/rtsp-mount-points.h: + * tests/check/gst/mountpoints.c: + mount-points: improve mount point searching + Use a GSequence to keep track of the mount points. + Match a URL to the longest matching registered mount point. This should be the + URL to perform aggreagate control and the remainder is the stream specific + control part. + Add some unit tests for this. + +2013-07-03 10:40:33 +0200 Sebastian Dröge + + * gst/rtsp-server/Makefile.am: + rtsp-server: Allow building of static library + +2013-07-02 15:59:16 +0200 Wim Taymans + + * tests/check/gst/mediafactory.c: + tests: fix compilation + +2013-07-02 15:54:43 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-sdp.c: + sdp: get control string from stream + Use the control string as configured in the stream. + +2013-07-02 14:44:35 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add methods and property to set control string + +2013-07-02 11:58:02 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: cleanups + Rename variables for clarity + Keep media in state when we can + +2013-07-01 16:46:07 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add more support for IPv6 + Rename _get_address to _get_multicast_address in GstRTSPStream to + make it clear that this function only deals with multicast. + Make it possible to have both an IPv4 and IPv6 multicast address on + a stream. Give the client an IPv4 or IPv6 address depending on the + address it used to connect to the server. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702002 + +2013-07-01 15:18:43 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: fix comment + +2013-07-01 14:45:49 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: handle failed port allocation + Allow for ipv4 or ipv6 socket allocations to fail. Only report failure if we + can't allocate any family at all. Also keep track of what port families we + allocated. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703175 + +2013-07-01 12:20:50 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: improve docs + +2013-07-01 12:04:45 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream-transport.c: + stream-transport: remove old if 0 block + +2013-06-27 11:21:42 +0200 Patricia Muscalu + + * tests/check/gst/client.c: + tests: fix tests + gst_rtsp_client_get_uri() has been removed + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703173 + +2013-06-26 17:18:33 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: add method to filter managed sessions + Add a method to filter the sessions managed by this client connection. + See https://bugzilla.gnome.org/show_bug.cgi?id=703016 + +2013-06-26 16:32:06 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: remove _get_uri() method + Remove the get_uri() method on the client. A client has no uri, the uri + property is an internal property to manage the last cached media for + the client. + +2013-06-26 16:31:39 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: fix typo + +2013-06-26 14:42:15 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + rtsp-media: Do not leak the query in default_query_stop + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703120 + +2013-06-25 15:46:41 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: don't unlock when conversion fails + Don't unlock the state lock when conversion fails because it was not locked. + +2013-06-10 17:32:40 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + Add query_position and query_stop vmethods to rtsp-media + +2013-06-10 17:33:01 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-media.c: + Fix typo in property install for rtsp-media's time-provider + +2013-06-25 15:09:13 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: clean some variables + Clean some variables and add some guards to _send_request() + +2013-06-10 17:32:12 -0400 Youness Alaoui + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + Add gst_rtsp_client_send_request API + This makes it possible to send arbitrary messages to a client, such as + SET_PARAMETER or GET_PARAMETER + +2013-06-24 23:56:57 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add _get_element() method + Add method to get the element used when creating the media. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703008 + +2013-06-24 23:51:38 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: fix docs + +2013-06-24 11:41:27 -0700 Aleix Conchillo Flaque + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: allow access to the rtp session + https://bugzilla.gnome.org/show_bug.cgi?id=703004 + +2013-06-24 10:43:59 +0200 Alexander Schrab + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + dscp qos support in gst-rtsp-stream + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702645 + +2013-06-20 17:30:49 +0200 Wim Taymans + + * tests/check/gst/rtspserver.c: + tests: fix test + Actually do what the comment says. Also keep the old code around, not sure what + should happen when you get a 454 from a TEARDOWN, does it close the connection? + it currently doesn't. + +2013-06-20 12:20:21 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: also watch newly created session + When we newly created a session, start watching it immediately instead of + on the next request. + +2013-06-20 12:18:23 +0200 Patricia Muscalu + + * tests/check/gst/client.c: + tests: add unit test for new-session + See https://bugzilla.gnome.org/show_bug.cgi?id=701587 + +2013-06-20 12:16:07 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: emit new-session when new session is created + Only emit new-session when we created a new session for a client, not when a + client picked up a previous session. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701587 + +2013-06-20 11:17:29 +0200 Alexander Schrab + + * gst/rtsp-server/rtsp-client.c: + client: handle asterisk as path in requests + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701266 + +2013-06-20 11:14:31 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: handle segment query format mismatch + It's possible that the segment query returns with a different format than what + we asked for, handle this case also. + +2013-06-11 15:28:32 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-media.c: + media: use segment stop in collect_media_stats + Use segment stop instead of duration as range end point. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701185 + +2013-06-17 16:47:56 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + * tests/check/gst/media.c: + rtsp-media: Do not leak the element in take_pipeline + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702470 + +2013-06-17 16:18:37 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + rtsp-client: Make configure_client_transport virtual + This patch makes configure_client_transport virtual. The functionality is + needed to handle some weird clients sending multicast transport settings as url + options. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702173 + +2013-06-12 12:23:56 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + rtsp-client: Make param_set and param_get virtual + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702072 + +2013-06-05 15:49:45 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: convert_range replaces get_range_times + get_range_times worked for handling UTC ranges for seeks, but we also + need to convert back from NPT to the requested unit in + get_range_string. convert_range is now used for both. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702084 + +2013-06-14 16:05:59 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-sdp.h: + sdp: cleanup sdp info + We don't need to pass the proto, we can more easily check a boolean. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702063 + +2013-06-12 15:22:57 +0200 Alexander Schrab + + * gst/rtsp-server/rtsp-sdp.c: + use 0.0.0.0 or :: for c= line instead of server address + +2013-06-12 10:56:16 +0200 Alexander Schrab + + * gst/rtsp-server/rtsp-client.c: + use local address, not remote, in SDP + See https://bugzilla.gnome.org/show_bug.cgi?id=702063 + +2013-06-05 15:18:26 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 098c0d7 to 01a7a46 + +2013-05-29 13:45:00 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: possibility to override range time conversion + Make it possible to override the conversion from GstRTSPTimeRange to + GstClockTimes, that is done before seeking on the media + pipeline. Overriding can be useful for UTC ranges, where the default + conversion gives nanoseconds since 1900. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701191 + +2013-06-03 12:04:44 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + rtsp-server: Expose the use_client_settings API + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=699935 + +2013-05-30 08:07:48 +0200 Alexander Schrab + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + rtspstream: handle both ipv4 and ipv6 clients + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701129 + +2013-05-31 15:28:58 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-sdp.c: + Revert "rtsp-sdp: Parse width/height from caps and set SDP attribute" + This reverts commit 5fd034ff1a517db7f629ffcc3ed16839c61f5c97. + We already have a way to place extra attributes in the SDP by using a string + property with prefix x- or a- in the caps. + +2013-05-31 15:27:48 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-sdp.c: + Revert "rtsp-sdp: Parse framerate caps field and set SDP attribute" + This reverts commit d6a4dee03642a2d2c05fec4752dc3ccb60b19494. + We already have a way to place extra attributes in the SDP, just make a string + property in the payloader with a- or x- prefix. + +2013-05-31 15:41:55 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-sdp.c: + rtsp: place a- and x- properties as attributes + application/x-rtp has properties with a- and x- prefixes that should be + placed as attributes in the SDP for the media instead of being added to the + fmtp. + +2013-05-31 12:10:28 +0200 Wim Taymans + + * examples/Makefile.am: + * examples/test-video.c: + example: add TLS example + +2013-05-31 11:42:36 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + server: add support for TLS + Add methods to set and get a TLS certificate. + Add vmethod to configure a new connection. By default, configure the TLS + certificate in a new connection if needed. + +2013-05-31 11:14:17 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + server: remove accept_client vmethod + This vmethod is not very useful so remove it. + +2013-05-30 17:23:51 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: don't crash on NULL GError + +2013-05-30 10:46:33 +0200 Patricia Muscalu + + * gst/rtsp-server/rtsp-session-pool.c: + rtsp-session-pool: corrected session timeout detection + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701253 + +2013-05-30 10:52:46 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: improve debug + +2013-05-30 07:18:22 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-server.c: + server: refactor connection setup + Let the server accept the socket connection and construct a GstRTSPConnection + from it. Remove the code from the client and let the client only deal with + a fully configure GstRTSPConnection object. + We will need this later when the server will configure the connection for + TLS. + +2013-05-30 06:49:20 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: keep the transport object alive + Keep the transport object alive while we have it as qdata on the + source. + +2013-05-27 12:58:07 +0200 Alexander Schrab + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-server.c: + rtsp-server: Do not crash on nmapping of server + * generate error when gst_rtsp_connection_accept fails + * do not stop accepting incoming connections because + accepting a client fails + https://bugzilla.gnome.org/show_bug.cgi?id=701072 + +2013-05-24 13:39:50 +0200 Alexander Schrab + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: ipv4 adress should not be marked ipv6 even if socket is ipv6 + https://bugzilla.gnome.org/show_bug.cgi?id=700953 + +2013-05-22 03:29:38 +0200 Sebastian Rasmussen + + * gst/rtsp-server/rtsp-sdp.c: + rtsp-sdp: Parse framerate caps field and set SDP attribute + The SDP attribute and its format is described in RFC4566. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=700747 + +2013-05-22 03:29:30 +0200 Sebastian Rasmussen + + * gst/rtsp-server/rtsp-sdp.c: + rtsp-sdp: Parse width/height from caps and set SDP attribute + The SDP attribute and its format is described in RFC6064. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=700747 + +2013-04-29 14:46:30 +0200 Patricia Muscalu + + * gst/rtsp-server/rtsp-sdp.c: + * tests/check/gst/client.c: + rtsp-sdp: add bandwidth line + https://bugzilla.gnome.org/show_bug.cgi?id=699220 + +2013-05-15 10:55:09 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 5edcd85 to 098c0d7 + +2013-04-23 11:28:39 +0200 Ognyan Tonchev + + * tests/check/gst/media.c: + tests: add dynamic payloader prepare/unprepare check + +2013-04-23 10:27:35 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: release lock when removing fakesink + +2013-04-23 10:16:17 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: set elements to NULL before removing + When removing a stream, set the elements to NULL first. This avoids + element-is-not-in-NULL-state errors when we dispose the elements. + +2013-04-22 23:55:48 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 3cb3d3c to 5edcd85 + +2013-04-22 17:34:37 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: listen to pad-removed signals + Listen to the pad-removed signal and remove the stream associated with the + removed pad. + Add signal to be notified of the removed pad. + Remove the fakesink in unprepare() + Fix signatures of the signal methods + +2013-04-22 17:33:30 +0200 Wim Taymans + + * examples/test-sdp.c: + tests: add example of reusable pipelines + +2013-04-22 17:32:31 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add method to get the srcpad + +2013-04-22 16:49:39 +0200 Ognyan Tonchev + + * tests/check/gst/media.c: + check: add media prepare/unprepare test + See https://bugzilla.gnome.org/show_bug.cgi?id=698376 + +2013-04-22 16:40:48 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + media: disconnect from signal handlers in unprepare() + We connected to the pad-added and no-more-pads signals in prepare() so + we need to disconnect from them in unprepare(). + See https://bugzilla.gnome.org/show_bug.cgi?id=698376 + +2013-04-22 16:25:17 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + media: don't free streams array + Don't free the streams array in the unprepare() method, they were not + added in prepare(). + See https://bugzilla.gnome.org/show_bug.cgi?id=698376 + +2013-04-22 16:19:35 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + media: don't unref the pipeline in unprepare + Unprepare() should undo what prepare() does. Because the pipeline is + not created in prepare(), we should not unref it in unprepare() + +2013-04-22 16:09:22 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-stream.c: + stream: clear session and caps for reuse + Set the session and caps to NULL after unref otherwise we might unref + them again later. + See https://bugzilla.gnome.org/show_bug.cgi?id=698376 + +2013-04-15 12:21:54 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-client.c: + client: send out teardown signal before tearing down + The advantage is that in the signal handler you get direct access to + information about what streams are about to get torn down (in the + GstRTSPClientState). + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=697686 + +2013-04-15 12:17:34 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: expose connection + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=697546 + +2013-04-14 17:58:22 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From aed87ae to 3cb3d3c + +2013-04-12 11:34:38 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-media.h: + media: add method to get the base_time of the pipeline + Together with a shared clock, this base-time could eventually be sent to + the client so that it can reconstruct the exact running-time of the clock + on the server. + +2013-04-09 22:35:28 +0200 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-sdp.c: + media: add GstNetTimeProvider support + Add a property to let the media provide a GstNetTimeProvider for its clock. + Make methods to get the clock and nettimeprovider + Add a x-gst-clock property to the SDP with the IP and port number of the nettime + provider and also the current time of the clock. This should make it possible + for (GStreamer) clients to slave their clock to the server clock. + +2013-04-09 21:02:47 +0200 Stefan Sauer + + * common: + Automatic update of common submodule + From 04c7a1e to aed87ae + +2013-04-09 20:39:58 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: wait for buffering to complete + Wait for buffering to complete before changing the state to the target state. + +2013-04-09 20:11:35 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: small cleanup + +2013-03-20 12:33:54 +0100 David Svensson Fors + + * tests/check/gst/rtspserver.c: + tests: remove extra unref in test_setup_non_existing_stream + The unref is not needed anymore, teardown runs without it. + https://bugzilla.gnome.org/show_bug.cgi?id=696542 + +2013-03-20 11:28:11 +0100 David Svensson Fors + + * tests/check/gst/rtspserver.c: + tests: GSocketService cleanup in test_bind_already_in_use + Use g_socket_service_stop so the rtspserver test stops listening for + incoming connections in test_bind_already_in_use. + https://bugzilla.gnome.org/show_bug.cgi?id=696541 + +2013-03-22 18:25:07 -0400 Olivier Crête + + * gst/rtsp-server/rtsp-media-factory.c: + rtsp-media-factory: g_signal_connect_object is not thread safe, can't use it here + Instead use a GWeakRef which is safe to use + This is a known GLib bug, see: + https://bugzilla.gnome.org/show_bug.cgi?id=667145 + +2013-02-22 14:17:29 -0500 Olivier Crête + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-sdp.c: + * tests/check/gst/media.c: + * tests/check/gst/rtspserver.c: + rtsp-media/client: Reply to PLAY request with same type of Range + Remember the type of Range from the PLAY request and use the same type for + the reply. + +2013-03-18 09:25:54 +0100 Patricia Muscalu + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * tests/check/gst/client.c: + rtsp-client: expose uri + +2013-03-13 17:46:58 -0400 Olivier Crête + + * tests/check/gst/mediafactory.c: + tests: Hold ref while creating second media + To test if the media aren't shared, make sure we keep the first one while creating a second + otherwise the same memory address may be reused. + +2013-03-12 00:10:18 +0000 Tim-Philipp Müller + + * configure.ac: + configure: remove out-of-date comment + +2013-03-12 00:05:49 +0000 Tim-Philipp Müller + + * .gitignore: + .gitignore: ignore more build files + +2013-03-12 00:03:36 +0000 Tim-Philipp Müller + + * tests/check/Makefile.am: + tests: use right _LIBS variable for gst-plugins-base libs + +2013-03-11 11:35:14 +0100 Wim Taymans + + * tests/check/Makefile.am: + check: add librtp to libs + +2013-02-20 19:37:51 -0500 Olivier Crête + + * tests/check/gst/rtspserver.c: + tests: Add test to check selecting a port the server will send from + +2013-02-20 18:30:01 -0500 Olivier Crête + + * tests/check/gst/rtspserver.c: + tests: Make sure packets are actually received + +2013-02-19 18:27:20 -0500 Olivier Crête + + * gst/rtsp-server/rtsp-stream.c: + stream: Select unicast address from pool if appropriate + +2013-02-19 16:43:08 -0500 Olivier Crête + + * gst/rtsp-server/rtsp-stream.c: + stream: Properties are always there in Gst 1.0 + +2013-02-19 16:36:20 -0500 Olivier Crête + + * tests/check/gst/addresspool.c: + tests: Add tests for unicast addresses in pool + +2013-02-20 14:26:03 -0500 Olivier Crête + + * gst/rtsp-server/rtsp-address-pool.c: + * tests/check/gst/addresspool.c: + address-pool: Verify that multicast addresses are used for multicast and vice-versa + +2013-02-19 16:34:16 -0500 Olivier Crête + + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-address-pool.h: + * gst/rtsp-server/rtsp-stream.c: + * tests/check/gst/addresspool.c: + address-pool: Add unicast addresses + +2013-02-19 13:19:41 -0500 Olivier Crête + + * configure.ac: + * gst/rtsp-server/rtsp-server.c: + * tests/check/gst/rtspserver.c: + rtsp-server: Limit the number of threads per server instance + If we exceed the maximum, just round robin the clients over the existing + threads. + +2013-02-19 12:31:23 -0500 Olivier Crête + + * gst/rtsp-server/rtsp-server.c: + rtsp-server: No need to store the GMainContext in the client context + +2013-02-18 20:22:18 -0500 Olivier Crête + + * tests/check/gst/rtspserver.c: + tests: Add test for client disconnection + +2013-02-18 20:15:41 -0500 Olivier Crête + + * tests/check/gst/rtspserver.c: + tests: Test client and session timeouts with multiple threads + +2013-02-18 14:59:58 -0500 Olivier Crête + + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-mount-points.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session.c: + Document locking and its order + +2013-02-15 20:02:31 -0500 Olivier Crête + + * tests/check/gst/rtspserver.c: + tests: Test that slow DESCRIBE don't block other clients + +2013-02-14 19:52:09 -0500 Olivier Crête + + * tests/check/gst/client.c: + tests: Add tests for client-requested multicast address + +2013-02-14 13:44:54 -0500 Olivier Crête + + * docs/libs/gst-rtsp-server-sections.txt: + docs: Put the various functions in the right sections + +2013-02-14 13:38:07 -0500 Olivier Crête + + * docs/libs/gst-rtsp-server-docs.sgml: + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-address-pool.h: + docs: Generate docs for GstRTSPAddressPool + +2013-02-13 18:32:20 -0500 Olivier Crête + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + client: Check client provided addresses against the address pool + +2013-02-13 18:01:43 -0500 Olivier Crête + + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-address-pool.h: + * tests/check/gst/addresspool.c: + address-pool: Add API to request a specific address from the pool + Also add relevant unit tests. + +2013-02-12 19:34:24 -0500 Olivier Crête + + * tests/check/gst/mediafactory.c: + tests: Check the passing around of a RTSPAddressPool + Make sure the RTSPAddressPool is propagated from the MediaFactory all the + way down to the stream. + +2013-02-12 16:34:37 -0500 Olivier Crête + + * tests/check/gst/addresspool.c: + tests: Add more tests for the address pool + +2013-02-12 16:29:25 -0500 Olivier Crête + + * gst/rtsp-server/rtsp-address-pool.c: + address-pool: Fix off by one error + When splitting a port range, the port after a skip is not part of range. + +2013-03-07 00:04:19 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 2de221c to 04c7a1e + +2013-02-07 16:18:08 -0600 George McCollister + + * configure.ac: + configure: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS + AM_CONFIG_HEADER was removed in automake 1.13 + https://bugzilla.gnome.org/show_bug.cgi?id=693368 + +2013-01-28 20:45:44 +0100 Stefan Sauer + + * common: + Automatic update of common submodule + From a942293 to 2de221c + +2013-01-28 10:31:50 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: make sure the watch exists while sending data + Protect the send_func with a lock. This allows us to wait for sending + to complete before changing the send_func and user_data. We add an + extra ref to the watch to make sure that it remains valid during + sending. + When closing the connection, set the send_func to NULL + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=692433 + +2013-01-16 12:16:32 +0000 Tim-Philipp Müller + + * tests/check/Makefile.am: + tests: use GST_*_1_0 environment variables everywhere + The _1_0 suffixed environment variables override the + non-suffixed ones, so if we're in an environment that + sets the _1_0 suffixed ones, such as jhbuild, we need + to set those to make sure ours actually always get + used. + +2013-01-15 15:09:24 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From acb04d9 to a942293 + +2012-12-14 11:58:29 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: set the client backlog + Set the client backlog to a reasonable default + +2012-12-04 09:47:35 +0100 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + rtsp-media: Make the element a constructor parameter + https://bugzilla.gnome.org/show_bug.cgi?id=689594 + +2012-12-04 01:05:31 +0100 Sebastian Rasmussen + + * docs/libs/Makefile.am: + docs: Link with gcov library when gcov is enabled + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=689583 + +2012-11-30 15:03:15 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: match prepare with unprepare + Really unprepare when there were an equal amount of prepare calls. + +2012-11-30 14:58:46 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: media has to be unprepared in finalize + Because unprepare takes away the last ref on the media. + +2012-11-30 14:36:30 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + Revert "client: never call gst_rtsp_media_unprepare, let gst_rtsp_media_finalize do it" + This reverts commit ba5b78ff2ff223049188eb456e228c709ccd3e05. + We can't use the refcount to trigger unprepare because it is the unprepare call + that removes the last refcount after all messages are consumed. What we should + probably do is make a prepared refcount and only unprepare when the refcount + reaches 0. + +2012-11-30 13:35:05 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: let the source unref the last media ref + the last ref to the media is held by the source so we don't need to add more ref + and unrefs, we simply destroy the media when the source is gone. + +2012-11-30 12:54:10 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: improve debug + +2012-11-30 12:53:02 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: check state + Make sure we are in the right state when collecting the position and duration. + Only make ourselves PREPARED when we were previously PREPARING. + +2012-11-30 10:05:48 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: use g_object_ref/unref for GObjects + +2012-11-30 07:05:25 +0100 Alessandro Decina + + * gst/rtsp-server/rtsp-client.c: + client: never call gst_rtsp_media_unprepare, let gst_rtsp_media_finalize do it + Calling gst_rtsp_media_unprepare breaks shared medias. Just unref + GstRTSPMedia instances and let gst_rtsp_media_finalize unprepare when a media + isn't being used anymore. + +2012-11-30 06:17:46 +0100 Alessandro Decina + + * gst/rtsp-server/rtsp-media.c: + Fix compiler warning + +2012-11-30 06:14:49 +0100 Alessandro Decina + + * gst/rtsp-server/rtsp-media-factory-uri.c: + Add missing g_type_class_add_private in GstRTSPMediaFactoryURI + +2012-11-29 17:21:12 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session-media.h: + small cleanup + +2012-11-29 17:20:56 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * tests/check/gst/media.c: + media: avoid element leak + +2012-11-29 17:20:26 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: require an element in media constructor + +2012-11-29 17:07:30 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + Revert "client: TEARDOWN brings that state to Init again" + This reverts commit 4b61fdad85a3ca84752bf074fdb2fa203954b32e. + The object is already disposed, there is no point in setting the state. + +2012-11-29 12:30:20 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: TEARDOWN brings that state to Init again + +2012-11-29 11:11:05 +0100 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + * examples/test-auth.c: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media-factory-uri.h: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-mount-points.c: + * gst/rtsp-server/rtsp-mount-points.h: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-media.h: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + * tests/check/gst/media.c: + rtsp: make object details private + Make all object details private + Add methods to access private bits + +2012-11-28 14:50:47 +0100 Wim Taymans + + * tests/check/Makefile.am: + * tests/check/gst/media.c: + tests: add media tests + +2012-11-28 14:45:30 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: check if prepared for some methods + Check that the media object is prepared before doing seek and getting the + current position etc. + Add some g_return checks. + +2012-11-28 12:40:46 +0100 Wim Taymans + + * tests/check/Makefile.am: + * tests/check/gst/mediafactory.c: + tests: add mediafactory test + +2012-11-28 12:40:18 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: improve debug + +2012-11-28 12:39:37 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: unref pipeline in finalize to avoid leaking it + +2012-11-28 12:10:47 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media.c: + rtsp: use gst_object_unref on GstObjects + +2012-11-28 12:10:14 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + media-factory: require an url + +2012-11-28 11:40:33 +0100 Wim Taymans + + * examples/test-uri.c: + examples: fix include + +2012-11-28 11:17:27 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.h: + server: remove unused include + +2012-11-28 11:07:57 +0100 Wim Taymans + + * tests/check/Makefile.am: + * tests/check/gst/mountpoints.c: + tests: add test for mountpoints + +2012-11-28 11:05:08 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: fix factory leak + Keep the factory in the state object only for authorization checks and make + sure we unref it on failure. Also don't keep invalid objects in the state + object. + +2012-11-28 10:40:14 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-mount-points.c: + mounts: add g_return_if guards + +2012-11-27 12:51:55 +0100 Wim Taymans + + * tests/check/gst/client.c: + tests: add more tests + +2012-11-27 12:33:02 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: improve debug + +2012-11-27 12:24:21 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: improve debug and fix leaks + Cleanup the uri and session when there is a bad request. + +2012-11-27 12:17:05 +0100 Wim Taymans + + * common: + update common + +2012-11-27 12:13:59 +0100 Wim Taymans + + * tests/check/gst/client.c: + test: add test for session in options request + +2012-11-27 12:11:41 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: use 454 when session can't be found + We should use 454 when a session can't be found because there was no session + pool configured in the server. This is not a server configuration problem + because the server on which the request is done might not be the same one that + will keep the sessions for us and so it does not need to support sessions. + +2012-11-27 11:17:45 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: only free connection when there is one + It's possible that the client doesn't have a connection when we try to free it. + +2012-11-27 11:17:31 +0100 Wim Taymans + + * tests/check/Makefile.am: + * tests/check/gst/client.c: + tests: add unit test for the client object + +2012-11-26 17:35:51 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: small cleanup + +2012-11-26 17:34:35 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.h: + client: remove unused include + +2012-11-26 17:34:24 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: fix compilation + +2012-11-26 17:28:29 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: call destroy without the lock + +2012-11-26 17:20:39 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: make the client usable without a socket + Make a method to let the client handle a message and a callback when the client + wants us to send a response message back. This makes it possible to also use the + client object without the sockets, which should make it easier to test. + +2012-11-26 16:45:04 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: small cleanup + +2012-11-26 16:39:26 +0100 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-server.c: + client: remove reference to server + We don't need to keep a ref to the server + +2012-11-26 16:30:16 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: add locking + Also add some g_return_if() + +2012-11-26 13:37:20 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: log more errors + +2012-11-26 13:35:48 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: fix compilation + +2012-11-26 13:16:59 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: add generic close-after-send support + Add a property to send_response() to close the connection after the response has + been sent to the client. + +2012-11-26 12:34:05 +0100 Wim Taymans + + * docs/README: + * docs/libs/gst-rtsp-server-docs.sgml: + * docs/libs/gst-rtsp-server-sections.txt: + * docs/libs/gst-rtsp-server.types: + * examples/test-auth.c: + * examples/test-launch.c: + * examples/test-mp4.c: + * examples/test-multicast.c: + * examples/test-multicast2.c: + * examples/test-ogg.c: + * examples/test-readme.c: + * examples/test-sdp.c: + * examples/test-uri.c: + * examples/test-video.c: + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media-mapping.c: + * gst/rtsp-server/rtsp-media-mapping.h: + * gst/rtsp-server/rtsp-mount-points.c: + * gst/rtsp-server/rtsp-mount-points.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + * tests/check/gst/rtspserver.c: + MediaMapping -> MountPoints + Describes better what the object manages. + +2012-11-26 09:36:09 +0100 Wim Taymans + + * configure.ac: + configure: bump required version of -base + +2012-11-21 17:21:28 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: fix seeking + +2012-11-21 16:41:56 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: support more Range formats + Use the new -base methods to convert the Range string into a seek start and stop + value. + +2012-11-21 16:41:37 +0100 Wim Taymans + + * examples/test-launch.c: + examples: fix whitespace + +2012-11-20 13:34:46 +0100 Wim Taymans + + * examples/test-auth.c: + test-auth: add example of how to remove sessions + Add an example of the session filter api. + +2012-11-20 12:47:49 +0100 Wim Taymans + + * examples/test-uri.c: + test-uri: remove mapping example + +2012-11-20 12:47:20 +0100 Wim Taymans + + * examples/test-uri.c: + test-uri: fix callback signature + +2012-11-20 12:29:55 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + factory: keep ref to factory while media active + While the media from a factory is alive, keep a ref to the factory. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=663555 + +2012-11-20 12:29:26 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + factory-uri: add some debug + +2012-11-20 12:24:13 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: set udp sources to PLAYING + Set the UDP sources to PLAYING and locked state before we add it to the pipeline + so that it doesn't cause our pipeline to produce ASYNC-DONE. + +2012-11-20 12:10:16 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + factory-uri: take ref to factory + Take a ref to the factory that we place in our list. + +2012-11-20 11:30:09 +0100 Wim Taymans + + * tests/Makefile.am: + * tests/test-reuse.c: + test: add test for server reuse + See https://bugzilla.gnome.org/show_bug.cgi?id=688395 + +2012-11-15 14:02:37 +0100 David Svensson Fors + + * gst/rtsp-server/rtsp-server.c: + server: start and stop multiple times + Stop listening on the RTSP port when the GSource is removed, so clients + can't connect and the server can be started again. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=688395 + +2012-11-20 11:24:35 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: fix small leak + +2012-11-20 09:42:51 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: unref source in finish_unprepare + The source is created in prepare, unref it in finish_unprepare. + See https://bugzilla.gnome.org/show_bug.cgi?id=688707 + +2012-11-19 15:47:08 +0100 David Svensson Fors + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + rtsp-media: remove bus watch before finalizing + * A GDestroyNotify function is set for the bus watch in gst_rtsp_media_prepare. + * An extra media ref is added for the bus watch. This extra ref is unreffed by + the GDestroyNotify function. + * gst_rtsp_media_unprepare destroys the source so the bus watch is removed. + * GstRTSPClient, which calls gst_rtsp_media_prepare, also calls + gst_rtsp_media_unprepare before unreffing the media. + This way, the bus watch will be removed before the media is finalized. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=688707 + +2012-11-17 14:51:52 +0100 Alessandro Decina + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: wait until the TEARDOWN response is sent to close the connection + Responses can be sent async so we need to wait until the TEARDOWN response has + been written before we close the connection to the client. This avoids the risk + of writing/polling closed sockets. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=688535 + +2012-11-19 15:44:27 +0100 David Svensson Fors + + * gst/rtsp-server/rtsp-stream.c: + rtsp-stream: plug socket leak + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=688703 + +2012-11-19 11:31:12 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 6bb6951 to a72faea + +2012-11-17 00:11:27 +0000 Tim-Philipp Müller + + * gst/rtsp-server/rtsp-media-factory-uri.c: + rtsp-server: don't use deprecated API + +2012-11-17 00:03:42 +0000 Tim-Philipp Müller + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: fix unused-but-set-variable compiler warning + rtsp-client.c:1260:21: error: variable 'protocols' set but not used + +2012-11-15 17:11:16 +0100 Wim Taymans + + * TODO: + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-client.c: + rtsp: cleanups + +2012-11-15 16:52:42 +0100 Wim Taymans + + * examples/Makefile.am: + * examples/test-multicast2.c: + examples: add another multicast example + Add an example for how to configure separate multicast ranges for each media + stream. + +2012-11-15 16:21:51 +0100 Wim Taymans + + * examples/test-multicast.c: + test: set shared + +2012-11-15 16:18:29 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-media.h: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + stream: use the address managed by the stream + Use the address managed by the stream for multicast. This allows us to have 1 + multicast address for each stream. + Because the address is now managed by the stream we don't have to pass it around + anymore. + Set the address pool on the streams. + +2012-11-15 16:15:20 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-stream.c: + rtsp: improve debug + +2012-11-15 15:41:42 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add signal for new streams + This allows applications to listen for new streams and configure properties on + them, like the address pool. + +2012-11-15 15:41:19 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: configure address pool in new streams + +2012-11-15 15:36:21 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add methods to deal with address pool + Add methods to get and set the address pool for the stream + Add method to allocate and get the multicast addresses for this stream. + +2012-11-15 15:32:43 +0100 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: remove MTU property + It is a stream property + +2012-11-15 15:29:35 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: set blocksize only on stream + Set the blocksize only on the current stream. + +2012-11-15 13:52:07 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: share src and sink sockets + the allocated socket is in the used-socket property, not socket. + +2012-11-15 13:25:14 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-address-pool.h: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-media.h: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + * tests/check/gst/addresspool.c: + rtsp: make address-pool return an address object + Return a boxed GstRTSPAddress from the GstRTSPAddressPool. This allows us to + store more info in the structure and allows us to more easily return the address + to the right pool when no longer needed. + Pass the address to the StreamTransport so that we can return it to the pool + when the stream transport is freed or changed. + +2012-11-15 13:22:54 +0100 Wim Taymans + + * examples/Makefile.am: + * examples/test-multicast.c: + examples: add multicast example + Show how to set up the multicast address pool so that media can be + server with multicast. + +2012-11-14 17:23:59 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + rtsp: use AddressPool + Remove the multicast_group property. + Use the configured addresspool to allocate multicast addresses. + +2012-11-14 16:17:33 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-address-pool.h: + address-pool: add clear method + +2012-11-14 16:10:45 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-address-pool.c: + address-pool: small cleanups + +2012-11-14 15:50:42 +0100 Wim Taymans + + * tests/check/Makefile.am: + * tests/check/gst/addresspool.c: + tests: add addresspool unit test + +2012-11-14 15:49:06 +0100 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-address-pool.c: + * gst/rtsp-server/rtsp-address-pool.h: + address-pool: add object to manage multicast addresses + Make an object that can manage a rage of multicast addresses and ports. + +2012-11-13 12:05:42 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: set default max-threads property + +2012-11-13 11:54:17 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: wait for concurrent _prepare + If a prepare is busy, wait for the result. + +2012-11-13 11:49:08 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: add lock around message handler + We don't want to dispatch messages while we are still processing the result of + the state change. + +2012-11-13 11:15:35 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add lock to protect state changes + +2012-11-13 11:14:49 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: add locking + +2012-11-12 17:11:18 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + * gst/rtsp-server/rtsp-stream.c: + stream-transport: add keep-alive method + +2012-11-12 17:06:42 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + * gst/rtsp-server/rtsp-stream.c: + stream-transport: add method to handle RTP/RTCP + Call new methods instead of poking into the structures directly. + +2012-11-12 16:51:03 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-media.h: + session-media: add locking + +2012-11-12 16:42:37 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + session: add locking + +2012-11-12 16:30:16 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: free old socket + +2012-11-12 16:18:57 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-mapping.c: + * gst/rtsp-server/rtsp-media-mapping.h: + mapping: add locking + +2012-11-12 16:14:19 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + media-factory: add locking + +2012-11-12 16:03:21 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + auth: add locking + +2012-11-12 15:53:28 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + server: add max-thread property + +2012-11-12 15:29:39 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + server: use a threadpool for the mainloops + +2012-11-12 14:30:43 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: rename method + gst_rtsp_client_create_from_socket -> gst_rtsp_client_use_socket: we + don't really create the client from the socket, we use the socket for the + client. + +2012-11-12 14:09:09 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-server.c: + server: rework maincontext handling in clients + Make a separate method to attach a client to a MainContext. + Let the server decide in what GMainContext the client will operate and give this + context to the client in attach. Then the server can later decide to use a + separate thread for each client or just use the mainthread. + +2012-11-12 12:40:34 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + session: move session header code in session object + +2012-11-04 00:14:25 +0000 Tim-Philipp Müller + + * COPYING: + * COPYING.LIB: + * examples/test-auth.c: + * examples/test-launch.c: + * examples/test-mp4.c: + * examples/test-ogg.c: + * examples/test-readme.c: + * examples/test-sdp.c: + * examples/test-uri.c: + * examples/test-video.c: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media-factory-uri.h: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media-mapping.c: + * gst/rtsp-server/rtsp-media-mapping.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-params.c: + * gst/rtsp-server/rtsp-params.h: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-sdp.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-media.h: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + * tests/check/gst/rtspserver.c: + * tests/test-cleanup.c: + Fix FSF address + +2012-10-28 13:48:44 +0100 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session.c: + rtsp-server: added annotations to indicate type of ownership transfer of return values + https://bugzilla.gnome.org/show_bug.cgi?id=680777 + +2012-10-28 15:37:51 +0000 Tim-Philipp Müller + + * configure.ac: + No need to define GST_USE_UNSTABLE_API any more, 1.0 is stable now + +2012-10-28 15:09:04 +0000 Tim-Philipp Müller + + * Makefile.am: + * bindings/Makefile.am: + * bindings/vala/Makefile.am: + * bindings/vala/gst-rtsp-server-0.10.deps: + * bindings/vala/gst-rtsp-server-0.10.vapi: + * bindings/vala/packages/gst-rtsp-server-0.10.deps: + * bindings/vala/packages/gst-rtsp-server-0.10.files: + * bindings/vala/packages/gst-rtsp-server-0.10.gi: + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + * bindings/vala/packages/gst-rtsp-server-0.10.namespace: + * configure.ac: + bindings: remove vala bindings + They'll be reunited with the other GStreamer bindings + https://bugzilla.gnome.org/show_bug.cgi?id=680777 + +2012-10-28 00:23:57 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-media.h: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + rtsp: only create transport when needed + Only create the StreamTransport when configured. + +2012-10-27 23:53:35 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: small cleanup + +2012-10-27 23:49:24 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + rtsp: refactor configuration of transport + Move the configuration of the transport to a place where it makes + more sense. + +2012-10-27 21:26:55 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: refactor transport parsing + +2012-10-27 21:05:03 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: refuse to change the MTU on shared media + If we change the MTU of chared media, it changes for all clients. + We don't want to set the MTU to something large for clients that + stream over UDP. + +2012-10-27 11:53:51 +0200 Wim Taymans + + * examples/test-mp4.c: + * gst/rtsp-server/rtsp-media.c: + small fixes to docs and debug + +2012-10-26 17:29:30 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-stream.c: + stream: transports must already have been removed + +2012-10-26 17:28:10 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + stream: improve join and leave of the pipeline + simplify code + Do the cleanup properly + Add some docs + +2012-10-26 15:23:16 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: move unprepare below default implementation + Makes it easier to find the default implementation + +2012-10-26 15:21:50 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: signal unprepared when we actually finish + +2012-10-26 15:19:23 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: no need to unlock, unprepare does that when needed + +2012-10-26 12:33:21 +0200 Wim Taymans + + * docs/libs/gst-rtsp-server-sections.txt: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media-mapping.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-params.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + * gst/rtsp-server/rtsp-stream-transport.h: + * gst/rtsp-server/rtsp-stream.h: + docs: update docs + +2012-10-26 12:04:02 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-mapping.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + rtsp: fix MTU setting + Fix setting of the MTU. There is no need for a vmethod. + +2012-10-26 11:02:43 +0200 Wim Taymans + + * docs/README: + docs: update docs + +2012-10-26 11:24:55 +0100 Tim-Philipp Müller + + * configure.ac: + configure: bump version number after refactoring + +2012-10-25 21:29:58 +0200 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-session-media.c: + * gst/rtsp-server/rtsp-session-media.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + * gst/rtsp-server/rtsp-stream-transport.c: + * gst/rtsp-server/rtsp-stream-transport.h: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + rtsp: massive refactoring + Make GObjects from the remaining simple structures. + Remove GstRTSPSessionStream, it's not needed. + Rename GstRTSPMediaStream -> GstRTSPStream: It is shorter + Rename GstRTSPMediaTrans -> GstRTSPStreamTransport: It describes how + a GstRTSPStream should be transported to a client. + Rename GstRTSPMediaFactory::get_element -> create_element because that + more accurately describes what it does. + Make nice methods instead of poking in the structures. + Move some methods inside the relevant object source code. + Use GPtrArray to store objects instead of plain arrays, it is more + natural and allows us to more easily clean up. + Move the allocation of udp ports to the Stream object. The Stream object + contains the elements needed to stream the media to a client. + Improve the prepare and unprepare methods. Unprepare should now undo + everything prepare did. Improve also async unprepare when doing EOS on + shutdown. Make sure we always unprepare correctly. + +2012-10-23 22:11:17 +0200 Sebastian Rasmussen + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: Unref server address clients connected to + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=686725 + +2012-10-22 16:09:24 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-server.c: + rtsp-server: don't ref server socket if it is NULL + Fixes test_bind_already_in_use unit test again after commit 6a497440. + https://bugzilla.gnome.org/show_bug.cgi?id=686644 + +2012-10-22 16:29:09 +0200 Sebastian Rasmussen + + * tests/check/Makefile.am: + tests: Add libgio link dependency + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=686647 + +2012-10-01 20:03:43 +0200 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-media-mapping.c: + * gst/rtsp-server/rtsp-media-mapping.h: + rtsp-media-mapping: rename find_media vfunc to find_factory + The virtual method and class method should have the same name + so it is correctly represented in GIR file + https://bugzilla.gnome.org/show_bug.cgi?id=680777 + +2012-10-01 19:46:15 +0200 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-mapping.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session.c: + rtsp-server: fixed comments and GIR annotations + https://bugzilla.gnome.org/show_bug.cgi?id=680777 + +2012-10-12 07:18:19 +0200 Alessandro Decina + + * gst/rtsp-server/rtsp-media-mapping.c: + media-mapping: fix transfer mode for gst_rtsp_media_mapping_add_factory + +2012-10-12 07:08:57 +0200 Alessandro Decina + + * gst/rtsp-server/rtsp-server.c: + rtsp-server: allow binding on port 0 (binds on a random port) + +2012-10-12 06:21:24 +0200 Alessandro Decina + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + rtsp-server: add bound-port property + bound-port can be used to retrieve the port number when the server is bound on + port 0, which binds on a random port. + +2012-10-12 06:11:36 +0200 Alessandro Decina + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + rtsp-media-factory: make ::get_element overridable by GI bindings + The way to annotate vfuncs with GI seems to be to create an invoker (GI term) + for them and to annotate the invoker. Add gst_rtsp_media_factory_get_element() + as the invoker for ::get_element(), making it overridable by GI generated + bindings. + +2012-10-12 06:07:07 +0200 Alessandro Decina + + * gst/rtsp-server/rtsp-media-factory-uri.c: + rtsp-media-factory-uri: don't autoplug parsers in a loop + Stop autoplugging parsers if caps have parsed=true set. Fixes autoplugging + h264parse forever. + +2012-10-06 15:49:07 +0200 Alessandro Decina + + * gst/rtsp-server/Makefile.am: + Explicitly link against gio. Fix link error on mac. + +2012-10-10 11:13:10 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-session.c: + session: add ttl to the transport header in SETUP + See https://bugzilla.gnome.org/show_bug.cgi?id=685561 + +2012-10-10 11:06:02 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media.c: + client: Use client transport settings for multicast if allowed. + This patch makes it possible for the client to send transport settings for + multicast (destination && ttl). Client settings must be explicitly allowed or + the server will use its own settings. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=685561 + +2012-10-06 15:02:27 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 6c0b52c to 6bb6951 + +2012-10-01 16:13:50 +0200 Patricia Muscalu + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: do not destroy the rtsp watch + Don't destroy the client watch while dispatching. The rtsp watch is + automatically destroyed after the rtsp watch function closed() has + been called. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=685220 + +2012-09-22 16:11:48 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 4f962f7 to 6c0b52c + +2012-09-10 16:25:57 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-media.c: + media: fix check for seekability + +2012-09-07 17:14:30 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: use more GIO + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=681593 + +2012-09-07 17:14:10 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: remove obsolete includes + +2012-09-03 17:33:17 -0700 Aleix Conchillo Flaque + + rtsp-media: also initialize transports in on_ssrc_active (bug #683304) + * gst/rtsp-server/rtsp-media.c: GstRTSPMediaStream transports might not + be available in "on_new_ssrc". The transports are added in + gst_rtsp_media_set_state when going to PLAYING state. However, + "on_new_ssrc" might be called before this happens. + https://bugzilla.gnome.org/show_bug.cgi?id=683304 + +2012-09-03 10:48:14 -0700 Aleix Conchillo Flaque + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + rtsp-client: add signals for rtsp requests (fixes #683287) + +2012-08-30 12:03:27 -0700 Aleix Conchillo Flaque + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + add new-session signal to rtsp-client (fixes #683058) + +2012-08-22 13:34:55 +0200 Stefan Sauer + + * common: + Automatic update of common submodule + From 668acee to 4f962f7 + +2012-08-15 15:54:32 +0200 Patricia Muscalu + + * gst/rtsp-server/rtsp-server.c: + * tests/check/gst/rtspserver.c: + rtsp-server: fixed segfault in gst_rtsp_server_create_socket + Do not assume that *error is set in g_socket_address_enumerator_next. + Added test_bind_already_in_use unit-test. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=681914 + +2012-08-05 16:43:53 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 94ccf4c to 668acee + +2012-07-18 15:54:49 +0200 Patricia Muscalu + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + rtsp-client: make create_sdp virtual method + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=680173 + +2012-07-23 08:48:25 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 98e386f to 94ccf4c + +2012-07-10 11:39:58 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: fix docs + +2012-07-03 18:06:00 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + rtsp-server: use an existing socket to establish HTTP tunnel + Make it possible to transfer a socket from an HTTP server to be used as + an RTSP over HTTP tunnel. + +2012-07-03 13:26:30 +0200 Ognyan Tonchev + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + rtsp: Handle the blocksize parameter + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=679325 + +2012-06-25 14:28:10 +0200 Sebastian Rasmussen + + * tests/check/Makefile.am: + * tests/check/gst/rtspserver.c: + Have unit test get header from source dir, not installed dir + This makes compilation of unit tests work in a build directory other + than the source directory. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=678789 + +2012-06-23 15:06:11 +0100 Tim-Philipp Müller + + * gst/rtsp-server/rtsp-media.c: + rtsp-media: update for gst_element_make_from_uri() changes + +2012-06-19 15:25:36 +0200 David Svensson Fors + + * configure.ac: + * tests/Makefile.am: + * tests/check/Makefile.am: + * tests/check/gst/rtspserver.c: + rtsp: add unit test + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=678076 + +2012-06-13 11:43:17 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-media.c: + rtsp-media: don't collect media stats when going to NULL + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=678015 + +2012-06-14 09:59:06 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: don't leak transports + +2012-06-12 14:45:39 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: free transport on no_stream in SETUP handler + +2012-06-12 14:33:35 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: changed session media iteration + In client_unlink_session: now don't iterate in session->medias + list where items are removed by gst_rtsp_session_release_media. + Instead, repeatedly remove the first item. + +2012-06-12 13:39:35 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: don't use g_object_unref on GstRTSPSessionMedia + GstRTSPSessionMedia is not a GObject type. When the + GstRTSPSession is freed, it will free the media. + +2012-06-12 13:36:57 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-media-factory.c: + factory: plug pad leak in collect_streams + In gst_rtsp_media_factory_collect_streams: unref the srcpad that + was retrieved using gst_element_get_static_pad. gst_ghost_pad_new + will take one reference, and the other reference will otherwise + give a memory leak. + +2012-05-25 16:43:38 +0200 Sebastian Rasmussen + + * configure.ac: + configure: suppress some warnings when debug is disabled + Warnings about unused variables should be suppressed if core has the + debug system disabled. + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=676824 + +2012-06-09 17:41:05 +0100 Tim-Philipp Müller + + * docs/libs/Makefile.am: + docs: fix build in uninstalled setup + Include gst-plugins-base libs properly. + +2012-05-25 16:38:15 +0200 Sebastian Rasmussen + + * docs/libs/gst-rtsp-server.types: + docs: include headers defining rtsp-server object types + Fixes compiler warnings during docs build. + https://bugzilla.gnome.org/show_bug.cgi?id=676824 + +2012-05-25 17:11:53 +0200 Sebastian Rasmussen + + * configure.ac: + configure: Add warning flags for compiler when configuring + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=676824 + +2012-06-08 15:07:06 +0200 Edward Hervey + + * common: + Automatic update of common submodule + From 03a0e57 to 98e386f + +2012-06-06 18:20:49 +0200 Edward Hervey + + * common: + Automatic update of common submodule + From 1fab359 to 03a0e57 + +2012-06-06 14:49:02 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-client.c: + client: fix GSocketAddress leak in gst_rtsp_client_accept + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=677463 + +2012-06-01 10:30:58 +0200 Edward Hervey + + * common: + Automatic update of common submodule + From f1b5a96 to 1fab359 + +2012-05-31 13:11:43 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 92b7266 to f1b5a96 + +2012-05-30 12:48:51 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From ec1c4a8 to 92b7266 + +2012-05-30 11:27:31 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 3429ba6 to ec1c4a8 + +2012-05-22 15:37:25 +0200 David Svensson Fors + + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-server.c: + rtsp: fix compiler warnings + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=676500 + +2012-05-13 15:59:10 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From dc70203 to 3429ba6 + +2012-05-11 09:42:47 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + rtsp-server: port to new thread API + +2012-04-16 09:11:54 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 6db25be to dc70203 + +2012-04-13 15:27:22 +0200 Sebastian Dröge + + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + rtsp-server: Fix compilation and compiler warnings + +2012-04-13 13:49:08 +0200 Sebastian Dröge + + * autogen.sh: + * configure.ac: + * gst/rtsp-server/Makefile.am: + configure: Modernize autotools setup a bit + Also we now only create tar.bz2 and tar.xz tarballs. + +2012-04-13 13:39:40 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 464fe15 to 6db25be + +2012-04-05 18:45:43 +0200 Sebastian Dröge + + * common: + Automatic update of common submodule + From 7fda524 to 464fe15 + +2012-04-04 14:45:55 +0200 Sebastian Dröge + + * configure.ac: + * docs/libs/Makefile.am: + * docs/version.entities.in: + * gst-rtsp.spec.in: + * gst/rtsp-server/Makefile.am: + * pkgconfig/Makefile.am: + * pkgconfig/gstreamer-rtsp-server-uninstalled.pc.in: + * pkgconfig/gstreamer-rtsp-server.pc.in: + * tests/Makefile.am: + rtsp-server: Update versioning + +2012-03-29 15:12:21 +0200 Sebastian Dröge + + Merge remote-tracking branch 'origin/0.10' + Conflicts: + gst/rtsp-server/rtsp-session-pool.c + +2012-03-27 10:13:20 +0200 Sebastian Dröge + + * gst/rtsp-server/rtsp-session-pool.c: + rtsp-server: Don't use deprecated GLib API + +2012-03-26 12:23:36 +0200 Wim Taymans + + Replace master with 0.11 + +2012-03-26 12:22:05 +0200 Wim Taymans + + Merge branch 'master' into 0.11 + +2012-03-26 12:20:51 +0200 Wim Taymans + + Merge branch 'master' into 0.11 + +2012-03-19 10:48:09 +0000 Vincent Penquerc'h + + * docs/README: + A couple minor typo fixes + +2012-03-13 18:10:53 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: fix state of the appqueue + +2012-03-13 16:06:50 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + factory: use videoconvert + +2012-03-13 16:02:47 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + factory: change to new style caps + +2012-03-07 15:03:55 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-pool.c: + rtsp-server: port to GIO + Port to GIO + +2012-03-07 15:03:24 +0100 Wim Taymans + + * configure.ac: + configure: fix build + +2012-02-29 15:56:06 +0000 Tim-Philipp Müller + + * docs/README: + docs: fix for gst_rtsp_server_set_port() -> _set_service() + https://bugzilla.gnome.org/show_bug.cgi?id=666548 + +2012-02-13 11:42:51 +0000 Tim-Philipp Müller + + * configure.ac: + * examples/Makefile.am: + First rule of gst-rtsp-server club: don't talk about gst-phonon + +2012-02-13 11:40:44 +0000 Tim-Philipp Müller + + * configure.ac: + * pkgconfig/Makefile.am: + * pkgconfig/gst-rtsp-server-uninstalled.pc.in: + * pkgconfig/gst-rtsp-server.pc.in: + * pkgconfig/gstreamer-rtsp-server-uninstalled.pc.in: + * pkgconfig/gstreamer-rtsp-server.pc.in: + pkg-config: rename gst-rtsp-server-0.11.pc to gstreamer-rtsp-server-0.11.pc + For consistency with all other modules. + +2012-02-13 11:06:33 +0000 Tim-Philipp Müller + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: update for new map API + +2012-02-13 10:37:37 +0000 Tim-Philipp Müller + + * .gitignore: + * bindings/Makefile.am: + * bindings/python/Makefile.am: + * bindings/python/arg-types.py: + * bindings/python/codegen/Makefile.am: + * bindings/python/codegen/__init__.py: + * bindings/python/codegen/argtypes.py: + * bindings/python/codegen/code-coverage.py: + * bindings/python/codegen/codegen.py: + * bindings/python/codegen/definitions.py: + * bindings/python/codegen/defsparser.py: + * bindings/python/codegen/docextract.py: + * bindings/python/codegen/docgen.py: + * bindings/python/codegen/fileprefix.override: + * bindings/python/codegen/fileprefixmodule.c: + * bindings/python/codegen/h2def.py: + * bindings/python/codegen/mergedefs.py: + * bindings/python/codegen/mkskel.py: + * bindings/python/codegen/override.py: + * bindings/python/codegen/reversewrapper.py: + * bindings/python/codegen/scmexpr.py: + * bindings/python/rtspserver-types.defs: + * bindings/python/rtspserver.defs: + * bindings/python/rtspserver.override: + * bindings/python/rtspservermodule.c: + * bindings/python/test.py: + * configure.ac: + python: remove pygst-based python bindings + pygi is the future, apparently. + +2012-01-25 14:12:41 +0100 Thomas Vander Stichele + + * common: + Automatic update of common submodule + From c463bc0 to 7fda524 + +2012-01-25 11:40:59 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From 2a59016 to c463bc0 + +2012-01-18 16:48:41 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From 0807187 to 2a59016 + +2012-01-04 19:56:02 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 11f0cd5 to 0807187 + +2011-12-09 11:00:46 +0100 Wim Taymans + + * examples/test-auth.c: + example: update for new caps + +2011-12-09 10:53:30 +0100 Wim Taymans + + * examples/test-video.c: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + rtsp-server: port some more to 0.11 + Fix caps. + Remove bufferlist stuff + Update for new API. + Add queue before appsink now that preroll-queue-len is gone. + Update for request pad changes. + +2011-11-03 16:14:03 +0100 Wim Taymans + + Merge branch 'master' into 0.11 + +2011-11-03 16:06:23 +0100 Fabian Deutsch + + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + bindings: Fix vala binding of gst_rtsp_media_mapping_add_factory to transfer ownership. + Signed-off-by: Fabian Deutsch + +2011-11-03 16:06:23 +0100 Fabian Deutsch + + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + bindings: Fix vala binding of gst_rtsp_media_mapping_add_factory to transfer ownership. + Signed-off-by: Fabian Deutsch + +2011-11-03 12:58:42 +0100 Wim Taymans + + Merge branch 'master' into 0.11 + +2011-11-03 12:55:24 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add a seekable boolean + Maintain the seekable state with a new variable instead of reusing the + is_live variable. + +2011-09-16 11:31:17 -0400 Victor Gottardi + + * gst/rtsp-server/rtsp-media.c: + Disallow seek in live media + +2011-11-03 11:58:42 +0100 Wim Taymans + + Merge branch 'master' into 0.11 + +2011-11-03 10:48:40 +0100 mat + + * gst/rtsp-server/rtsp-server.c: + #ifdef statements for windows socket creation were missing + +2011-09-06 21:53:46 +0200 Stefan Sauer + + * common: + Automatic update of common submodule + From a39eb83 to 11f0cd5 + +2011-09-06 16:07:18 +0200 Stefan Sauer + + * common: + Automatic update of common submodule + From 605cd9a to a39eb83 + +2011-08-16 16:39:26 +0200 Wim Taymans + + Merge branch 'master' into 0.11 + +2011-08-16 16:07:04 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: use method to access property + +2011-08-16 15:15:19 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: add protocols property + Add a property to configure the allowed protocols in the media created from the + factory. + +2011-08-16 15:03:06 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: add media-configure signal + Add signal to allow the application to configure the media after it was created + from the factory. + +2011-08-16 16:07:04 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: use method to access property + +2011-08-16 15:15:19 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: add protocols property + Add a property to configure the allowed protocols in the media created from the + factory. + +2011-08-16 15:03:06 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: add media-configure signal + Add signal to allow the application to configure the media after it was created + from the factory. + +2011-08-16 14:50:50 +0200 Wim Taymans + + Merge branch 'master' into 0.11 + +2011-08-16 13:43:44 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: use media multicast group + +2011-08-16 13:37:50 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.h: + retab some .h + +2011-08-16 13:31:52 +0200 Robert Krakora + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-sdp.h: + sdp: copy and free the server ip address + Copy and free the server ip address to make memory management easier later. + +2011-08-16 13:27:39 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + media-factory: configure multicast in media + +2011-08-16 13:25:16 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add property for multicast group + Add a property to configure the multicast group in the media. + Based on patches from Marc Leeman and Robert Krakora. + +2011-08-16 13:13:36 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: add property for multicast group + Add a property to configure the multicast group in the media factory. + Based on patches from Marc Leeman and Robert Krakora. + +2011-08-16 12:51:44 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: do configuration of transport in one place + Move the configuration of the transport destination address to where we also + configure the other bits. + +2011-08-16 13:43:44 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: use media multicast group + +2011-08-16 13:37:50 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.h: + retab some .h + +2011-08-16 13:31:52 +0200 Robert Krakora + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-sdp.h: + sdp: copy and free the server ip address + Copy and free the server ip address to make memory management easier later. + +2011-08-16 13:27:39 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + media-factory: configure multicast in media + +2011-08-16 13:25:16 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add property for multicast group + Add a property to configure the multicast group in the media. + Based on patches from Marc Leeman and Robert Krakora. + +2011-08-16 13:13:36 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: add property for multicast group + Add a property to configure the multicast group in the media factory. + Based on patches from Marc Leeman and Robert Krakora. + +2011-08-16 12:51:44 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: do configuration of transport in one place + Move the configuration of the transport destination address to where we also + configure the other bits. + +2011-08-16 12:11:59 +0200 Wim Taymans + + Merge branch 'master' into 0.11 + +2011-08-16 12:09:48 +0200 Robert Krakora + + * gst/rtsp-server/rtsp-client.c: + client: destroy pipeline on client disconnect with no prior TEARDOWN. + The problem occurs when the client abruptly closes the connection without + issuing a TEARDOWN. The TEARDOWN handler in the rtsp-client.c file of the RTSP + server is where the pipeline gets torn down. Since this handler is not called, + the pipeline remains and is up and running. Subsequent clients get their own + pipelines and if the do not issue TEARDOWNs then those pipelines will also + remain up and running. This is a resource leak. + +2011-08-16 11:53:37 +0200 Wim Taymans + + Merge branch 'master' into 0.11 + +2011-06-30 10:13:59 +0200 Emmanuel Pacaud + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: add a "media-constructed" signal to GstRTSPMediaFactory + For example, it can be used to retrieve source elements like appsrc, in a more + convenient way than subclassing get_element. + +2011-08-16 11:12:33 +0200 Wim Taymans + + Merge branch 'master' into 0.11 + +2011-08-11 18:07:08 -0700 David Schleef + + * gst/rtsp-server/rtsp-server.c: + rtsp-server: hold on to reference while using object + +2011-08-04 08:59:17 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: use new api + +2011-08-04 08:58:58 +0200 Wim Taymans + + * configure.ac: + configure: use unstable api + +2011-06-27 11:26:26 -0700 David Schleef + + * gst/rtsp-server/rtsp-client.c: + client: fix reference counting + +2011-07-20 17:16:42 +0200 Thijs Vermeir + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + fix compiler warnings about unused variables + +2011-07-19 16:10:39 +0200 Stefan Sauer + + * examples/test-launch.c: + * examples/test-readme.c: + * examples/test-uri.c: + * examples/test-video.c: + examples: tell rtsp uri when ready + +2011-06-23 11:30:14 -0700 David Schleef + + * common: + Automatic update of common submodule + From 69b981f to 605cd9a + +2011-06-13 19:05:57 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: update for buffer API change + +2011-06-07 10:54:26 +0200 Edward Hervey + + * gst/rtsp-server/Makefile.am: + Makefile.am: 0.10 => @GST_MAJORMINOR@ + +2011-06-07 10:59:16 +0200 Edward Hervey + + * gst/rtsp-server/rtsp-media-factory-uri.c: + rtsp-media-factory-uri: GST_PLUGIN_FEATURE_NAME is no longer + +2011-06-07 10:59:03 +0200 Edward Hervey + + * gst/rtsp-server/.gitignore: + .gitignore: 0.10 => 0.11 + +2011-06-07 10:54:26 +0200 Edward Hervey + + * gst/rtsp-server/Makefile.am: + Makefile.am: 0.10 => @GST_MAJORMINOR@ + +2011-05-24 18:26:06 +0200 Wim Taymans + + Merge branch 'master' into 0.11 + +2011-05-19 23:00:52 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From 9e5bbd5 to 69b981f + +2011-05-18 16:14:10 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From fd35073 to 9e5bbd5 + +2011-05-18 12:27:35 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From 46dfcea to fd35073 + +2011-05-17 09:48:13 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media.c: + media: port to new caps API + +2011-05-17 09:45:04 +0200 Wim Taymans + + Merge branch 'master' into 0.11 + +2011-05-03 21:13:15 +0200 Fabian Deutsch + + * bindings/vala/gst-rtsp-server-0.10.vapi: + Updated Vala bindings. + Signed-off-by: Fabian Deutsch + +2011-05-03 16:24:28 +0200 Fabian Deutsch + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + Add a signal for newly connected clients. + Signed-off-by: Fabian Deutsch + +2011-05-08 13:15:19 +0200 Alessandro Decina + + * bindings/python/rtspserver.override: + python: override gst_rtsp_media_mapping_add_factory to fix refcounting + +2011-04-26 19:22:50 +0200 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-funnel.c: + * gst/rtsp-server/rtsp-funnel.h: + * gst/rtsp-server/rtsp-media.c: + rtsp-server: port to 0.11 + +2011-04-26 19:14:18 +0200 Wim Taymans + + * common: + add common + +2011-04-26 19:07:13 +0200 Wim Taymans + + Merge branch 'master' into 0.11 + Conflicts: + common + configure.ac + +2011-04-24 14:07:11 +0100 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From c3cafe1 to 46dfcea + +2011-04-20 11:19:38 +0200 Alessandro Decina + + * bindings/python/Makefile.am: + * bindings/python/rtspserver.defs: + python bindings: wrap GstRTSPMediaFactoryClass vfuncs + +2011-04-20 11:13:56 +0200 Alessandro Decina + + * bindings/python/arg-types.py: + python bindings: add GstRTSPUrlParam + Needed to implement MediaFactory virtual proxies + +2011-04-20 10:19:46 +0200 Alessandro Decina + + * bindings/python/arg-types.py: + python bindings: fix returning GstRTSPUrl types + +2011-04-20 10:17:07 +0200 Alessandro Decina + + * bindings/python/arg-types.py: + python bindings: add arg type for GstRTSPUrl + +2011-04-20 10:16:08 +0200 Alessandro Decina + + * bindings/python/rtspserver.defs: + python bindings: fix the definition of MediaFactory.collect_stream + +2011-04-04 15:59:50 +0300 Stefan Kost + + * common: + Automatic update of common submodule + From 1ccbe09 to c3cafe1 + +2011-03-25 22:38:06 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From 193b717 to 1ccbe09 + +2011-03-25 14:58:34 +0200 Stefan Kost + + * common: + Automatic update of common submodule + From b77e2bf to 193b717 + +2011-03-25 10:04:57 +0100 Sebastian Dröge + + * Makefile.am: + build: Include lcov.mak to allow test coverage report generation + +2011-03-25 09:35:15 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From d8814b6 to b77e2bf + +2011-03-25 09:11:40 +0100 Sebastian Dröge + + * common: + Automatic update of common submodule + From 6aaa286 to d8814b6 + +2011-03-24 18:51:37 +0200 Stefan Kost + + * common: + Automatic update of common submodule + From 6aec6b9 to 6aaa286 + +2011-03-18 19:34:57 +0100 Luis de Bethencourt + + * autogen.sh: + autogen: wingo signed comment + +2011-03-03 20:38:03 +0100 Miguel Angel Cabrera Moya + + * gst/rtsp-server/rtsp-session-pool.c: + session: use full charset for RTSP session ID + As specified in RFC 2326 section 3.4 use full valid charset to make guessing + session ID more difficult. + https://bugzilla.gnome.org/show_bug.cgi?id=643812 + +2011-03-07 10:23:06 +0100 Sebastian Dröge + + * gst/rtsp-server/Makefile.am: + rtsp-server: Don't install the funnel header + +2011-02-28 18:35:03 +0100 Mark Nauwelaerts + + * common: + Automatic update of common submodule + From 1de7f6a to 6aec6b9 + +2011-02-26 19:58:02 +0000 Tim-Philipp Müller + + * configure.ac: + configure: require core/base 0.10.31 + Needed at least for gst_plugin_feature_rank_compare_func(). + +2011-02-14 12:56:29 +0200 Stefan Kost + + * common: + Automatic update of common submodule + From f94d739 to 1de7f6a + +2011-02-02 15:37:03 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: remove more unused code + +2011-02-02 15:30:45 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: remove duplicate filtering + Remove the duplicate filtering code now that we have a released -good version. + Give a warning instead. + +2011-01-31 17:38:47 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media.c: + media: fix default buffer size + +2011-01-31 17:37:02 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: add property to configure the buffer-size + Add a property to configure the kernel UDP buffer size. + +2011-01-31 17:28:22 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add property to configure kernel buffer sizes + Add a property to configure the kernel UDP buffer size. + +2011-01-26 15:52:54 +0000 Tim-Philipp Müller + + * configure.ac: + configure: set PYGOBJECT_REQ before using it + https://bugzilla.gnome.org/show_bug.cgi?id=640641 + +2011-01-24 11:59:22 +0000 Tim-Philipp Müller + + * docs/Makefile.am: + docs: recursive into sub-directories on 'make upload' + +2011-01-24 11:53:17 +0000 Tim-Philipp Müller + + * docs/libs/gst-rtsp-server-docs.sgml: + * docs/version.entities.in: + docs: mention full version these docs are for, not just major-minor + +2011-01-24 12:07:17 +0100 Wim Taymans + + * configure.ac: + back to development + +=== release 0.10.8 === + +2011-01-24 11:57:12 +0100 Wim Taymans + + * configure.ac: + release 0.10.8 + +2011-01-19 15:29:55 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + rtsp-server: clarify docs a little + +2011-01-13 18:57:15 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: init debug category before starting thread + +2011-01-13 18:40:48 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + auth: add realm to make it more spec compliant + +2011-01-12 18:57:41 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + server: add locking + +2011-01-12 18:33:49 +0100 Wim Taymans + + * examples/test-video.c: + example: improve example docs a little + +2011-01-12 18:26:57 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: ensure the watch has a ref to the server + +2011-01-12 18:24:44 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: simpify channel function + +2011-01-12 18:18:13 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + server: simplify management of channel and source + We don't need to keep around the channel and source objects. Let the mainloop + and the source manage the source and channel respectively. + +2011-01-12 18:17:26 +0100 Wim Taymans + + * Makefile.am: + * configure.ac: + build tests + +2011-01-12 18:16:46 +0100 Wim Taymans + + * tests/.gitignore: + * tests/Makefile.am: + * tests/test-cleanup.c: + tests: add tests directory and cleanup test + +2011-01-12 18:14:48 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-mapping.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session.c: + server: improve debugging in various objects + +2011-01-12 16:38:34 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: chain up to the parent finalize + +2010-09-21 17:04:02 -0300 André Dieb Martins + + * bindings/python/rtspserver-types.defs: + * bindings/python/rtspserver.defs: + * bindings/python/rtspserver.override: + * bindings/python/test.py: + gst-rtsp-server: update python bindings + +2011-01-12 15:37:39 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: use the response from the clientstate + Create the response object only once and store in the client state. + Make all methods use the state response, + +2011-01-12 15:36:22 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: use signal to keep track of clients + Keep track of all the clients that the server creates and remove them when they + fire the 'closed' signal. + +2011-01-12 15:35:51 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: emit signal when closing + +2011-01-12 13:57:09 +0100 Wim Taymans + + * examples/.gitignore: + * examples/Makefile.am: + * examples/test-auth.c: + * examples/test-video.c: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.h: + media: enable per factory authorisations + Allow for adding a GstRTSPAuth on the factory and media level and check + permissions when accessing the factory. + Add hints to the auth methods for future more fine grained authorisation. + Add example application for per factory authentication. + +2011-01-12 13:16:08 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-params.c: + * gst/rtsp-server/rtsp-params.h: + rtsp-server: Pass ClientState structure arround + Pass the collected information for the ongoing request in a GstRTSPClientState + structure that we can then pass around to simplify the method arguments. This + will also be handy when we implement logging functionality. + +2011-01-12 12:07:40 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: add methods to configure authorisation + +2011-01-12 12:07:20 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: unref auth in finalize + +2011-01-12 12:07:04 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: unref auth in finalize + +2011-01-12 11:07:26 +0100 Wim Taymans + + * docs/libs/gst-rtsp-server-docs.sgml: + * docs/libs/gst-rtsp-server-sections.txt: + * docs/libs/gst-rtsp-server.types: + docs: add more docs + +2011-01-12 10:57:08 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + server: separate create and accept + Create separate create and accept methods so that subclasses can create custom + client object. + Configure the server in the client object and prepare for keeping track of + connected clients. + +2011-01-12 10:42:52 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + client: add support for setting the server. + Add support for keeping a ref to the server that started this client + connection. + +2011-01-12 10:41:42 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + auth: fix memleak and add some docs + Fix a memleak of the basic auth token. + Add docs for the helper function + +2011-01-12 00:35:28 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + client: delegate setup of auth to the manager + Delegate the configuration of the authentication tokens to the manager object + when configured. + +2011-01-12 00:17:54 +0100 Wim Taymans + + * examples/test-video.c: + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-auth.c: + * gst/rtsp-server/rtsp-auth.h: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + auth: add authentication object + Add an object that can check the authorization of requests. + Implement basic authentication. + Add example authentication to test-video + +2011-01-12 00:20:36 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + server: move includes back + the includes are needed for sockaddr_in. + +2011-01-11 22:41:12 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + rtsp: move network includes where they are needed + +2011-01-07 23:45:32 +0200 Sreerenj Balachandran + + * gst/rtsp-server/rtsp-media.h: + rtsp-media.h: Minor corrections in comments. + Fixes #638944 + +2011-01-11 15:52:44 +0200 Stefan Kost + + * common: + Automatic update of common submodule + From e572c87 to f94d739 + +2011-01-11 13:01:44 +0100 Edward Hervey + + * .gitignore: + * docs/.gitignore: + * docs/libs/.gitignore: + * examples/.gitignore: + * gst/rtsp-server/.gitignore: + gitignore: updates + +2011-01-11 12:58:39 +0100 Edward Hervey + + * docs/libs/Makefile.am: + docs: We don't build ps/pdf for API reference docs + +2011-01-10 16:39:36 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From ccbaa85 to e572c87 + +2011-01-10 14:56:39 +0000 Tim-Philipp Müller + + * common: + Automatic update of common submodule + From 46445ad to ccbaa85 + +2011-01-10 15:10:53 +0100 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/fs-funnel.c: + * gst/rtsp-server/fs-funnel.h: + * gst/rtsp-server/rtsp-funnel.c: + * gst/rtsp-server/rtsp-funnel.h: + * gst/rtsp-server/rtsp-media.c: + funnel: rename fsfunnel to rtspfunnel + Rename the funnel to avoid conflicts with the farsight one. + +2011-01-10 13:41:43 +0100 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/fs-funnel.c: + * gst/rtsp-server/fs-funnel.h: + * gst/rtsp-server/rtsp-media.c: + rtsp-media: add and use fsfunnel + Add a copy of fsfunnel to the build because input-selector removed the (broken) + select-all property that we need. + +2011-01-08 01:58:44 +0000 Tim-Philipp Müller + + * gst/rtsp-server/Makefile.am: + gobject-introspection: use PKG_CONFIG_PATH specified at configure time + Use PKG_CONFIG_PATH specified at configure time (if any) as well + for the g-ir-compiler, rather than just assuming the env var has + been set. + +2011-01-08 01:55:06 +0000 Tim-Philipp Müller + + * .gitignore: + * Makefile.am: + * configure.ac: + * m4/Makefile.am: + * m4/codeset.m4: + build: make autotools put all .m4 cruft into m4/ rather than polluting common/m4 + +2011-01-08 01:15:35 +0000 Tim-Philipp Müller + + * configure.ac: + * gst/rtsp-server/Makefile.am: + gobject-introspection: fix g-i build for uninstalled setup + Requires gst-plugins-base git (> 0.10.31.2). + +2011-01-07 11:27:57 +0100 Wim Taymans + + * examples/test-uri.c: + examples: add some more options and comments + +2011-01-07 11:24:39 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + factory-uri: use right property type + +2011-01-05 12:07:42 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + factory-uri: attempt to configure buffer-lists + Attempt to configure buffer lists in the payloader for improved performance. + +2011-01-05 12:06:23 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: attempt to configure bigger UDP buffers + Attempt to configure bigger udp kernel send buffers to avoid overflowing the + send buffers with high bitrate streams. + +2011-01-05 11:26:30 +0100 Jonas Larsson + + * gst/rtsp-server/rtsp-client.c: + client: use the socket length from getsockname + Use the length returned by getsockname to perform the getnameinfo call because + the size can depend on the socket type and platform. + Fixes #638723 + +2010-12-30 12:41:53 +0100 Wim Taymans + + * docs/libs/gst-rtsp-server-docs.sgml: + * docs/libs/gst-rtsp-server-sections.txt: + docs: add uri factory to the docs + +2010-12-30 12:41:31 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.h: + docs: improve docs + +2010-12-29 16:26:41 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + rtsp-server: add support for buffer lists + Add support for sending bufferlists received from appsink. + Fixes #635832 + +2010-12-28 18:35:01 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-sdp.c: + media: make method to retrieve the play range + Make a method to retrieve the playback range so that we can conditionally create + a different range for the SDP and the PLAY requests. + +2010-12-28 18:34:10 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add signal to notify of state changes + +2010-12-28 18:31:26 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.h: + client: cleanup headers + +2010-12-28 12:18:41 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: fix typo + +2010-12-23 18:53:01 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media-factory-uri.h: + factory-uri: add support for gstpay + Add an option to prefer gstpay over decoder + raw payloader. + +2010-12-23 15:58:14 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media-factory-uri.h: + factory-uri: rework the autoplugger. + Rewrite the autoplugger a little so that it prefers to plug demuxers and parsers + before payloaders. + +2010-12-21 17:37:26 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + factory-uri: use better factory filter + Make better payloader filter based on autoplug rank and RTP use case. + +2010-12-20 17:48:41 +0100 Edward Hervey + + * common: + Automatic update of common submodule + From 169462a to 46445ad + +2010-12-18 11:24:48 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: set SO_REUSEADDR before bind + Set the SO_REUSEADDR _before_ bind() to make it actually work. + +2010-12-13 16:58:36 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: emit prepared signal when prepared + Make a 'prepared' signal and emit it when we successfully prepared the element. + This signal can be used to configure the media object after it has been prepared + for streaming. + +2010-12-15 14:58:00 +0200 Stefan Kost + + * common: + Automatic update of common submodule + From 011bcc8 to 169462a + +2010-12-13 16:38:09 +0100 Andy Wingo + + python an optional dependency + * configure.ac: Move up valgrind and g-i checks. Make the python + dependency optional, as it was before. + +2010-12-13 11:43:13 +0100 Wim Taymans + + Merge branch 'master' into 0.11 + Conflicts: + common + configure.ac + +2010-12-12 15:48:47 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: update range when active clients changed + When we changed the number of active clients, update the current range + information because we want the second client connecting to a shared resource + continue from where the stream currently. + +2010-12-12 04:06:41 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media-factory-uri.h: + factory-uri: add colorspace and fix pt + Rework the way we pass data to the autoplugger. + When we have raw caps, plug a converter element to make pluggin to raw + payloaders more successful. + Make sure all dynamically plugged payloaders have a unique payload types. + +2010-12-11 18:06:26 +0100 Wim Taymans + + * examples/Makefile.am: + * examples/test-uri.c: + example: add example of the uri factory + +2010-12-11 18:01:53 +0100 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-media-factory-uri.c: + * gst/rtsp-server/rtsp-media-factory-uri.h: + * gst/rtsp-server/rtsp-server.h: + factory-uri: add a factory to stream any URI + Make a factory that uses uridecodebin to decode any uri and autoplug a payloader + when we have one. + +2010-12-11 17:31:44 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: ignore spurious ASYNC_DONE messages + When we are dynamically adding pads, the addition of the udpsrc elements will + trigger an ASYNC_DONE. We have to ignore this because we only want to react to + the real ASYNC_DONE when everything is prerolled. + +2010-12-11 13:41:24 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + media-factory: make lock macro + +2010-12-11 10:53:28 +0100 Edward Hervey + + * gst/rtsp-server/rtsp-client.c: + rtsp-server: Remove unused variable and dead assignment + +2010-12-11 10:49:30 +0100 Edward Hervey + + * examples/test-launch.c: + * examples/test-mp4.c: + * examples/test-ogg.c: + * examples/test-readme.c: + * examples/test-sdp.c: + * examples/test-video.c: + examples: Run gst-indent + +2010-12-11 10:48:42 +0100 Edward Hervey + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-mapping.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-params.c: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session.c: + rtsp-server: Run gst-indent + Since it wasn't using the upstream common previously, there was no + indentation check before commiting. + +2010-12-11 10:48:25 +0100 Edward Hervey + + * gst/rtsp-server/rtsp-media-mapping.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + rtsp-server: Some more doc fixups + +2010-12-07 18:56:03 +0100 Edward Hervey + + * Makefile.am: + Makefile: Add cruft-cleaning support + +2010-12-07 18:52:15 +0100 Edward Hervey + + * Makefile.am: + * configure.ac: + * docs/Makefile.am: + * docs/libs/Makefile.am: + * docs/libs/gst-rtsp-server-docs.sgml: + * docs/libs/gst-rtsp-server-sections.txt: + * docs/libs/gst-rtsp-server.types: + * docs/version.entities.in: + docs: Add gtk-doc build system + +2010-12-07 18:14:39 +0100 Edward Hervey + + * gst/rtsp-server/Makefile.am: + Makefile.am: Use standard GIR make behaviour + +2010-12-07 18:14:22 +0100 Edward Hervey + + * autogen.sh: + * configure.ac: + autogen/configure: Bring more in sync to standard gst module behaviour + +2010-12-06 19:29:53 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: warn and fail when gstrtpbin is not found + +2010-12-06 12:40:30 +0100 Wim Taymans + + * configure.ac: + configure: open 0.11 branch + +2010-12-01 20:00:22 +0100 Edward Hervey + + * .gitmodules: + * common: + Add common submodule + +2010-12-01 19:58:49 +0100 Edward Hervey + + * common/ChangeLog: + * common/Makefile.am: + * common/c-to-xml.py: + * common/check.mak: + * common/coverage/coverage-report-entry.pl: + * common/coverage/coverage-report.pl: + * common/coverage/coverage-report.xsl: + * common/coverage/lcov.mak: + * common/gettext.patch: + * common/glib-gen.mak: + * common/gst-autogen.sh: + * common/gst-xmlinspect.py: + * common/gst.supp: + * common/gstdoc-scangobj: + * common/gtk-doc-plugins.mak: + * common/gtk-doc.mak: + * common/m4/.gitignore: + * common/m4/Makefile.am: + * common/m4/README: + * common/m4/as-ac-expand.m4: + * common/m4/as-auto-alt.m4: + * common/m4/as-compiler-flag.m4: + * common/m4/as-compiler.m4: + * common/m4/as-docbook.m4: + * common/m4/as-libtool-tags.m4: + * common/m4/as-libtool.m4: + * common/m4/as-python.m4: + * common/m4/as-scrub-include.m4: + * common/m4/as-version.m4: + * common/m4/ax_create_stdint_h.m4: + * common/m4/check.m4: + * common/m4/glib-gettext.m4: + * common/m4/gst-arch.m4: + * common/m4/gst-args.m4: + * common/m4/gst-check.m4: + * common/m4/gst-debuginfo.m4: + * common/m4/gst-default.m4: + * common/m4/gst-doc.m4: + * common/m4/gst-error.m4: + * common/m4/gst-feature.m4: + * common/m4/gst-function.m4: + * common/m4/gst-gettext.m4: + * common/m4/gst-glib2.m4: + * common/m4/gst-libxml2.m4: + * common/m4/gst-plugindir.m4: + * common/m4/gst-valgrind.m4: + * common/m4/gtk-doc.m4: + * common/m4/introspection.m4: + * common/m4/pkg.m4: + * common/mangle-tmpl.py: + * common/plugins.xsl: + * common/po.mak: + * common/release.mak: + * common/scangobj-merge.py: + * common/upload.mak: + common: Remove static version + +2010-11-08 17:04:00 +0000 Bastien Nocera + + * common/m4/introspection.m4: + Update introspection.m4 to match usage + +2010-10-30 13:26:12 +0200 Wim Taymans + + * README: + README: update + Remove old stuff from the README + +2010-10-11 11:12:11 +0200 Wim Taymans + + * configure.ac: + back to development + +=== release 0.10.7 === + +2010-10-11 11:05:40 +0200 Wim Taymans + + * configure.ac: + release 0.10.7 + +2010-10-04 17:16:40 +0200 Wim Taymans + + * examples/test-ogg.c: + test-ogg: remove parsers + Remove the parsers, they are not needed anymore as oggdemux now outputs normal + buffers with timestamps. Using the parsers also seems to break things. + +2010-09-23 12:44:18 +0200 Sebastian Pölsterl + + * bindings/vala/gst-rtsp-server-0.10.vapi: + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + Updated Vala bindings + +2010-09-22 23:13:37 +0200 Sebastian Pölsterl + + * common/m4/introspection.m4: + * configure.ac: + * gst/rtsp-server/Makefile.am: + Added initial gobject-introspection support + +2010-09-23 11:32:58 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + media-factory: don't use host for shared hash key + When we generate the key to share made between connections, don't include the + host used to connect so that we can share media even if between clients that + connected with localhost and ones with the ip address. + +2010-09-22 21:16:03 +0100 Tim-Philipp Müller + + * bindings/vala/Makefile.am: + build: fix distcheck + +2010-09-22 18:24:12 +0200 Sebastian Dröge + + * bindings/vala/gst-rtsp-server-0.10.vapi: + * bindings/vala/packages/gst-rtsp-server-0.10.gi: + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + Update Vala bindings + +2010-09-22 18:12:50 +0200 Sebastian Dröge + + * bindings/vala/Makefile.am: + * configure.ac: + Fix configure checks and installation location for Vala bindings + Fixes bug #628676. + +2010-09-22 16:32:30 +0200 Wim Taymans + + * configure.ac: + back to development + +=== release 0.10.6 === + +2010-09-22 16:22:49 +0200 Wim Taymans + + * configure.ac: + configure: release 0.10.6 + +2010-09-22 16:15:56 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: help the compiler a little + +2010-08-24 16:47:30 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-session.c: + media: cleanup media transport before freeing + Cleanup the media transport data before freeing. In particular, remove the qdata + from the rtpsource object. + +2010-08-20 18:17:08 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media-factory: add eos-shutdown property + Add an eos-shutdown property that will send an EOS to the pipeline before + shutting it down. This allows for nice cleanup in case of a muxer. + Fixes #625597 + +2010-08-20 15:58:39 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: use multiudpsink send-duplicates when we can + If we have a new enough multiudpsink with the send-duplicates property, use this + instead of doing our own filtering. Our custom filtering code should eventually + be removed when we can depend on a released -good. + +2010-08-20 13:19:56 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: don't leak destinations + Refactor and cleanup the destinations array when the stream is destroyed. + +2010-08-20 13:09:12 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: don't add udp addresses multiple times + Keep track of the udp addresses we added to udpsink and never add the same udp + destination twice. This avoids duplicate packets when using multicast. + +2010-08-20 10:18:34 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: disable use of SO_LINGER + SO_LINGER cause the client to fail to receive a TEARDOWN message because the + server close()s the connection. + +2010-08-19 18:52:47 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: use 5 second linger period in SO_LINGER + Wait 5 seconds before clearing the send buffers and reseting the connection with + the client when we do a close. This should be enough time to get the message to + the client. + See #622757 + +2010-08-16 12:32:28 +0200 Robert Krakora + + * gst/rtsp-server/rtsp-server.c: + server: use SO_LINGER + SO_LINGER on the socket will make sure that any pending data on the socket is + flushed ASAP and that the socket connection is reset. This makes sure that the + socket can be reused immediately. + Fixes 622757 + +2010-08-16 12:24:50 +0200 Wim Taymans + + * docs/README: + README: add blurb about shared media factories + +2010-08-09 12:56:23 -0700 David Schleef + + * gst/rtsp-server/rtsp-media.c: + Add stdlib.h for atoi() + +2010-05-20 14:33:24 +0100 Tim-Philipp Müller + + * bindings/python/Makefile.am: + * bindings/vala/Makefile.am: + build: distcheck fixes + Fix 'make distcheck', somewhat (it still fails because it tries to + install files into /usr/share/vala/vapi/ irrespective of the + configured prefix). + +2010-05-20 14:09:18 +0100 Tim-Philipp Müller + + * configure.ac: + configure: bump core/base requirements to released version + Makes things less confusing for people. + +2010-04-25 16:35:30 +0100 Tim-Philipp Müller + + * configure.ac: + configure: fail if GStreamer core/base requirements are not met + +2010-04-06 17:08:40 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: improve client cleanups + Make sure the session does not timeout when using TCP. We need to do this + because quicktime player does not send RTCP for some reason in tunneled + mode. + Refactor some cleanup code. + Fixes #612915 + +2010-04-06 17:07:27 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + session: add support for prevent session timeouts + Add an atomix counter to prevent session timeouts when we are, for example, + streaming over TCP. + +2010-04-06 15:45:56 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: fix unlink on session timeouts + When our session times out, make sure we unlink all streams in this + session. + Remove the tunnelid when closing the connection. + +2010-04-06 15:44:45 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-session.c: + session: small cleanups + +2010-04-06 11:13:51 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: handle lost_tunnel callbacks + Handle lost_tunnel callbacks and use it to store the tunnelid back into the + hashtable so that we can reuse it for when the client reopens the POST + socket. + Close the connection after a TEARDOWN. + Make sure or watchid is cleared when the watch is removed. + Fixes #612915 + +2010-03-19 18:03:40 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-sdp.c: + rtsp-server: add more support for multicast + +2010-03-19 15:15:29 +0100 Wim Taymans + + * configure.ac: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: allow configuration of allowed lower transport + +2010-03-16 18:37:18 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-sdp.h: + * gst/rtsp-server/rtsp-server.c: + rtsp: keep track of server ip and ipv6 + Keep track of how the client connected to the server and setup the udp ports + with the same protocol. + Copy the server ip address in the SDP so that clients can send RTCP back to + us. + +2010-03-16 18:34:43 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session.c: + session: indent + +2010-03-16 18:33:23 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: use right size for malloc + +2010-03-10 11:45:30 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + server: comment ipv6 server listening address + +2010-03-10 11:45:06 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: allow for ipv6 sockets + +2010-03-09 13:49:00 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + server: rework server part + Allow setting a bind address, make sure we can deal with ipv6. + Remove the port property and change with the service property. + +2010-03-09 13:44:20 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.h: + media: update comments a little + +2010-03-09 13:43:29 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: make content-base better + Use the URI formatting functions to make a content-base. Also make sure that + there is a trailing / at the end. + +2010-03-09 13:42:50 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: guard against invalid paths + +2010-03-09 13:41:33 +0100 Wim Taymans + + * examples/test-video.c: + test: catch server bind errors + +2010-03-09 10:27:38 +0100 Alessandro Decina + + * gst/rtsp-server/rtsp-media.c: + rtspmedia: emit "unprepared" if _prepare fails. + Emit the unprepared signal if gst_rtsp_media_prepare fails so that the + media object is removed from its factory's cache. + +2010-03-05 19:08:08 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: collect media position when seek completes + +2010-03-05 18:37:17 +0100 Luca Ognibene + + * gst/rtsp-server/rtsp-client.c: + client: call unlink_streams in client finalize + Fixes #599027 + +2010-03-05 18:23:18 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: limit the time to wait to something huge + Avoid waiting forever but limit the timeout to 20 seconds. + +2010-03-05 17:57:08 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-sdp.c: + sdp: reindent and check for prepared status + +2010-03-05 17:51:26 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-session.c: + media: avoid doing _get_state() for state changes + When preparing, use the ASYNC_DONE and ERROR messages in the bus handler to wait + until the media is prerolled or in error. This avoids doing a blocking call of + gst_element_get_state() that can cause lockups when there is an error. + Fixes #611899 + +2010-03-05 16:20:08 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: reindent + +2010-03-05 13:34:15 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + media-factory: better error handling + Improve the error handling a bit. + +2010-03-05 13:31:37 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: rework transport parsing + Rework the transport parsing code so that we can ignore transports we don't + support instead of just picking the first one we can parse. + Configure a (for now hardcoded) destination for multicast transports. + +2010-03-05 13:28:58 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: set multicast sink parameters + Disable loop and automatic multicast join on the udpsink elements. + Add some more debug info. + Reset some state variables in the right place. + Use the right port numbers for multicast. + +2010-03-05 13:27:18 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session.c: + session: handle transport setup correctly + Handle UDP, MCAST and TCP transport negotiation more correctly. + Store the server session SSRC in the transport. + +2010-01-27 18:38:27 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: implement error_full + Implement error_full to avoid some segfaults when the rtspconnection calls it. + See #608245 + +2009-12-25 18:24:10 +0100 Wim Taymans + + * docs/README: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-server.c: + docs: update docs and comments + +2009-12-25 15:22:23 +0100 Nikolay Ivanov + + * gst/rtsp-server/rtsp-sdp.c: + sdp: make server work better when behind a proxy + +2009-11-21 01:17:25 +0100 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-client.c: + client: dump rtsp message only if debug threshold is higher than GST_LEVEL_LOG + +2009-11-21 19:20:23 +0100 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-mapping.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session.c: + Use GStreamer's debugging subsystem + +2009-11-21 01:00:39 +0100 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-media-factory.c: + server: Set ghost pad active in gst_rtsp_media_factory_collect_streams + +2009-11-05 11:22:44 +0100 Wim Taymans + + * configure.ac: + back to development + +=== release 0.10.5 === + +2009-11-05 11:20:45 +0100 Wim Taymans + + * configure.ac: + release 0.10.5 + +2009-10-14 12:11:31 +0200 Wim Taymans + + * configure.ac: + configure: bump required versions + +2009-10-11 13:57:54 +0200 Luca Ognibene + + * gst/rtsp-server/rtsp-client.c: + client: call weak-unref on client->sessions from finalize + Fixes bug #596305 + +2009-10-09 23:08:18 +0200 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-media.c: + media: Fixed crasher where caps got unref'ed too often + +2009-10-09 16:26:30 +0200 Sebastian Pölsterl + + * configure.ac: + * pkgconfig/.gitignore: + * pkgconfig/Makefile.am: + * pkgconfig/gst-rtsp-server-uninstalled.pc.in: + Added pkg-config file to use gst-rtsp-server uninstalled + +2009-09-11 13:52:27 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: add some docs + +2009-08-24 13:27:00 +0200 Peter Kjellerstedt + + * gst/rtsp-server/rtsp-client.c: + rtsp: Use gst_rtsp_watch_send_message(). + Use gst_rtsp_watch_send_message() since the old API which used + gst_rtsp_watch_queue_message() has been deprecated. + +2009-08-05 11:53:56 +0200 Wim Taymans + + * configure.ac: + back to development + +=== release 0.10.4 === + +2009-08-05 11:44:49 +0200 Wim Taymans + + * configure.ac: + Release 0.10.4 + +2009-07-27 19:42:44 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + rtsp: allocate channels in TCP mode + When the client does not provide us with channels in TCP mode, allocate channels + ourselves. + +2009-07-24 12:49:41 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: don't crash when tunnelid is missing + When a clients tries to open an HTTP tunnel but fails to provide a tunnelid, + don't crash but return an error response to the client. + Fixes #589489 + +2009-07-13 11:31:23 +0200 Sebastian Pölsterl + + * bindings/vala/gst-rtsp-server-0.10.vapi: + * bindings/vala/packages/gst-rtsp-server-0.10.gi: + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + bindings: update vala bindings with new method + +2009-06-30 21:27:53 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + sessionpool: add function to filter sessions + Add generic function to retrieve/remove sessions. + +2009-06-22 18:57:25 +0100 Tim-Philipp Müller + + * configure.ac: + configure: bump core/base requirements to release + +2009-06-18 16:05:18 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: fix indentation + +2009-06-14 23:12:13 +0200 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-media.c: + Unref pipeline and set it to NULL. Set stream's caps to NULL, otherwise we unref it too often. + +2009-06-13 16:05:02 +0200 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-media.c: + set state and remove elements of media in for loop + +2009-06-13 14:38:39 +0200 Sebastian + + * bindings/vala/gst-rtsp-server-0.10.vapi: + * bindings/vala/packages/gst-rtsp-server-0.10.gi: + Added gst_rtsp_media_remove_elements function to Vala bindings + +2009-06-13 14:38:20 +0200 Sebastian + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + Added gst_rtsp_media_remove_elements function + +2009-06-12 22:22:40 +0200 Sebastian + + * gst/rtsp-server/rtsp-media.c: + Don't use name for gstrtpbin so we can add multiple instances to the pipeline + +2009-06-12 19:28:04 +0200 Sebastian Pölsterl + + * bindings/vala/gst-rtsp-server-0.10.vapi: + * bindings/vala/packages/gst-rtsp-server-0.10.gi: + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + Updated Vala bindings + +2009-06-12 18:05:30 +0200 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + Added vmethod unprepare to GstRTSPMedia + The default implementation sets the state of the pipeline to GST_STATE_NULL + +2009-06-12 17:51:44 +0200 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + Made collect_streams function public + +2009-06-12 17:45:29 +0200 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + Added vmethod create_pipeline to GstRTSPMediaFactory + The pipeline is created in this method and the GstRTSPMedia's element is added to it + +2009-06-11 11:27:47 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: use g_source_destroy() + We need to use g_source_destroy() because we might have added the source to a + different main context than the default one. + +2009-06-10 00:01:07 +0200 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-params.c: + * gst/rtsp-server/rtsp-params.h: + rtsp: prepare for handling GET/SET_PARAMETER + Add helper functions to handle GET/SET_PARAMETER. Reply with an error when there + is a body now. + Fix return codes of handlers. + +2009-06-04 19:20:26 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: don't leak session pads + +2009-06-04 18:32:15 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: clean up the messages a bit + +2009-06-03 12:13:21 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-sdp.c: + sdp: warn and skip streams without media + +2009-05-30 14:38:34 +0200 Sebastian Pölsterl + + * bindings/vala/gst-rtsp-server-0.10.vapi: + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + vala: Fixed typo in header file of RTSPMediaStream + +2009-05-27 11:15:22 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: fix message + Fix a debug message + Make dumping RTCP stats configurable + +2009-05-26 19:20:07 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: be less verbose and leak less + +2009-05-26 19:05:07 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: don't leak the destination address + +2009-05-26 19:01:10 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + rtsp: use RTCP to keep the session alive + Use the RTCP rtcp-from stats field to find the associated session and use this + to keep the session alive. + +2009-05-26 17:27:07 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-session.c: + session: add 5sec to the real session timeout + Allow the session to live 5sec longer before really timing out. This should give + clients some extra time to keep the session active. + +2009-05-26 17:25:59 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: replay OK to GET/SET_PARAMETER + Some clients (vlc) use GET/SET_PARAMETER to keep the TCP session open. Make it + so that we return OK for those requests. + +2009-05-26 11:42:41 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: keep track of active transports + Keep track of which transport is active to avoid closing the connection too + soon. + Remove the destination transport also when going to NULL. + Print some stats about the SDES and other RTCP messages we receive from the + clients. + +2009-05-24 20:00:19 +0200 Wim Taymans + + * examples/.gitignore: + * examples/Makefile.am: + * examples/test-sdp.c: + example: add SDP relay example + +2009-05-24 19:56:45 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: also count active TCP connections + +2009-05-24 19:34:52 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + rtsp: add support for dynamic elements + Add support for dynamic elements. + Don't set live pipelines back to paused. + +2009-05-24 19:33:22 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-sdp.c: + sdp: don't add encoding name when absent in caps + +2009-05-23 16:30:55 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: warn when we can't do RTP-Info + +2009-05-23 16:18:04 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + factory: factor out the stream construction + +2009-05-23 16:17:02 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: only add RTP-Info when we have the info + Only add RTP-Info for a stream when we can get the seqnum and timestamp from the + depayloader. + +2009-05-17 14:04:31 +0200 Wim Taymans + + * configure.ac: + back to development + +=== release 0.10.3 === + +2009-05-17 13:59:10 +0200 Wim Taymans + + * configure.ac: + release: 0.10.3 + - Fixes a bug where it put the wrong verion in pkgconfig + - Link RTP and RTCP sources + +2009-05-15 17:58:44 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: link the RTP udpsrc to the session manager + Link the RTP udpsrc and the appsrc to the session manager so that they don't + shut down when the client sends a packet to open firewalls. + +2009-05-15 17:10:44 +0200 Sebastian Pölsterl + + * pkgconfig/gst-rtsp-server.pc.in: + Don't use hard-coded version number in pkg-config file + +2009-05-11 10:51:47 +0200 Wim Taymans + + * configure.ac: + back to development + +=== release 0.10.2 === + +2009-05-11 10:50:31 +0200 Wim Taymans + + * configure.ac: + release 0.10.2 + +2009-05-11 10:38:44 +0200 Wim Taymans + + * .gitignore: + * common/m4/.gitignore: + * examples/.gitignore: + * pkgconfig/.gitignore: + add some .gitignore files + +2009-04-29 17:24:46 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: seek to key frames + +2009-04-21 22:44:05 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + media: emit the unprepared signal by id + Emit the unprepared signal by id instead of name and set the media as + reused. + +2009-04-21 22:23:54 +0200 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-media.c: + Set pipeline's state to NULL no matter if the media is reusable and emit unprepared signal in gst_rtsp_media_unprepare + +2009-04-18 16:10:59 +0200 Sebastian Pölsterl + + * gst/rtsp-server/rtsp-server.c: + Added finalize function to GstRTPSPServer to unref session pool and media mapping + +2009-04-17 21:13:07 +0200 Sebastian Pölsterl + + * bindings/vala/gst-rtsp-server-0.10.vapi: + * bindings/vala/packages/gst-rtsp-server-0.10.gi: + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + Updated vala bindings + +2009-04-14 23:38:58 +0200 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + server: use appsink and appsrc with the API + Use the appsink/appsrc API instead of the signals for higher + performance. + +2009-04-14 23:38:15 +0200 Wim Taymans + + * examples/test-ogg.c: + tests: set the payload type correctly + +2009-04-03 22:46:22 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + factory: connect to the unprepare signal + Connect to the unprepare signal for non-reusable media so that we can remove + them from the cache. + +2009-04-03 22:45:57 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: add signal to notify of unprepare + +2009-04-03 22:22:30 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + media: more work on making the media shared + Add a reusable flag to medias, indicating that they can be reused after a state + change to NULL. + Small cleanups. + +2009-04-03 19:47:38 +0200 Wim Taymans + + * examples/test-readme.c: + examples: mark the example as shared for testing + +2009-04-03 19:44:37 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + client: support shared media + Always perform the state actions even if the target state of the pipeline is + already correct, we still want to add/remove the transports when we are dealing + with shared media. + Keep a counter of the number of active transports for a media so that we can use + this to perform a state change when needed. + Perform a state change of the pipeline only when the first transport was added + or when there are no active transports. + +2009-04-03 09:03:59 +0200 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + client: fix refcounting crasher + Don't need to remove the weak refs in the finalize methods, they are already + removed in the dispose. + Don't register the callback with a DestroyNofity. + +2009-04-01 01:01:46 +0100 Tim-Philipp Müller + + * gst/rtsp-server/rtsp-client.c: + Fix rtsp client refcount management in TCP mode. + Don't unref a client ref we never had. Fixes an unref + of an already-free client object after a client + teardown request for me. + +2009-04-01 00:45:17 +0100 Tim-Philipp Müller + + * gst/rtsp-server/rtsp-session.c: + docs: fix typo in API docs + +2009-03-13 15:57:42 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + More seeking fixes. + Keep the udp sources in playing even if we go to paused. unlock the sources when + we shut down. + Add some more debug info. + Only seek when we need to. + Keep track of the position when we go to paused. + +2009-03-12 20:32:14 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + Add beginnings of seeking. + Parse the Range header and perform a seek on the pipeline for the requested + position. It's disabled currently until I figure out what's going wrong. + +2009-03-12 20:31:22 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + allow pause requests for now. + -- + +2009-03-11 20:03:06 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + Remove weak ref on the session in teardown + We need to remove our weakref from the session when we do a teardown because + else we close the TCP connection prematurely. + +2009-03-11 19:38:06 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-session-pool.c: + Do some more session cleanup + Make session timeout kill the TCP connection that currently watches the + session. + Remove the client timeout property. + +2009-03-11 16:45:12 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + Add TCP transports + Use appsrc and appsink to send and receive RTP/RTCP packets in the TCP + connection. + +2009-03-11 16:39:20 +0100 Wim Taymans + + * examples/Makefile.am: + * examples/test-launch.c: + Add example server that takes launch lines + Add an example server that streams any -launch line. + +2009-03-06 19:34:14 +0100 Wim Taymans + + * examples/test-readme.c: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + Add support for live streams + Add support for live streams and ranges + Start on handling TCP data transfer. + +2009-03-04 16:33:59 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + Free the pipeline before other things + --- + +2009-03-04 16:33:21 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + Only free the pending tunnel if there is one + -- + +2009-03-04 12:44:01 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media.c: + rtsp-server: Add support for tunneling + Add support for tunneling over HTTP. + Use new connection methods to retrieve the url. + Dispatch messages based on the message type instead of blindly + assuming it's always a request. + Keep track of the watch id so that we can remove it later. + Set the media pipeline to NULL before unreffing the pipeline. + +2009-02-19 15:53:50 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + Fix for channel -> watch rename in gstreamer + Rename the RTSPChannel to RTSPWatch and remove an unused variable. + +2009-02-18 18:57:31 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + Use ASYNC RTSP io + Use the async RTSP channels instead of spawning a new thread for each client. + If a sessionid is specified in a request, fail if we don't have the session. + +2009-02-18 17:49:03 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + Add better debug info + Add some better debug info. + +2009-02-13 20:00:34 +0100 Wim Taymans + + * examples/test-video.c: + Time out sessions + Add support for session timeouts in the example. + +2009-02-13 19:58:17 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + Pass GTimeVal around for performance reasons + Get the current time only once and pass it around so that sessions don't have to + get the current time anymore. + Add experimental support for a GSource that dispatches when the session needs to + be cleaned up. + +2009-02-13 19:56:01 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + Add better support for session timeouts + Add a method to request the number of milliseconds when a session will timeout. + +2009-02-13 19:54:18 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + Add suport for RTP manager monitoring + Add the first stage in monitoring the rtp manager. + Make sure we don't update the state to something we don't want. + +2009-02-13 19:52:05 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + Add support for session keepalive + Get and update the session timeout for all requests. get the session as early as + possible. + +2009-02-13 16:39:36 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + Handle media bus messages + Handle media bus messages in a custom mainloop and dispatch them to the + RTSPMedia objects. Let the default implementation handle some common messages. + +2009-02-13 12:57:45 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session.c: + Some more session timeout handling + Move the session header setting code to a central place so that we always add + the timeout parameter too. + Handle timeouts by running the session cleanup code. + Stop media before cleaning up. + +2009-02-10 16:24:13 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + Add timeout property + Add a timeout property ot the client and make the other properties into GObject + properties. + +2009-02-10 16:21:17 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session-pool.c: + Use getters and setters in property code + Use the getters and setters for the timeout property instead of locking + ourselves. + +2009-02-04 20:13:32 +0100 Wim Taymans + + Merge branch 'master' of git+ssh://git.collabora.co.uk/git/gst-rtsp-server + +2009-02-04 20:10:39 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + Add more timeout stuff + Add method to check if a session is expired. + Add method to perform cleanup on a session pool. + +2009-02-04 19:52:50 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + Add beginnings of session timeouts and limits + Add the timeout value to the Session header for unusual timeout values. + Allow us to configure a limit to the amount of active sessions in a pool. Set a + limit on the amount of retry we do after a sessionid collision. + Add properties to the sessionid and the timeout of a session. Keep track of + creation time and last access time for sessions. + +2009-02-04 17:00:42 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + Cleanup of sessions and more + Fix the refcounting of media and sessions in the client. Properly clean up the + session data when the client performs a teardown. + Add Server header to responses. + Allow for multiple uri setups in one session. + Add Range header to the PLAY response and add the range attribute to the SDP + message. + Fix the session pool remove method, it used the wrong key in the hashtable. Also + give the ownership of the sessionid to the session object. + +2009-02-04 09:57:55 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + Rename a variable + Rename the 'server_port' variable to simply 'port'. + +2009-02-03 19:32:38 +0100 Wim Taymans + + * configure.ac: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + Rework the way we handle transports for streams + Make the media accept an array of transports for the streams that we have + configured for the play/pause requests. + Implement server states for a client and its media. + Require 0.10.22.1 (git HEAD) of gstreamer. + +2009-01-31 19:50:33 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory.c: + Drop const from functions dealing with urls + Drop const from GstRTSPUrl stuff because the .h files in gst-plugins-base don't + have the right const in them. + +2009-01-30 17:06:26 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-sdp.c: + Fix various leaks + Fix some leaks. + +2009-01-30 16:24:10 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + More cleanups + Don't keep a reference to the GstRTSPMedia in the stream. + Free more things when freeing the GstRTSPMedia. + +2009-01-30 14:53:28 +0100 Wim Taymans + + * docs/README: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + More docs and small cleanups + Add some more docs and update the README + Cleanup some method names. + Remove an unneeded idx field in the GstRTSPMediaStream + +2009-01-30 13:24:04 +0100 Wim Taymans + + * docs/README: + * examples/Makefile.am: + * examples/test-readme.c: + Add a README and more example code + Add a README file that contains a small introduction on how to use the server + along with the example code explained in the readme. + +2009-01-30 11:06:31 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-server.c: + Fix some leaks and change default port + Fix some memory leaks by setting the udpsrc elements to the unlocked state after + we finished the initial preroll. If we keep them locked, setting the pipeline to + NULL will not stop and clean up the sources correctly. + Change the default RTSP port to 8554 aka the official alternative RTSP port. + +2009-01-29 18:55:22 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + Cleanups to the session object + Remove some unneeded variables in the session state of a stream such as the + owner media and the server transport. + Get the configuration of a media stream in a session based on the media_stream + in the original object instead of our cached index. + Free more data in the finalize method. + +2009-01-29 18:51:02 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + Cleanups and reuse media from DESCRIBE + Handle thread create errors. + Rename some internal methods to better match what they actually do. + Handle misconfiguration of session_pool and media_mapping gracefully. + Cache the DESCRIBE media and uri in the client connection and reuse them when + we receive a SETUP request in the same connection for the same uri. + Cleanup the client connection object. + +2009-01-29 17:20:27 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + Add shared properties to media and factory + Add the shared property to media. + Implement some simple caching in the factory depending on if the media is shared + or not. + +2009-01-29 17:19:21 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + Add a little comment + Add some comment about the content-base header. + +2009-01-29 13:31:27 +0100 Wim Taymans + + * examples/Makefile.am: + * examples/main.c: + * examples/test-mp4.c: + * examples/test-ogg.c: + * examples/test-video.c: + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-sdp.c: + * gst/rtsp-server/rtsp-sdp.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + Reorganize things, prepare for media sharing + Added various other test server examples + Move the SDP message generation to a separate helper. + Refactor common code for finding the session. + Add content-base for realplayer compatibility + Clean up request uris before processing for better vlc compatibility. + Move prerolling and pipeline construction to the RTSPMedia object. + Use multiudpsink for future pipeline reuse. + +2009-01-30 11:23:57 +0100 Wim Taymans + + * configure.ac: + Back to development + Back to 0.10.1.1 + +=== release 0.10.1 === + +2009-01-30 11:20:18 +0100 Wim Taymans + + * configure.ac: + Make 0.10.1 release + Release 0.10.1 + +2009-01-29 15:19:01 +0100 Wim Taymans + + * bindings/vala/Makefile.am: + Fix make dist + Add more directories and files to the dist. + +2009-01-24 14:34:35 +0100 Sebastian Pölsterl + + * bindings/python/Makefile.am: + * bindings/python/rtspserver.override: + Fixed compile error of python bindings + +2009-01-23 21:03:53 +0100 Sebastian Pölsterl + + * bindings/vala/gst-rtsp-server-0.10.vapi: + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + Marked values as nullable accordingly + +2009-01-23 20:31:11 +0100 Sebastian Pölsterl + + * bindings/vala/gst-rtsp-server-0.10.vapi: + * bindings/vala/packages/gst-rtsp-server-0.10.excludes: + * bindings/vala/packages/gst-rtsp-server-0.10.gi: + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + Updated Vala bindings + +2009-01-22 18:35:17 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-mapping.c: + * gst/rtsp-server/rtsp-media-mapping.h: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-session-pool.h: + Cleanups and doc updates + Add some more documentation and do some minor cleanups here and there. + +2009-01-22 17:58:19 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + More improvements + Rename GstRTSPMediaBin to GstRTSPMedia + Parse the request url into a GstRTSPUri object and pass this object to the + various handlers and methods that require the uri. + +2009-01-22 16:54:07 +0100 Wim Taymans + + * examples/main.c: + Update example + Add some more docs and remove some old code from the example. + +2009-01-22 16:53:16 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + Handle state change failures better + Handle state change failures better when changing the state of the pipeline to + determine the SDP. + +2009-01-22 16:51:08 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + Make element creation more extendible + Add get_element vmethod to the default MediaFactory so that subclasses can just + override that method and still use the default logic for making a MediaBin from + that. + +2009-01-22 15:33:29 +0100 Wim Taymans + + * examples/main.c: + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + * gst/rtsp-server/rtsp-media-mapping.c: + * gst/rtsp-server/rtsp-media-mapping.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + Make the server handle arbitrary pipelines + Make GstMediaFactory an object that can instantiate GstMediaBin objects. + The GstMediaBin object has a handle to a bin with elements and to a list of + GstMediaStream objects that this bin produces. + Add GstMediaMapper that can map url mountpoints to GstMediaFactory objects along + with methods to register and remove those mappings. + Add methods and a property to GstRTSPServer to manage the GstMediaMapper object + used by the server instance. + Modify the example application so that it shows how to create custom pipelines + attached to a specific mount point. + Various misc cleanps. + +2009-01-20 19:47:07 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + Allow setting a custom media factory for a server + +2009-01-20 19:46:21 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + Allow setting a custom media factory for a client. + +2009-01-20 19:45:28 +0100 Wim Taymans + + * gst/rtsp-server/Makefile.am: + Add Makefile entry for the media factory + +2009-01-20 19:44:45 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media-factory.c: + * gst/rtsp-server/rtsp-media-factory.h: + Add media factory to map urls to media pipeline objects. + +2009-01-20 19:43:47 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + Add comments. Remove unused field + +2009-01-20 19:41:53 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + Allow custom session pools to override the session id allocation algorithms Add some comments. + +2009-01-20 19:40:42 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session.h: + Add some comments. + +2009-01-20 13:57:47 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + Move the connection code in one place Add some comments + +2009-01-20 13:19:36 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + Make vmethod to create and accept new clients. Add some docs. + +2009-01-19 19:36:23 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + Make more properties configurable in the server. Expose the GIOChannel and GSource better to allow for more customisations. + +2009-01-19 19:34:29 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + Name the parameters more appropriately. + +2009-01-19 19:32:28 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-session-pool.c: + Do some more cleanup of the session pool. + +2009-01-08 16:28:24 +0100 Wim Taymans + + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-client.c: + Check if return value of gst_rtsp_session_get_media is not NULL + +2009-01-08 15:02:42 +0100 Wim Taymans + + * gst/rtsp-server/Makefile.am: + Install rtsp-session and rtsp-session-pool headers + +2009-01-08 14:57:55 +0100 Wim Taymans + + * .gitignore: + * Makefile.am: + * acinclude.m4: + * bindings/python/Makefile.am: + * bindings/python/arg-types.py: + * bindings/python/codegen/Makefile.am: + * bindings/python/codegen/__init__.py: + * bindings/python/codegen/argtypes.py: + * bindings/python/codegen/code-coverage.py: + * bindings/python/codegen/codegen.py: + * bindings/python/codegen/definitions.py: + * bindings/python/codegen/defsparser.py: + * bindings/python/codegen/docextract.py: + * bindings/python/codegen/docgen.py: + * bindings/python/codegen/fileprefix.override: + * bindings/python/codegen/fileprefixmodule.c: + * bindings/python/codegen/h2def.py: + * bindings/python/codegen/mergedefs.py: + * bindings/python/codegen/mkskel.py: + * bindings/python/codegen/override.py: + * bindings/python/codegen/reversewrapper.py: + * bindings/python/codegen/scmexpr.py: + * bindings/python/rtspserver-types.defs: + * bindings/python/rtspserver.defs: + * bindings/python/rtspserver.override: + * bindings/python/rtspservermodule.c: + * configure.ac: + Add python bindings. + +2009-01-08 14:53:47 +0100 Wim Taymans + + * bindings/Makefile.am: + * configure.ac: + Don't go into python dir when requirements for python bindings are missing + +2009-01-08 14:49:57 +0100 Wim Taymans + + * bindings/Makefile.am: + * bindings/vala/Makefile.am: + * configure.ac: + Install Vala bindings if vala is available + +2008-12-12 16:22:02 +0100 Sebastian Pölsterl + + * bindings/vala/gst-rtsp-server-0.10.deps: + * bindings/vala/gst-rtsp-server-0.10.vapi: + * bindings/vala/gst-rtsp-server.vapi: + * bindings/vala/packages/gst-rtsp-server-0.10.deps: + * bindings/vala/packages/gst-rtsp-server-0.10.excludes: + * bindings/vala/packages/gst-rtsp-server-0.10.files: + * bindings/vala/packages/gst-rtsp-server-0.10.gi: + * bindings/vala/packages/gst-rtsp-server-0.10.metadata: + * bindings/vala/packages/gst-rtsp-server-0.10.namespace: + * bindings/vala/packages/gst-rtsp-server.deps: + * bindings/vala/packages/gst-rtsp-server.excludes: + * bindings/vala/packages/gst-rtsp-server.files: + * bindings/vala/packages/gst-rtsp-server.gi: + * bindings/vala/packages/gst-rtsp-server.metadata: + * bindings/vala/packages/gst-rtsp-server.namespace: + Regenerated Vala bindings + +2008-12-08 13:19:40 +0100 Sebastian Pölsterl + + * bindings/vala/gst-rtsp-server.vapi: + * bindings/vala/packages/gst-rtsp-server.metadata: + Fixed typo in included headers for vala bindings + +2009-01-08 14:42:10 +0100 Wim Taymans + + * Makefile.am: + * configure.ac: + * pkgconfig/Makefile.am: + * pkgconfig/gst-rtsp-server.pc.in: + Added pkgconfig file + +2008-11-30 23:57:26 +0100 Sebastian Pölsterl + + * bindings/vala/gst-rtsp-server.vapi: + * bindings/vala/packages/gst-rtsp-server.excludes: + * bindings/vala/packages/gst-rtsp-server.gi: + * bindings/vala/packages/gst-rtsp-server.metadata: + Adjusted included headersfor Vala bindings. Ignore rtsp-url-compat.h + +2008-11-30 23:41:20 +0100 Sebastian Pölsterl + + * bindings/vala/gst-rtsp-server.vapi: + * bindings/vala/packages/gst-rtsp-server.deps: + * bindings/vala/packages/gst-rtsp-server.files: + * bindings/vala/packages/gst-rtsp-server.gi: + * bindings/vala/packages/gst-rtsp-server.metadata: + * bindings/vala/packages/gst-rtsp-server.namespace: + Added Vala bindings + +2008-10-25 23:36:16 +0200 Alessandro Decina + + * gst/rtsp-server/rtsp-session.c: + Change an obviously wrong return FALSE to return NULL; (cherry picked from commit 56d4fb48030db3ae45f3f0e60b29b36f3134322b) + +2008-11-13 19:43:10 +0100 Sebastian Pölsterl + + * examples/Makefile.am: + * gst/rtsp-server/Makefile.am: + Put GStreamer version in library name + +2009-01-08 13:51:26 +0100 Wim Taymans + + * examples/Makefile.am: + * gst/rtsp-server/Makefile.am: + Fix some issues to pass distcheck + +2009-01-08 13:41:33 +0100 Wim Taymans + + * gst/rtsp-server/rtsp-server.c: + Added port property to GstRTSPServer class. + +2009-01-08 13:18:55 +0100 Wim Taymans + + * Makefile.am: + * autogen.sh: + * configure.ac: + * examples/Makefile.am: + * examples/main.c: + * gst/Makefile.am: + * gst/rtsp-server/Makefile.am: + * gst/rtsp-server/rtsp-client.c: + * gst/rtsp-server/rtsp-client.h: + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-media.h: + * gst/rtsp-server/rtsp-server.c: + * gst/rtsp-server/rtsp-server.h: + * gst/rtsp-server/rtsp-session-pool.c: + * gst/rtsp-server/rtsp-session-pool.h: + * gst/rtsp-server/rtsp-session.c: + * gst/rtsp-server/rtsp-session.h: + * src/Makefile.am: + * src/main.c: + * src/rtsp-client.c: + * src/rtsp-client.h: + * src/rtsp-media.c: + * src/rtsp-media.h: + * src/rtsp-server.c: + * src/rtsp-server.h: + * src/rtsp-session-pool.c: + * src/rtsp-session-pool.h: + * src/rtsp-session.c: + * src/rtsp-session.h: + Split in library and example program + +2008-11-10 20:59:35 +0100 Sebastian Pölsterl + + * src/rtsp-client.h: + Removed obsolete variable + +2008-11-10 21:03:15 +0100 Sebastian Pölsterl + + * src/rtsp-client.c: + * src/rtsp-client.h: + Removed pipeline variable GstRTSPClient, because it's only used in one function + +2009-01-08 11:22:58 +0100 Wim Taymans + + * src/rtsp-media.c: + Set the payload types for the different payloaders. Maybe this shoulde be done automatically instead. + +2008-10-23 12:23:27 +0200 Wim Taymans + + * src/rtsp-session.c: + Initialize some more vars. + +2008-10-23 12:14:55 +0200 Wim Taymans + + * src/rtsp-session.c: + Initialize variable to avoid compiler warning. + +2008-10-09 13:30:47 +0100 Simon McVittie + + * .gitignore: + Add a reasonable generic .gitignore + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..2099840 --- /dev/null +++ b/INSTALL @@ -0,0 +1,370 @@ +Installation Instructions +************************* + +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, +Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command `./configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf limitation. Until the limitation is lifted, you can use +this workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8add30a --- /dev/null +++ b/LICENSE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/LICENSE.LGPLv2.1 b/LICENSE.LGPLv2.1 new file mode 100644 index 0000000..8add30a --- /dev/null +++ b/LICENSE.LGPLv2.1 @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..2272985 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,80 @@ +DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc + +SUBDIRS = \ + gst \ + common \ + pkgconfig \ + docs \ + examples \ + tests + +DIST_SUBDIRS = $(SUBDIRS) + +EXTRA_DIST = \ + ChangeLog autogen.sh depcomp \ + AUTHORS COPYING NEWS README RELEASE REQUIREMENTS \ + gst-rtsp-server.spec docs/design/gst-rtp-server-design \ + gst-rtsp-server.doap + +ACLOCAL_AMFLAGS = -I m4 -I common/m4 + +DISTCLEANFILES = _stdint.h gst-rtsp-server.spec + +include $(top_srcdir)/common/release.mak +include $(top_srcdir)/common/po.mak + +include $(top_srcdir)/common/coverage/lcov.mak + +check-valgrind: + cd tests/check && make check-valgrind + +if HAVE_CHECK +check-torture: + cd tests/check && make torture +else +check-torture: + true +endif + +# cruft: plugins that have been merged or moved or renamed +CRUFT_FILES = \ + $(top_builddir)/common/shave \ + $(top_builddir)/common/shave-libtool \ + $(top_builddir)/common/m4/codeset.m4 \ + $(top_builddir)/common/m4/gettext.m4 \ + $(top_builddir)/common/m4/glibc2.m4 \ + $(top_builddir)/common/m4/glibc21.m4 \ + $(top_builddir)/common/m4/iconv.m4 \ + $(top_builddir)/common/m4/intdiv0.m4 \ + $(top_builddir)/common/m4/intl.m4 \ + $(top_builddir)/common/m4/intldir.m4 \ + $(top_builddir)/common/m4/intlmacosx.m4 \ + $(top_builddir)/common/m4/intmax.m4 \ + $(top_builddir)/common/m4/inttypes-pri.m4 \ + $(top_builddir)/common/m4/inttypes_h.m4 \ + $(top_builddir)/common/m4/lcmessage.m4 \ + $(top_builddir)/common/m4/lib-ld.m4 \ + $(top_builddir)/common/m4/lib-link.m4 \ + $(top_builddir)/common/m4/lib-prefix.m4 \ + $(top_builddir)/common/m4/libtool.m4 \ + $(top_builddir)/common/m4/lock.m4 \ + $(top_builddir)/common/m4/longlong.m4 \ + $(top_builddir)/common/m4/ltoptions.m4 \ + $(top_builddir)/common/m4/ltsugar.m4 \ + $(top_builddir)/common/m4/ltversion.m4 \ + $(top_builddir)/common/m4/lt~obsolete.m4 \ + $(top_builddir)/common/m4/nls.m4 \ + $(top_builddir)/common/m4/po.m4 \ + $(top_builddir)/common/m4/printf-posix.m4 \ + $(top_builddir)/common/m4/progtest.m4 \ + $(top_builddir)/common/m4/size_max.m4 \ + $(top_builddir)/common/m4/stdint_h.m4 \ + $(top_builddir)/common/m4/uintmax_t.m4 \ + $(top_builddir)/common/m4/visibility.m4 \ + $(top_builddir)/common/m4/wchar_t.m4 \ + $(top_builddir)/common/m4/wint_t.m4 \ + $(top_builddir)/common/m4/xsize.m4 + +include $(top_srcdir)/common/cruft.mak + +all-local: check-cruft diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..901f570 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,1139 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ + +# include this snippet to add a common release: target by using +# include $(top_srcdir)/common/release.mak + +# checks for left-over files in the (usually uninstalled) tree, ie. for +# stuff that best be deleted to avoid problems like having old plugin binaries +# lying around. +# +# set CRUFT_FILES and/or CRUFT_DIRS in your Makefile.am when you include this +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = $(top_srcdir)/common/release.mak \ + $(top_srcdir)/common/po.mak \ + $(top_srcdir)/common/coverage/lcov.mak \ + $(top_srcdir)/common/cruft.mak INSTALL NEWS README AUTHORS \ + ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in $(srcdir)/gst-rtsp.spec.in COPYING \ + COPYING.LIB TODO compile config.guess config.sub install-sh \ + missing ltmain.sh +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-docbook.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-doc.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/introspection.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = gst-rtsp.spec +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.xz +DIST_TARGETS = dist-xz +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = -I m4 -I common/m4 +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAT_ENTRY_END = @CAT_ENTRY_END@ +CAT_ENTRY_START = @CAT_ENTRY_START@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPD_PLUGINS_DIR = @GSTPD_PLUGINS_DIR@ +GSTPG_PLUGINS_DIR = @GSTPG_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALL_CFLAGS = @GST_ALL_CFLAGS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_ALL_LIBS = @GST_ALL_LIBS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OBJ_CFLAGS = @GST_OBJ_CFLAGS@ +GST_OBJ_LIBS = @GST_OBJ_LIBS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PKG_CONFIG_PATH = @GST_PKG_CONFIG_PATH@ +GST_PLUGINS_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@ +GST_PLUGINS_BAD_DIR = @GST_PLUGINS_BAD_DIR@ +GST_PLUGINS_BAD_LIBS = @GST_PLUGINS_BAD_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@ +GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@ +GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ +HAVE_DVIPS = @HAVE_DVIPS@ +HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ +HAVE_JADETEX = @HAVE_JADETEX@ +HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ +HAVE_PNMTOPS = @HAVE_PNMTOPS@ +HAVE_PS2PDF = @HAVE_PS2PDF@ +HAVE_XMLLINT = @HAVE_XMLLINT@ +HAVE_XSLTPROC = @HAVE_XSLTPROC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCGROUP_CFLAGS = @LIBCGROUP_CFLAGS@ +LIBCGROUP_LIBS = @LIBCGROUP_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XML_CATALOG = @XML_CATALOG@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc +SUBDIRS = \ + gst \ + common \ + pkgconfig \ + docs \ + examples \ + tests + +DIST_SUBDIRS = $(SUBDIRS) +EXTRA_DIST = \ + ChangeLog autogen.sh depcomp \ + AUTHORS COPYING NEWS README RELEASE REQUIREMENTS \ + gst-rtsp.spec docs/design/gst-rtp-server-design \ + gst-rtsp-server.doap + +DISTCLEANFILES = _stdint.h gst-rtsp.spec + +# cruft: plugins that have been merged or moved or renamed +CRUFT_FILES = \ + $(top_builddir)/common/shave \ + $(top_builddir)/common/shave-libtool \ + $(top_builddir)/common/m4/codeset.m4 \ + $(top_builddir)/common/m4/gettext.m4 \ + $(top_builddir)/common/m4/glibc2.m4 \ + $(top_builddir)/common/m4/glibc21.m4 \ + $(top_builddir)/common/m4/iconv.m4 \ + $(top_builddir)/common/m4/intdiv0.m4 \ + $(top_builddir)/common/m4/intl.m4 \ + $(top_builddir)/common/m4/intldir.m4 \ + $(top_builddir)/common/m4/intlmacosx.m4 \ + $(top_builddir)/common/m4/intmax.m4 \ + $(top_builddir)/common/m4/inttypes-pri.m4 \ + $(top_builddir)/common/m4/inttypes_h.m4 \ + $(top_builddir)/common/m4/lcmessage.m4 \ + $(top_builddir)/common/m4/lib-ld.m4 \ + $(top_builddir)/common/m4/lib-link.m4 \ + $(top_builddir)/common/m4/lib-prefix.m4 \ + $(top_builddir)/common/m4/libtool.m4 \ + $(top_builddir)/common/m4/lock.m4 \ + $(top_builddir)/common/m4/longlong.m4 \ + $(top_builddir)/common/m4/ltoptions.m4 \ + $(top_builddir)/common/m4/ltsugar.m4 \ + $(top_builddir)/common/m4/ltversion.m4 \ + $(top_builddir)/common/m4/lt~obsolete.m4 \ + $(top_builddir)/common/m4/nls.m4 \ + $(top_builddir)/common/m4/po.m4 \ + $(top_builddir)/common/m4/printf-posix.m4 \ + $(top_builddir)/common/m4/progtest.m4 \ + $(top_builddir)/common/m4/size_max.m4 \ + $(top_builddir)/common/m4/stdint_h.m4 \ + $(top_builddir)/common/m4/uintmax_t.m4 \ + $(top_builddir)/common/m4/visibility.m4 \ + $(top_builddir)/common/m4/wchar_t.m4 \ + $(top_builddir)/common/m4/wint_t.m4 \ + $(top_builddir)/common/m4/xsize.m4 + +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/common/release.mak $(top_srcdir)/common/po.mak $(top_srcdir)/common/coverage/lcov.mak $(top_srcdir)/common/cruft.mak $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.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_srcdir)/common/release.mak $(top_srcdir)/common/po.mak $(top_srcdir)/common/coverage/lcov.mak $(top_srcdir)/common/cruft.mak: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +gst-rtsp.spec: $(top_builddir)/config.status $(srcdir)/gst-rtsp.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt + +# 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. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + 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 || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (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 \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h all-local +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +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 $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -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: + +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + + +release: dist + @$(MAKE) $(PACKAGE)-$(VERSION).tar.xz.sha256sum + @echo + @echo "=================================================================================================" + @echo "http://gstreamer.freedesktop.org/src/$(PACKAGE)/$(PACKAGE)-$(VERSION).tar.xz" + @cat $(PACKAGE)-$(VERSION).tar.xz.sha256sum + @echo "=================================================================================================" + @if [ -d ~/releases/ ]; then \ + cp -v $(PACKAGE)-$(VERSION).tar.xz ~/releases/; \ + fi + @if [ -d ../www/data/src ]; then \ + mv -v $(PACKAGE)-$(VERSION).tar.xz ../www/data/src/$(PACKAGE)/ ; \ + mv -v $(PACKAGE)-$(VERSION).tar.xz.sha256sum ../www/data/src/$(PACKAGE)/ ; \ + fi + @echo "=================================================================================================" + +# generate sha256 sum files +%.sha256sum: % + @sha256sum $< > $@ + +# check that no marshal or enumtypes files are included +# this in turn ensures that distcheck fails for missing .list files which is currently +# shadowed when the corresponding .c and .h files are included. +distcheck-hook: + @test "x" = "x`find $(distdir) -name \*-enumtypes.[ch] | grep -v win32`" && \ + test "x" = "x`find $(distdir) -name \*-marshal.[ch]`" || \ + ( echo "*** Leftover enumtypes or marshal files in the tarball." && \ + echo "*** Make sure the following files are not disted:" && \ + find $(distdir) -name \*-enumtypes.[ch] | grep -v win32 && \ + find $(distdir) -name \*-marshal.[ch] && \ + false ) + +# rule to download the latest .po files +download-po: $(top_srcdir)/common/download-translations + $(top_srcdir)/common/download-translations $(PACKAGE) +.PHONY: lcov-reset lcov lcov-run lcov-report lcov-upload lcov-clean + +# run lcov from scratch, always +lcov-reset: + $(MAKE) lcov-run + $(MAKE) lcov-report + +# run lcov from scratch if the dir is not there +lcov: + $(MAKE) lcov-reset + +# reset lcov stats +@GST_GCOV_ENABLED_TRUE@lcov-clean: +@GST_GCOV_ENABLED_TRUE@ @-rm -rf lcov +@GST_GCOV_ENABLED_TRUE@ lcov --directory . --zerocounters + +# reset run coverage tests +@GST_GCOV_ENABLED_TRUE@lcov-run: +@GST_GCOV_ENABLED_TRUE@ -$(MAKE) lcov-clean +@GST_GCOV_ENABLED_TRUE@ -if test -d tests/check; then $(MAKE) -C tests/check inspect; fi +@GST_GCOV_ENABLED_TRUE@ -$(MAKE) check + +# generate report based on current coverage data +@GST_GCOV_ENABLED_TRUE@lcov-report: +@GST_GCOV_ENABLED_TRUE@ mkdir lcov +@GST_GCOV_ENABLED_TRUE@ lcov --compat-libtool --directory . --capture --output-file lcov/lcov.info +@GST_GCOV_ENABLED_TRUE@ lcov --list-full-path -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d\| -f1 > lcov/remove +@GST_GCOV_ENABLED_TRUE@ lcov --list-full-path -l lcov/lcov.info | grep "tests/check/" | cut -d\| -f1 >> lcov/remove +@GST_GCOV_ENABLED_TRUE@ lcov --list-full-path -l lcov/lcov.info | grep "docs/plugins/" | cut -d\| -f1 >> lcov/remove +@GST_GCOV_ENABLED_TRUE@ lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info +@GST_GCOV_ENABLED_TRUE@ rm lcov/remove +@GST_GCOV_ENABLED_TRUE@ mv lcov/lcov.cleaned.info lcov/lcov.info +@GST_GCOV_ENABLED_TRUE@ genhtml -t "$(PACKAGE_STRING)" -o lcov --num-spaces 2 lcov/lcov.info + +@GST_GCOV_ENABLED_TRUE@lcov-upload: lcov +@GST_GCOV_ENABLED_TRUE@ rsync -rvz -e ssh --delete lcov/* gstreamer.freedesktop.org:/srv/gstreamer.freedesktop.org/www/data/coverage/lcov/$(PACKAGE) + +@GST_GCOV_ENABLED_FALSE@lcov-run: +@GST_GCOV_ENABLED_FALSE@ echo "Need to reconfigure with --enable-gcov" + +@GST_GCOV_ENABLED_FALSE@lcov-report: +@GST_GCOV_ENABLED_FALSE@ echo "Need to reconfigure with --enable-gcov" + +check-valgrind: + cd tests/check && make check-valgrind + +@HAVE_CHECK_TRUE@check-torture: +@HAVE_CHECK_TRUE@ cd tests/check && make torture +@HAVE_CHECK_FALSE@check-torture: +@HAVE_CHECK_FALSE@ true + +check-cruft: + @cruft_files=""; cruft_dirs=""; \ + for f in $(CRUFT_FILES); do \ + if test -e $$f; then \ + cruft_files="$$cruft_files $$f"; \ + fi \ + done; \ + for d in $(CRUFT_DIRS); do \ + if test -e $$d; then \ + cruft_dirs="$$cruft_dirs $$d"; \ + fi \ + done; \ + if test "x$$cruft_files$$cruft_dirs" != x; then \ + echo; \ + echo "**** CRUFT ALERT *****"; \ + echo; \ + echo "The following files and directories may not be needed any "; \ + echo "longer (usually because a plugin has been merged into "; \ + echo "another plugin, moved to a different module, or been "; \ + echo "renamed), and you probably want to clean them up if you "; \ + echo "don't have local changes: "; \ + echo; \ + for f in $$cruft_files; do echo "file $$f"; done; \ + echo; \ + for d in $$cruft_dirs; do echo "directory $$d"; done; \ + echo; \ + echo "'make clean-cruft' will remove these for you."; \ + echo; \ + fi + +clean-cruft-dirs: + @for d in $(CRUFT_DIRS); do \ + if test -e $$d; then \ + rm -r "$$d" && echo "Removed directory $$d"; \ + fi \ + done + +clean-cruft-files: + @for f in $(CRUFT_FILES); do \ + if test -e $$f; then \ + rm "$$f" && echo "Removed file $$f"; \ + fi \ + done + +clean-cruft: clean-cruft-dirs clean-cruft-files + +# also might want to add this to your Makefile.am: +# +# all-local: check-cruft + +all-local: check-cruft + +# 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: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..3062b31 --- /dev/null +++ b/NEWS @@ -0,0 +1,2 @@ +This is GStreamer RTSP Server 1.4.1 + diff --git a/README b/README new file mode 100644 index 0000000..2373730 --- /dev/null +++ b/README @@ -0,0 +1,4 @@ +gst-rtsp-server is a library ion top of GStreamer for building an RTSP server + +There are some examples in the examples/ directory and more comprehensive +documentation in docs/README. diff --git a/RELEASE b/RELEASE new file mode 100644 index 0000000..0052e43 --- /dev/null +++ b/RELEASE @@ -0,0 +1,71 @@ + +Release notes for GStreamer RTSP Server Library 1.4.1 + + +The GStreamer team is pleased to announce a bugfix release of the stable +1.4 release series. The 1.4 release series is adding new features on top +of the 1.2 series and is part of the API and ABI-stable 1.x release +series of the GStreamer multimedia framework that contains new features. +The 1.4.x bugfix releases only contain important bugfixes compared to 1.4.0. + + +Binaries for Android, iOS, Mac OS X and Windows are provided by the +GStreamer project for this release. + + +The 1.x series is a stable series targeted at end users. It is not API +or ABI compatible with the 0.10.x series. It can, however, be installed +in parallel with the 0.10.x series and will not affect an existing +0.10.x installation. + + +The stable 1.4.x release series is API and ABI compatible with 1.0.x and +any other 1.x release series in the future. Compared to 1.0.x it contains +some new features and more intrusive changes that were considered too +risky as a bugfix. + + + + +Bugs fixed in this release + + * 732644 : RTSP PLAY with specified range replies with wrong range + +==== Download ==== + +You can find source releases of gst-rtsp-server in the download +directory: http://gstreamer.freedesktop.org/src/gst-rtsp-server/ + +The git repository and details how to clone it can be found at +http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/ + +==== Homepage ==== + +The project's website is http://gstreamer.freedesktop.org/ + +==== Support and Bugs ==== + +We use GNOME's bugzilla for bug reports and feature requests: +http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer + +Please submit patches via bugzilla as well. + +For help and support, please subscribe to and send questions to the +gstreamer-devel mailing list (see below for details). + +There is also a #gstreamer IRC channel on the Freenode IRC network. + +==== Developers ==== + +GStreamer is stored in Git, hosted at git.freedesktop.org, and can be cloned +from there (see link above). + +Interested developers of the core library, plugins, and applications should +subscribe to the gstreamer-devel list. + + +Contributors to this release + + * Arun Raghavan + * Sebastian Dröge +  \ No newline at end of file diff --git a/REQUIREMENTS b/REQUIREMENTS new file mode 100644 index 0000000..14e4172 --- /dev/null +++ b/REQUIREMENTS @@ -0,0 +1,3 @@ +You need to have GStreamer. You can use an installed version of +GStreamer or from its build dir. + diff --git a/TODO b/TODO new file mode 100644 index 0000000..53d7d1c --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ + + - use a config file to configure the server + - error recovery diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..04a283b --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,66 @@ +## this one is commonly used with AM_PATH_PYTHONDIR ... +dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) +dnl Check if a module containing a given symbol is visible to python. +AC_DEFUN([AM_CHECK_PYMOD], +[AC_REQUIRE([AM_PATH_PYTHON]) +py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) +AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ +ifelse([$2],[], [prog=" +import sys +try: + import $1 +except ImportError: + sys.exit(1) +except: + sys.exit(0) +sys.exit(0)"], [prog=" +import $1 +$1.$2"]) +if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC + then + eval "py_cv_mod_$py_mod_var=yes" + else + eval "py_cv_mod_$py_mod_var=no" + fi +]) +py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` +if test "x$py_val" != xno; then + AC_MSG_RESULT(yes) + ifelse([$3], [],, [$3 +])dnl +else + AC_MSG_RESULT(no) + ifelse([$4], [],, [$4 +])dnl +fi +]) + +dnl a macro to check for ability to create python extensions +dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) +dnl function also defines PYTHON_INCLUDES +AC_DEFUN([AM_CHECK_PYTHON_HEADERS], +[AC_REQUIRE([AM_PATH_PYTHON]) +AC_MSG_CHECKING(for headers required to compile python extensions) +dnl deduce PYTHON_INCLUDES +py_prefix=`$PYTHON -c "import sys; print sys.prefix"` +py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` +if $PYTHON-config --help 2>/dev/null; then + PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` +else + PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" + if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" + fi +fi +AC_SUBST(PYTHON_INCLUDES) +dnl check if the headers exist: +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" +AC_TRY_CPP([#include ],dnl +[AC_MSG_RESULT(found) +$1],dnl +[AC_MSG_RESULT(not found) +$2]) +CPPFLAGS="$save_CPPFLAGS" +]) diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..a653c19 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1231 @@ +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. + +# This file 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. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# +# This file 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. + +# 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. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.14' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.14.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.14.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# Figure out how to run the assembler. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_AS +# ---------- +AC_DEFUN([AM_PROG_AS], +[# By default we simply use the C compiler to build assembly code. +AC_REQUIRE([AC_PROG_CC]) +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS +AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) +AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file 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. + +# 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-2013 Free Software Foundation, Inc. +# +# This file 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. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +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])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file 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. + + +# 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... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# 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 + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +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". + rm -rf conftest.dir + 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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + 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 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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]) +]) + + +# 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], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file 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. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. 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 " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/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 + + +# 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"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file 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 macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# 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.65])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 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + 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 + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])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]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# 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 +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# 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. + +# 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_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# +# This file 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. + +# 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])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file 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. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file 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. + +# 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 this is the am__doit target +.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 +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file 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. + +# 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)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file 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. + +# _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], +[m4_foreach_w([_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])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file 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. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file 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. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file 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. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# 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 ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + 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 + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # 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 + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + 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]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# +# This file 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. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# 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="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# +# This file 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. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# +# This file 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. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([common/m4/as-ac-expand.m4]) +m4_include([common/m4/as-auto-alt.m4]) +m4_include([common/m4/as-compiler-flag.m4]) +m4_include([common/m4/as-docbook.m4]) +m4_include([common/m4/as-libtool.m4]) +m4_include([common/m4/as-version.m4]) +m4_include([common/m4/gst-args.m4]) +m4_include([common/m4/gst-check.m4]) +m4_include([common/m4/gst-default.m4]) +m4_include([common/m4/gst-doc.m4]) +m4_include([common/m4/gst-error.m4]) +m4_include([common/m4/gst-feature.m4]) +m4_include([common/m4/gst-glib2.m4]) +m4_include([common/m4/gst-package-release-datetime.m4]) +m4_include([common/m4/gst-plugindir.m4]) +m4_include([common/m4/gst.m4]) +m4_include([common/m4/gtk-doc.m4]) +m4_include([common/m4/introspection.m4]) +m4_include([common/m4/pkg.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) +m4_include([acinclude.m4]) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..267b167 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,113 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + + +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. + +olddir=`pwd` +cd "$srcdir" + +DIE=0 +package=gst-rtsp +srcfile=gst/rtsp-server/rtsp-server.c + +# Make sure we have common +if test ! -f common/gst-autogen.sh; +then + echo "+ Setting up common submodule" + git submodule init +fi +git submodule update + +# source helper functions +if test ! -f common/gst-autogen.sh; +then + echo There is something wrong with your source tree. + echo You are missing common/gst-autogen.sh + exit 1 +fi +. common/gst-autogen.sh + +# install pre-commit hook for doing clean commits +if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); +then + rm -f .git/hooks/pre-commit + ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit +fi + +NOCONFIGURE=1 +CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc' + +autogen_options $@ + +printf "+ check for build tools" +if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else echo; fi +version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 " \ + "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 68 || DIE=1 +version_check "automake" "$AUTOMAKE automake automake-1.11" \ + "ftp://ftp.gnu.org/pub/gnu/automake/" 1 11 || DIE=1 +#version_check "autopoint" "autopoint" \ +# "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1 +version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \ + "ftp://ftp.gnu.org/pub/gnu/libtool/" 2 2 6 || DIE=1 +version_check "pkg-config" "" \ + "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 + +die_check $DIE + +aclocal_check || DIE=1 +autoheader_check || DIE=1 + +die_check $DIE + +# if no arguments specified then this will be printed +if test -z "$*" && test -z "$NOCONFIGURE"; then + echo "+ checking for autogen.sh options" + echo " This autogen script will automatically run ./configure as:" + echo " ./configure $CONFIGURE_DEF_OPT" + echo " To pass any additional options, please specify them on the $0" + echo " command line." +fi + +toplevel_check $srcfile + +# autopoint +#if test -d po ; then +# tool_run "$autopoint" "--force" +#fi + +# aclocal +# if test -f acinclude.m4; then rm acinclude.m4; fi + +tool_run "$libtoolize" "--copy --force" +tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS" +tool_run "$autoheader" + +# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode +echo timestamp > stamp-h.in 2> /dev/null + +tool_run "$autoconf" +debug "automake: $automake" +tool_run "$automake" "--add-missing --copy" + +test -n "$NOCONFIGURE" && { + echo "+ skipping configure stage for package $package, as requested." + echo "+ autogen.sh done." + exit 0 +} + +cd "$olddir" + +echo "+ running configure ... " +test ! -z "$CONFIGURE_DEF_OPT" && echo " default flags: $CONFIGURE_DEF_OPT" +test ! -z "$CONFIGURE_EXT_OPT" && echo " external flags: $CONFIGURE_EXT_OPT" +echo + +echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT +"$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || { + echo " configure failed" + exit 1 +} + +echo "Now type 'make' to compile $package." diff --git a/common/ChangeLog b/common/ChangeLog new file mode 100644 index 0000000..92d0d25 --- /dev/null +++ b/common/ChangeLog @@ -0,0 +1,1712 @@ +2008-12-17 Edward Hervey + + * gst.supp: + And yet another variation of the GstAudioFilter leak. + +2008-12-15 Sebastian Dröge + + Patch by: Roland Illig + + * m4/gst-parser.m4: + Fix AG_GST_BISON_CHECK to handle version numbers with more than + two components (i.e. 2.4.1). Fixes bug #564507. + +2008-12-14 Edward Hervey + + * gst.supp: + And yet another variant of the GstAudioFilter leak. + +2008-12-13 Edward Hervey + + * gst.supp: + Added variants of leaks of dynamic pad templates created in + GstAudioFilter. + Add conditional jump triggered by getaddrinfo (maybe glibc-2.9). + +2008-12-12 Edward Hervey + + * gst.supp: + Fix leak in GIO called by gnomevfs. Nothing we can do about this. + +2008-12-12 Edward Hervey + + * gst.supp: + Added another suppression for dynamic pad templates, in this case + GstAudioFilter. + Added suppression for PangoLanguage which can never be freed + according to the Pango API. + +2008-12-12 Edward Hervey + + * gst.supp: + A whole bunch of suppressions detected on latest gentoo ~amd64. + Make some existing suppressions more generic (for subtle dependecy + code changes). + Added suppressions for glibc-2.9. + Added suppressions for new variants of ALSA leaks. + Added suppressions for a series of leaks in plugins registrations due + to some pad templates' caps calculated at runtime. + Added suppressions for variants of some leaks in pango/fontconfig. + Added suppressions for leak in gstffmpegcsp.c (nothing we can do + about it, but will only exist once). + +2008-12-04 Sebastian Dröge + + * m4/gst-plugin-docs.m4: + Remove the check if $have_gtk_doc equals yes as it's not defined + and $enable_gtk_doc should be good enough. + Also this restores the build of the plugin documentation. + +2008-12-01 Mark Nauwelaerts + + * gst.supp: + Add suppression variant for Ubuntu Hardy x86/64bit. + +2008-12-01 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Simplily uninstall rule. Its closer to upstream and fixes #150331. + +2008-11-29 Sebastian Dröge + + * m4/glib-gettext.m4: + Update glib-gettext.m4 from latest stable GLib release. + +2008-11-29 Sebastian Dröge + + Patch by: Cygwin Ports maintainer + + + * gettext.patch: + Update the gettext patch for use with gettext 0.17 which is + required to build with libtool 2.2 because of conflicts. + First part of bug #556091. + +2008-11-29 Sebastian Dröge + + * m4/gtk-doc.m4: + * m4/pkg.m4: + Update gtk-doc and pkg-config m4 macros from their latest releases. + +2008-11-20 Michael Smith + + * m4/as-objc.m4: + Fix objective C test macro when none of the compilers are found at all. + +2008-10-30 Stefan Kost + + * gtk-doc.mak: + Also cp the entities here to all xinlcude based docs (workaround for + not being able to set up a search path). + +2008-10-17 Jan Schmidt + + * gtk-doc.mak: + Don't clobber the real registry cache file when + building docs. + +2008-10-07 Jan Schmidt - Sun Microsystems + + * m4/gst-error.m4: + Also disable the bogus "loop not entered at top" warnings appearing on Sparc Forte builds. + +2008-10-06 Stefan Kost + + * gtk-doc.mak: + Apply the same fix as below to gtk-doc.mak. Somehow did not end up in + CVS. + +2008-09-05 David Schleef + + * gtk-doc-plugins.mak: Fix the check for gtkdoc-rebase: don't + pass the 'which' error back to make. This fix is more specific + than what is in upstream. + +2008-09-05 David Schleef + + * gtk-doc.mak: Fix the check for gtkdoc-rebase: don't pass the + 'which' error back to make. This fix is more specific than + what is in upstream. + +2008-09-04 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Get closer to upstream makefiles. Don't install index.sgml twice. Call + gtkdoc-rebase (if exists). + +2008-08-21 Stefan Kost + + * gtk-doc-plugins.mak: + Revert $(top_builddir) -> $(builddir) change of rev. 1.39 as there is + no variable called builddir. + +2008-07-31 Mark Nauwelaerts + + * gst.supp: + Add suppressions for Ubunty Hardy x86/64bit, similar to earlier + versions and 32bit variant. + +2008-07-31 Sebastian Dröge + + * m4/gst-feature.m4: + Remove GST_DISABLE_(ENUMTYPES|INDEX|URI). + +2008-07-21 Tim-Philipp Müller + + * m4/gst-error.m4:: + When checking for GST_ERROR_CXXFLAGS, check each compiler flag + individually, not all together. + +2008-07-20 Tim-Philipp Müller + + * m4/gst-parser.m4:: + Fix bison version number detection for older --version + output format (as bison 1.28 on OSX 10.4 outputs). + Fixes #543853. + +2008-07-12 Stefan Kost + + * plugins.xsl: + Split refsect2 also here to make "Element Pads" subtitle visible. + +2008-07-08 Sebastian Dröge + + * m4/gst-error.m4: + Add compiler flags to warn if declarations after statements or + variable length arrays are used. These are C99/GCC extensions and + are not supported by some compilers we want to support. + +2008-07-02 Mark Nauwelaerts + + * gtk-doc-plugins.mak: + Only clean doc maintainer stamps in maintainer-clean. Fixes #539977. + +2008-06-20 Sebastian Dröge + + * gstdoc-scangobj: + Always use format strings for printf-like functions, even if they just + print a string. Fixes bug #536981. + +2008-06-20 Sebastian Dröge + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Include CFLAGS and LDFLAGS in GTKDOC_CFLAGS and GTKDOC_LDFLAGS, + otherwise the values passed to configure are ignored. + Fixes bug #536978. + +2008-06-05 Tim-Philipp Müller + + * m4/gst-error.m4: + Add -fno-strict-aliasing when compiling with -Werror, to work around + warnings caused by G_LOCK with recent GLib versions (2.16.x) (#316221). + +2008-06-05 Jan Schmidt + + * gtk-doc.mak: + Don't copy html/*.png files unless they don't already exist + in the destdir. Fixes distcheck failure caused by permissions + problems trying to copy a file into the destdir when it already + exists. + +2008-05-28 Stefan Kost + + * plugins.xsl: + The class was not shown in plugin docs. Fix typo in changelog below. + +2008-05-22 Jan Schmidt + + * gstdoc-scangobj: + Emit warnings if one of the GTypes we're expecting is 0 + when scanning. + +2008-05-21 Felipe Contreras + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Fix installing png images when gtk-doc is disabled. + +2008-05-21 Felipe Contreras + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Fix make clean when gtk-doc is disabled and other cleanups. + +2008-05-17 Jan Schmidt + + * gtk-doc-plugins.mak: + Be more quiet when the files don't yet exist. + +2008-05-16 Jan Schmidt + + * gstdoc-scangobj: + Add a mechanism for adding 'implicitly created' GTypes into the + scan, allowing for documenting plugin-private base classes that + provide signals or properties for public elements. + + * gtk-doc-plugins.mak: + Use $(builddir) instead of $(top_builddir) in a few places - there's + no need to hard code 'docs/plugins' as the only useable path. + +2008-05-14 Peter Kjellerstedt + + * m4/gst-feature.m4: + Report plug-ins without external dependencies that will not be built + even when the name of the plug-in is a substring of another plug-in, + e.g., goom vs. goom2k1. + +2008-05-14 Tim-Philipp Müller + + * gst.supp: + Add suppression for glibc bug on gutsy/x86-64 + +2008-05-12 Stefan Kost + + * plugins.xsl: + Improve the layout of the caps, but splitting them on ";". + +2008-05-09 Sebastian Dröge + + Patch by: Brian Cameron + + * m4/gst-default.m4: + Don't set the default audio sink to the default visualizer. + Fixes bug #532295. + +2008-05-07 Tim-Philipp Müller + + * check.mak: (help): + Document GST_CHECKS environment variable in checks 'make help'. + +2008-05-06 Sebastian Dröge + + Patch by: Marc-Andre Lureau + + * scangobj-merge.py: + Don't depend on Twisted just for the OrderedDict but implement our + own ordered dictionary class. Fixes bug #531577. + +2008-04-23 Edward Hervey + + * gst.supp: + Re-arrange latest suppressions. + Add all known suppressions for ubuntu hardy. Same as for older + ubuntus, but with different codepaths. + +2008-04-22 Edward Hervey + + * gst.supp: Make tls leak suppression a bit more generic. + +2008-04-22 Edward Hervey + + * gst.supp: Fix ommission in latest commit. + Make tls leak suppression more generic in order to cover more + distributions (and hopefully also future distributions). + +2008-04-22 Edward Hervey + + * gst.supp: Add suppressions for Hardy. + They're just the newer versions of similar suppressions we had + for the previous versions of ubuntu. + +2008-04-15 Sebastian Dröge + + * Makefile.am: + * m4/Makefile.am: + Dist all files in common. Fixes bug #527984. + +2008-04-14 Tim-Philipp Müller + + * m4/gst-function.m4: + Rename AC_CACHE_VAL cache-ids to contain '_cv_' in order to make + autoconf-2.62 complain less. + +2008-04-13 Tim-Philipp Müller + + * m4/gst-args.m4: + * m4/gst-valgrind.m4: + Bump valgrind requirement to 3.0 (which was released in August 2005). + Fixes #489269. Also, check for version >=REQ and not >REQ. + +2008-04-09 Tim-Philipp Müller + + * m4/gst-default.m4: + Add --with-default-{audiosink|audiosrc|videosink|videosrc|visualizer} + configure switches (#519417). + +2008-04-03 Tim-Philipp Müller + + * m4/gst-args.m4: + Add --disable-foo switch for dependency-less plugins (#525586). + +2008-04-01 Sebastian Dröge + + * m4/gst-parser.m4: + Unconditionally require flex 2.5.31 and bison 1.875. + +2008-03-23 Sebastian Dröge + + * m4/gst-arch.m4: + amd64/x86_64 allows unaligned memory access too. + +2008-03-21 Sebastian Dröge + + * m4/gst-dowhile.m4: + Add macro that checks if the compiler supports do {} while (0) + macros and define HAVE_DOWHILE_MACROS if it does. This is + needed by glib/gmacros.h to use something else than + if (1) else for G_STMT_START/END when compling C++, which + causes compiler warnings because of ambigious else with g++ 4.3. + +2008-03-21 Sebastian Dröge + + * m4/gst-plugin-docs.m4: + * mangle-tmpl.py: + Don't depend on PyXML and use only XML modules that are shipped + with python. Fixes bug #519635. + +2008-03-07 Edward Hervey + + * m4/gtk-doc.m4: (GTK_DOC_CHECK): + The previous commit to this file by Stefan Kost mentionned checking for + SED, but NOT checking for gtkdoc-check (wth is that doing there ??). + Therefore, removing the check for gtkdoc-check + +2008-03-03 David Schleef + + * m4/ax_create_stdint_h.m4: Oops, checked in the wrong copy of + this file. (Update from upstream) + +2008-03-03 David Schleef + + * m4/ax_create_stdint_h.m4: Update from upstream. Fixes a bug + compiling with MSVC. + +2008-03-03 Edward Hervey + + * m4/pkg.m4: + Allow override of pkg-config results, as proposed by configure --help. + This is in fact just a backport from upstream pkg.m4. + Fixes #518892 + +2008-03-03 Peter Kjellerstedt + + * ChangeLog: + Changelog surgery of my previous commit to add bugzilla reference. + * m4/gst-args.m4: + Add AG_GST_CHECK_PLUGIN and AG_GST_DISABLE_PLUGIN to make it easier + to include and exclude plug-ins without external references, i.e., + plug-ins listed in GST_PLUGINS_SELECTED. (#498222) + +2008-03-03 Sebastian Dröge + + * gst.supp: + Add another glibc suppression. + +2008-02-29 Peter Kjellerstedt + + * m4/gst-feature.m4: + Make the comment before defines generated via AG_GST_CHECK_FEATURE + look nicer. (#498222) + +2008-02-26 Jan Schmidt + + * m4/Makefile.am: + * m4/as-gcc-inline-assembly.m4: + Add Dave Schleef's GCC inline assembly detection macro + for using in gst-plugins-good in the goom 2k4 plugin. + +2008-02-25 Andy Wingo + + * gst-autogen.sh: Instead of only passing certain arguments to + configure, pass anything that we didn't handle. Much friendlier. + Fixes #34412. + +2008-02-23 Jan Schmidt + + * m4/gst-error.m4: + Store the detected compiler flags into ERROR_CFLAGS rather than + ERROR_CXXFLAGS, and use the macro that checks the C compiler, not + the C++ one. + +2008-02-23 Tim-Philipp Müller + + * m4/gst-error.m4: + Reflow checks for additional warning flags so they're not + nested, which fixes the result reporting in the configure + output. + +2008-02-22 Tim-Philipp Müller + + * m4/as-compiler-flag.m4: + Add AS_CXX_COMPILER_FLAG + + * m4/gst-error.m4: + Add AG_GST_SET_ERROR_CXXFLAGS (Forte bits need testing) + +2008-02-22 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Add 'check-inspected-versions' target; this helps identify + files that should have been removed or where the version + number should (ideally) be updated before a release + (which doesn't happen automatically if the releaser doesn't + build that plugin locally). Not adding at a distcheck hook + yet though, because it's not really that important and would + probably also be a problem on buildbots. + +2008-02-22 Sebastian Dröge + + * gst.supp: + Add even more glibc 2.7 suppressions. + +2008-02-22 Sebastian Dröge + + * gst.supp: + Add another suppression for GLib caching some values after + the first call. + +2008-02-12 Sebastian Dröge + + Patch by: + Tim Mooney + + * m4/gst-error.m4: + Use no%E_MACRO_REDEFINED on Solaris to prevent compiler warnings. + Fixes bug #515905. + +2008-02-11 Sebastian Dröge + + * gst.supp: + Add a few more glibc 2.7 suppressions to make the avisubtitle unit + test valgrind clean. Fixes bug #515703. + +2008-02-08 Stefan Kost + + * ChangeLog: + Changelog surgery for last commit. + +2008-02-08 Stefan Kost + + * m4/gtk-doc.m4: + Conditionally check for SED. Also sync a bit with upstream macro. + +2008-02-08 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + Use '$(SED)' instead of 'sed'. Don't use -i for in-place as its gnu + only, move to a temp file instead. + +2008-02-06 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + As our docs are versioned, we need to patch the index.sgml file to have + correct paths there, unless we also want to fork gtk-doc's xsl (which + we don't). This hopefully fixes xrefs between modules. + +2008-02-02 Sebastian Dröge + + * m4/gst-feature.m4: + Use printf instead of echo as "echo -e" isn't POSIX and doesn't work + with strict POSIX shells like tcsh or dash and also not every platform + has a /bin/echo that supports it. + +2008-01-24 Stefan Kost + + * ChangeLog: + ChangeLog surgery. + + * gstdoc-scangobj: + Sync the object scanner with gtk-doc fixes. Update args and hierarchy + files. + +2008-01-20 Sebastian Dröge + + * check.mak: + * coverage/lcov.mak: + * gtk-doc-plugins.mak: + * release.mak: + Use $(MAKE) instead of make to fix the build if GNU make is called + something else on the system. + + * m4/as-docbook.m4: + Fix path for docbook.xsl if we have no /etc/xml/catalog and add a + docbook-xsl search path for FreeBSD. + +2008-01-18 Sebastian Dröge + + * gst.supp: + Add a suppression for a glibc bug: + http://valgrind.org/docs/manual/faq.html#faq.exit_errors> + +2008-01-18 Sebastian Dröge + + * gst.supp: + Add some more glibc 2.7 suppressions and make the GLib suppressions + for the home/tmp/etc directory caching a bit more generic. + +2008-01-18 Sebastian Dröge + + * gst.supp: + Add some glibc 2.7 supressions as found on Debian/unstable. + +2008-01-14 Jan Schmidt + + * download-translations: + Apparently I have problems with leaving things commented out when + I edit shell scripts. + +2008-01-12 Jan Schmidt + + * download-translations: + Remove bash-isms + +2008-01-12 Jan Schmidt + + * check-exports: + Restore the cleanup rm of our tmp file which I didn't mean to leave + commented out. + +2008-01-12 Jan Schmidt + + * check-exports: + Fixes to make check-export work on both Solaris and Linux + + * m4/gst-error.m4: + Disable extra warning category (argument mismatch) as an error + on Forte, as it prevents the libcheck fail_if macros from compiling. + + * win32.mak: + Substitute the GStreamer version so things will keep working in 0.11 + +2008-01-11 Tim-Philipp Müller + + Patch by: Peter Kjellerstedt + + * m4/gst-glib2.m4: + * m4/gst-libxml2.m4: + Improve/fix output from configure if either glib-2.0 or + libxml2 are not installed (#498222). + +2008-01-09 Stefan Kost + + * coverage/lcov.mak: + Update coverage make-rules: use them conditionaly, use libtool mode + and use lcov to cleanup. + +2007-12-18 Sebastian Dröge + + * glib-gen.mak: + Also use #include "header" instead of #include
for the + headers that were used to generate the source files for the same + reason as below. + + Remove whitespace before #include. + +2007-12-18 Sebastian Dröge + + * glib-gen.mak: + Use #include "header" instead of #include
for the generated + enum C files as the file will always be in the same directory and + some compilers seem to be a bit strict about that unless . is added + to the include path. + + Include all headers that were used to generate the source files in + the C file as they're used there. + +2007-12-17 Tim-Philipp Müller + + * win32.mak: (win32), (win32defs), (win32crlf): + Make check for CR LF in Visual C++ 6.0 project files + work, based on patch by David Schleef (#496722, #393626). + +2007-12-17 Tim-Philipp Müller + + * Makefile.am: + Don't forget to dist the new win32.mak. + +2007-12-17 Tim-Philipp Müller + + * win32.mak: (win32), (win32defs): + Move common win32 Makefile foo into this new file. + +2007-12-15 Stefan Kost + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + We should have never forked this that much :/. + +2007-12-13 Tim-Philipp Müller + + * check-exports: + Fix build on the ppc64 build bot. + +2007-12-13 Tim-Philipp Müller + + * check-exports: + Suppress more unintentional exports (too much hassle to rename them, + since the win32 project files would need changing too). + +2007-12-12 Tim-Philipp Müller + + * Makefile.am: + check-exports should be disted. + +2007-12-12 Tim-Philipp Müller + + * check-exports: + Add quick'n'dirty script to check the exported symbols of a library + against the symbols in the corresponding .def file (#493983). Based + on script by Ole André Vadla Ravnås. + +2007-11-06 Jan Schmidt + + * gtk-doc-plugins.mak: + Fix distcheck by making sure the types files are treated like the + other gtkdoc-scangobj generated files. + +2007-09-21 Sebastian Dröge + + * m4/gst-args.m4: + Let the AG_GST_ARG_ENABLE_EXPERIMENTAL macro default to disable + building of experimental plugins. Nobody uses it yet and the + --enable--experimental stuff from gst-plugins-good defaults to + disable too. + +2007-09-06 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Just use the normal 'check' target and avoid a circular + dependency. + +2007-09-06 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Add rule to error out if .hierarchy file contains tabs. + +2007-08-20 Tim-Philipp Müller + + * download-translations: + * po.mak: + If there are new languages, they need to be added to po/LINGUAS. + +2007-08-20 Tim-Philipp Müller + + * download-translations: + * po.mak: + Fix up 'download-po' a bit, so that we find new translations + for languages that aren't in our po/LINGUAS file yet too. + +2007-07-16 Jan Schmidt + + * gst.supp: + Add a suppression for GLib caching the tmp dir seen on an + Ubuntu Feisty system. + +2007-07-13 Jan Schmidt + + * m4/gst-feature.m4: + If we want to use 'echo -e', call /bin/echo instead of the shell's + since -e is a bash extension, and our /bin/sh might not be being + provided by bash. + +2007-07-01 Thomas Vander Stichele + + * po.mak: + Translation project has moved. Also, no idea how this used to + work given that we weren't downloading a .po file. + +2007-06-25 Stefan Kost + + * gst-xmlinspect.py: + * plugins.xsl: + Also extract element caps for plugin-docs. Fixes parts of #117692. + +2007-06-21 Tim-Philipp Müller + + Patch by: Andreas Schwab + + * m4/gst-feature.m4: + Fix quoting (#449493). + +2007-06-10 Sebastian Dröge + + * m4/gst-parser.m4: + Only generate the parser if bison >= 1.875 _and_ flex >= 2.5.31 is + installed and use pre-generated sources otherwise. Fixes bug #444820. + +2007-05-11 Michael Smith + + * gst.supp: + Suppression variant for our good friend the TLS leak, this time for + Ubuntu Feisty/x86. + +2007-05-09 Tim-Philipp Müller + + * gtk-doc-plugins.mak: + Fix make distcheck again; change some spaces to tabs in makefile. + +2007-04-29 Thomas Vander Stichele + + * gtk-doc-plugins.mak (-module): + Error out when the html build step gives warnings, so they get + fixed properly. + +2007-04-23 Stefan Kost + + * m4/gst-feature.m4: + Add macro AG_GST_PARSE_SUBSYSTEM_DISABLES that checks the defines in + the configuration header and AC_DEFINES the setings. + +2007-04-19 Sebastian Dröge + + Patch by: Vincent Torri + + * m4/gst-parser.m4: + Put the AC_MSG_RESULT output in brackets to get it properly written to + the terminal. + +2007-04-18 Sebastian Dröge + + * m4/gst-parser.m4: + Check for flex >= 2.5.31 and set GENERATE_PARSER if we have at least + that version. Otherwise use pre-generated parser sources as we can't + raise the required flex version. HAVE_MT_SAVE_FLEX is obsolete now + as we use a new enough flex version anyway. First part of #349180 + +2007-04-10 Thomas Vander Stichele + + * m4/gst-check.m4: + Allow pre-setting the GST(PB)_TOOLS/PLUGINS_DIR variables to help + builds against older GStreamer. + +2007-03-25 Sebastian Dröge + + * m4/gst-parser.m4: + Fix the flex version check. It ignored the micro version before. + +2007-03-09 Jan Schmidt + + * check.mak: + Use the same timeout when generating valgrind suppressions as + running the valgrind test. + + * gst.supp: + Add some more suppressions and stuff. + +2007-03-08 Jan Schmidt + + * check.mak: + Make sure GSlice is disabled when building suppressions too. + + * gst.supp: + Add around *850* lines of suppressions for one-time initialisations + inside libasound and gconf/bonobo/ORBit. I feel so dirty. + +2007-03-07 Jan Schmidt + + * gst.supp: + add a suppression for this GConf flup on the FC5 buildbot. + +2007-03-06 Jan Schmidt + + * gst.supp: + Make the suppression a little more generic, to catch the FC5 + backtrace too. + +2007-03-06 Jan Schmidt + + * gst.supp: + Add a suppression for libcdio 0.76. It leaks an internal struct + when the CD-ROM device is not accessible. + +2007-02-28 Thomas Vander Stichele + + * m4/gst-arch.m4: + Move a line that was in the wrong macro + +2007-02-28 Thomas Vander Stichele + + * m4/gst.m4: + Add + * m4/gst-arch.m4: + * m4/gst-args.m4: + * m4/gst-check.m4: + * m4/gst-debuginfo.m4: + * m4/gst-default.m4: + * m4/gst-doc.m4: + * m4/gst-error.m4: + * m4/gst-feature.m4: + * m4/gst-function.m4: + * m4/gst-gettext.m4: + * m4/gst-glib2.m4: + * m4/gst-libxml2.m4: + * m4/gst-parser.m4: + * m4/gst-plugin-docs.m4: + * m4/gst-plugindir.m4: + * m4/gst-valgrind.m4: + * m4/gst-x11.m4: + Convert all macros to use AG_GST style so we can properly warn + when they're missing if configure.ac calls AG_GST_INIT + Will require update in all GStreamer modules. + +2007-02-11 Stefan Kost + + * m4/gst-args.m4: + Remove 'enable' from configure switch description as this leads to + confusing lines like "disable enable builing ...". + * m4/gst-feature.m4: + Fix comment to sound less horrible. + +2007-02-07 Tim-Philipp Müller + + Patch by: Will Newton + + * m4/gst-check.m4: + Use $PKG_CONFIG rather than pkg-config directly, the one in our path + might not be the one we want, like when cross-compiling. Also, other + macros such as PKG_CHECK_MODULES use $PKG_CONFIG, so we should + probably too just for consistency. Fixes #405288. + +2007-01-08 Tim-Philipp Müller + + * m4/gst-parser.m4: + Need to use double square brackets again so m4 doesn't remove them + (fixes #378931). + + * m4/gst-args.m4: + Use double square brackets here as well, for the same reason. + +2007-01-05 Tim-Philipp Müller + + * m4/gst-parser.m4: + Use 'sed' rather than 'tr' to strip trailing letters from version + numbers, since 'tr' might not be available and we know sed is + (#378931). + +2006-10-21 Tim-Philipp Müller + + * check.mak: + Increase default timeout under valgrind, 60 is just too short and + some tests take a bit longer these days and not everyone has a + beefy machine. + +2006-09-29 Michael Smith + + * gst.supp: + More suppressions for edgy. + +2006-09-28 Jan Schmidt + + * m4/gst-glib2.m4: + Use gmodule-no-export-2.0.pc instead of gmodule-2.0.pc - we neither + want nor need --export-dynamic (which ends up making us export a bunch + of unneeded symbols) + +2006-09-14 Tim-Philipp Müller + + * gst.supp: + Some suppressions for the more recent ld.so in ubuntu edgy. + +2006-08-23 Tim-Philipp Müller + + * gst.supp: + Shorten function trail so the suppression works on + my ubuntu dapper system with core cvs as well. + +2006-07-28 Jan Schmidt + + * gst.supp: + Extra suppressions from my Ubuntu x86_64 machine + +2006-07-24 Tim-Philipp Müller + + Patch by: Frederic Peters + + * m4/gst-parser.m4: + Need to double square brackets in .m4 files. Should fix bison + version detection with version numbers like 1.23a (#348354). + +2006-07-24 Jan Schmidt + + * check.mak: + Valgrind fails to find tests written in tests/check/ directly (rather + than a subdir) - because valgrind gets run with a filename that + doesn't contain a relative path, it goes searching /usr/bin instead. + Run with ./.... to make things work either way. + + * gtk-doc-plugins.mak: + Add $(top_builddir)/src as a place to look for plugins + when building too, since that's where gst-template keeps things + +2006-07-23 Stefan Kost + + Patch by: Frederic Peters + + * m4/gst-parser.m4: + Fix bison detection (#348354) + +2006-07-21 Stefan Kost + + * m4/gst-parser.m4: + check for bison and flex + +2006-07-13 Thomas Vander Stichele + + * m4/gst-plugin-docs.m4: + remove the configure argument for enabling plugin doc build; + having gtk-doc enabled and pyxml present is enough of a trigger + +2006-07-03 Thomas Vander Stichele + + * coverage/lcov.mak: + fix up rules to work with gst-python as well + run "make lcov" to test and generate the reports + run "make lcov-reset" to redo it after that + +2006-07-02 Thomas Vander Stichele + + * Makefile.am: + * check.mak: + add an inspect target that inspects every element feature, + so we can have that added for coverage + * coverage/lcov.mak: + add support for lcov + +2006-07-02 Thomas Vander Stichele + + * m4/gst-args.m4: + when building with gcov, reset CFLAGS and friends to O0 + +2006-07-02 Thomas Vander Stichele + + * m4/gst-args.m4: + Find the gcov that matches the gcc version + Only allow gcov if we use gcc + +2006-07-02 Thomas Vander Stichele + + * Makefile.am: + * coverage/coverage-report-entry.pl: + * coverage/coverage-report.pl: + * coverage/coverage-report.xsl: + copy coverage reporting files from dbus + +2006-07-01 Thomas Vander Stichele + + * m4/gst-args.m4: + libtool strips gcov's -f flags, so libgcov does not get + linked in. Setting GCOV_LIBS with -lgcov fixes libtool's + stripping + also show what pkg-config-path we set + +2006-06-22 Tim-Philipp Müller + + Patch by: Peter Kjellerstedt + + * m4/gst-feature.m4: + Show list of plugins without external dependencies that + will not be built as well (#344136). + +2006-06-15 Tim-Philipp Müller + + * m4/gst-plugin-docs.m4: + add GST_PLUGIN_DOCS, which checks for everything needed + to build the plugin docs (namely gtk-doc and pyxml); also + adds a new --enable-plugin-docs configure switch; will + set ENABLE_PLUGIN_DOCS conditional for use in Makefile.am + files (see #344039). + +2006-06-11 Thomas Vander Stichele + + * m4/gst-check.m4: + add GST_PKG_CHECK_MODULES, which in the normal case of checking + for a dependency lib for a plug-in only needs two arguments + to do the right thing. + * m4/gst-feature.m4: + clean up output a little of feature checking; also deal with + non-plug-in feature checks + * m4/Makefile.am: + * m4/gst-gstreamer.m4: + remove this file; it's a useless check + +2006-06-06 Thomas Vander Stichele + + * m4/gst-arch.m4: + add PPC64 so we can have separate structure sizes for it + +2006-06-05 Edward Hervey + + * gtk-doc.mak: + Check for the proper .devhelp2 file to remove. + +2006-05-31 Thomas Vander Stichele + + * gtk-doc.mak: + allow a magic variable to suppress errors from docbuilding + +2006-05-30 Thomas Vander Stichele + + * gtk-doc.mak: + error out if gtkdoc-mktmpl finds unused declarations + +2006-05-28 Edward Hervey + + * gst.supp: + Reverting previous commit. That's good to know, Edward, but why ? + +2006-05-28 Edward Hervey + + * gst.supp: + Added suppresion for memleak in g_option_context_parse on fc5-64 + +2006-05-19 Thomas Vander Stichele + + * m4/gst-check.m4: + set GSTPB_PLUGINS_DIR just like GST_PLUGINS_DIR + +2006-05-18 Tim-Philipp Müller + + * check.mak: + Fix 'make help' in check directories, it should be + 'valgrind.gen-suppressions' not 'valgrind-gen-suppressions' + (not changing target to match help string on purpose to keep + scripts etc. functional). + +2006-05-18 Thomas Vander Stichele + + Patch by: Peter Kjellerstedt + + * m4/gst-arch.m4: + add support for CRIS and CRISv32. + +2006-05-17 Jan Schmidt + + * m4/gst-args.m4: + Fix the macros for command-line supplied package and origin names + so they don't end up being configure as "" (Fixes #341479) + +2006-05-14 Jan Schmidt + + * gtk-doc.mak: + Add uninstall rule to remove .devhelp2 files. + +2006-05-09 Edward Hervey + + * gst.supp: + Add suppression for GSlice version of + g_type_init calloc leak + +2006-04-05 Michael Smith + + * gst.supp: + Delete a bogus suppression for the registry code. + Generalise a suppression for a glib bug (see #337404) + +2006-04-04 Michael Smith + + * gst.supp: + Add a leak suppression: the existing glibc-doesn't-free-TLS one + wasn't triggering here. + +2006-04-04 Michael Smith + + * gst.supp: + Add some minimally-neccesary suppressions for my x86/dapper system. + +2006-04-01 Thomas Vander Stichele + + * plugins.xsl: + Do not display an origin link if origin does not start with http + See #323798 + +2006-04-01 Thomas Vander Stichele + + * m4/gst-args.m4: + * m4/gst-feature.m4: + add more macros + * m4/gst-x11.m4: + X11-related checks + +2006-04-01 Thomas Vander Stichele + + * m4/as-version.m4: + newer version + * m4/gst-args.m4: + * m4/gst-doc.m4: + update and add other macros to be shared across projects + +2006-03-24 Thomas Vander Stichele + + * gst.supp: + add a suppression for g_parse_debug_string + +2006-03-23 Stefan Kost + + * gstdoc-scangobj: + sync fully with gtkdoc-0.15 + +2006-03-23 Stefan Kost + + * gstdoc-scangobj: + * gtk-doc.mak: + sync a little with gtk-doc mainline + +2006-03-17 Wim Taymans + + * gst.supp: + add another clone suppression + change all glibc suppressions to match 2.3.* + +2006-03-09 Thomas Vander Stichele + + * m4/check.m4: + fix test so it actually works when the normal check is used + over debian's/ubuntu's + +2006-03-08 Jan Schmidt + + * check.mak: + Set G_SLICE=always-malloc when valgrinding tests + (closes #333272) + +2006-02-21 Jan Schmidt + + * m4/gst-glib2.m4: + Fix debug output when the GLib version prerequisite is not found + +2006-02-13 Andy Wingo + + * m4/check.m4: Hack around Debian/Ubuntu's broken installation of + the PIC version of check as libcheck_pic.a. Should work with + cross-compilation too. Grr. + +2006-02-06 Thomas Vander Stichele + + * m4/gst-default.m4: + switch to auto* sinks for defaults + +2006-02-02 Wim Taymans + + * check.mak: + add a .valgrind.gen-suppressions target to aid in generating + suppressions + * gst.supp: + add more repressions from my debian glibc as of today + +2006-02-02 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + only add srcdir/gst if it exists + +2006-01-30 Thomas Vander Stichele + + * release.mak: + don't complain about disted enums in win32 + +2006-01-20 Thomas Vander Stichele + + * m4/gst-check.m4: + AC_SUBST CFLAGS and LIBS + do a non-command because something is stripping out our AC_SUBST + +2006-01-20 Thomas Vander Stichele + + * m4/gst-args.m4: + * m4/gst-valgrind.m4: + properly give a "no" result manually when providing a + not-found action to fix configure output + +2006-01-20 Thomas Vander Stichele + + * m4/pkg.m4: + update with a more recent version + +2006-01-07 Thomas Vander Stichele + + * gettext.patch: + make Makefile depend on LINGUAS, so rebuilds work when adding + a language + +2006-01-03 Michael Smith + + * check.mak: + Clarify error message from valgrind test runs. + +2005-12-16 Thomas Vander Stichele + + * m4/gst-arch.m4: + define HOST_CPU + +2005-11-29 Thomas Vander Stichele + + * check.mak: + add a valgrind-forever target for tests + +2005-11-28 Thomas Vander Stichele + + * check.mak: + when a "make test.check" run fails, make it rerun the test with + at least debug level 2 + +2005-11-14 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-check.m4: + fix check for base plugins + * m4/gst-default.m4: + add m4 to set default elements + +2005-10-18 Thomas Vander Stichele + + * m4/gst-check.m4: + check for tools correctly + +2005-10-18 Thomas Vander Stichele + + * gtk-doc.mak: + only enable breaking on new API when make distcheck passes, + not before + +2005-10-18 Thomas Vander Stichele + + * m4/gst-check.m4: + Resurrect Julien's dead body and wipe his mind clean + +2005-10-18 Thomas Vander Stichele + + * m4/gst-check.m4: + Kill Julien + +2005-10-17 Julien MOUTTE + + * m4/gst-check.m4: I know Thomas will kill me but this + ifelse statement seems incorrect as it is always setting + required to "yes". With this one it seems to work. Fixes + build of gst-plugins-base on my setup where gstreamer-check + is definitely not present/required. + +2005-10-18 Stefan Kost + + * gtk-doc.mak: + make build break on new api that has not been added to the + sections file + +2005-10-17 Thomas Vander Stichele + + * m4/gst-glib2.m4: + * m4/Makefile.am: + * m4/gst-check.m4: + add macro for easy checks for GStreamer libs + +2005-10-16 Thomas Vander Stichele + + * m4/gst-glib2.m4: + update, warn in error cases + +2005-10-16 Thomas Vander Stichele + + * m4/gst-error.m4: + add GST_SET_DEFAULT_LEVEL + +2005-10-16 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-gettext.m4: + remove the AM_GNU_GETTEXT* calls, they need to be in configure.ac + * m4/gst-glib2.m4: + clean up and re-use in core soon + * m4/gst-plugindir.m4: + macro to set up PLUGINDIR and plugindir define/var + +2005-10-15 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-gettext.m4: + add macro for setting up gettext + +2005-10-15 Thomas Vander Stichele + + * m4/gst-args.m4: + add some .m4's for argument checking that can be shared among modules + +2005-10-15 Thomas Vander Stichele + + * m4/as-libtool.m4: + set _LT_LDFLAGS + * m4/gst-libxml2.m4: + document + +2005-10-15 Thomas Vander Stichele + + * m4/gst-arch.m4: + indent a little + add AC_REQUIRE + * m4/gst-error.m4: + clean up + +2005-10-12 Thomas Vander Stichele + + * gst-autogen.sh: + update version detection expression to catch stuff like + Libtool (libtool15) 1.5.0 + +2005-10-11 Thomas Vander Stichele + + * gst.supp: + commit 6 new suppressions related to g_module_open; can these + really not be folded into one ? + +2005-10-11 Edward Hervey + + * gst.supp: + made the suppression more generic + Added pthread memleak suppresions + Added nss_parse_* memleak suppresion (used by g_option_context_parse) + +2005-10-11 Thomas Vander Stichele + + * check.mak: + be more strict, more leak resolution + * gst.supp: + clean up the g_type_init suppressions + +2005-10-07 Thomas Vander Stichele + + * m4/Makefile.am: + * m4/gst-valgrind.m4: + put the valgrind detection in an .m4 + +2005-09-29 Thomas Vander Stichele + + * check.mak: + add some more targets, like "help", but also more intensive tests + +2005-09-23 Thomas Vander Stichele + + * gtk-doc.mak: + make certain doc warnings fatal so people maintain docs again + +2005-09-23 Thomas Vander Stichele + + * Makefile.am: + * gtk-doc-plugins.mak: + * scangobj-merge.py: + merge additions from the .signals.new and .args.new file in + the original ones, only updating if necessary + +2005-09-23 Thomas Vander Stichele + + * gst-xmlinspect.py: + * gstdoc-scangobj: + * gtk-doc-plugins.mak: + fix properly for new API; make update in plugins dir now works + +2005-09-20 Thomas Vander Stichele + + * gst-xmlinspect.py: + * gstdoc-scangobj: + some fixes for new API + * gtk-doc-plugins.mak: + set environment properly + +2005-09-17 David Schleef + + * gtk-doc-plugins.mak: Use new environment variables. + +2005-09-16 Michael Smith + + * gstdoc-scangobj: + Make the scanobj code reflect registry/plugin API changes + +2005-09-15 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + split out scanobj step (which will be run by doc maintainer) + from scan step (which will be run on every build) + clean up some of the commands for make distcheck + +2005-09-15 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + * mangle-tmpl.py: + first stab at reorganizing the plugins build so we can maintain + element docs + +2005-09-14 David Schleef + + * as-libtool.mak: Remove + * m4/as-libtool.m4: The libtool bug that this worked around has + been fixed. + * m4/as-version.m4: Don't define GST_RELEASE, since it causes + config.h to be regenerated needlessly, and we don't use it. + +2005-09-14 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + error out on inspect failure + +2005-09-14 Michael Smith + + * glib-gen.mak: + Don't call glib-mkenums with arguments that confuse/break MinGW, + fixes 316155. + +2005-09-03 Thomas Vander Stichele + + * gtk-doc-plugins.mak: + * gtk-doc.mak: + * m4/gst-doc.m4: + separate out gtk-doc and docbook stuff + have two separate --enable configure flags + +2005-08-26 Thomas Vander Stichele + + * check.mak: + add a .gdb target; rebuild registry for each target, otherwise + a code rebuild always triggers a reg rebuild, and it's just too + annoying + * gstdoc-scangobj: + +2005-08-21 Thomas Vander Stichele + + * check.mak: + separate out REGISTRY_ENVIRONMENT; we want to use that from + our valgrind runs, but we also want TESTS_ENVIRONMENT to contain + everything that the first test, gst-register, needs + +2005-08-21 Thomas Vander Stichele + + * check.mak: + parse output of valgrind and check for definitely lost, and error + out; somehow I was led to believe valgrind returns non-zero for + leaks, but I can't make it do that, so let's parse + +2005-08-20 Thomas Vander Stichele + + * check.mak: + for some weird reason valgrind does not report actual memleaks + if GST_PLUGIN_PATH is set to anything but the core gstreamer dir + while valgrind is running. Since the registry is going to go + anyway, I don't want to waste any more time on this; I just run + valgrind without GST_PLUGIN_PATH set. Since the registry loading + doesn't check if GST_PLUGIN_PATH got changed as a reason to rebuild + the registry, that's actually fine. + +2005-08-15 Thomas Vander Stichele + + * mangle-tmpl.py: + keep original Long_Description; only insert an include if it's + not already the first line in there + * plugins.xsl: + output more information for plugins, including an origin hyperlink + +2005-08-15 Thomas Vander Stichele + + * gst-xmlinspect.py: + a first stab at inspecting plugins and outputting an xml description + * gtk-doc-plugins.mak: + a gtk-doc using snippet for plugins documentation + * plugins.xsl: + a stylesheet to convert gst-xmlinspect.py output to docbook output + for inclusion in the gtk-doc stuff + +2005-07-20 Ronald S. Bultje + + * m4/gst-doc.m4: + s/pdf/eps/ in test for whether we output EPS images (#309379). + +2005-07-18 Andy Wingo + + * m4/as-libtool-tags.m4: Ooh, backported from libtool 1.6. Much + better. Thanks, Paolo Bonzini! + + * m4/Makefile.am (EXTRA_DIST): + * m4/as-libtool-tags.m4: New file, tries to disable some CXX and + fortran checks. + +2005-07-08 Thomas Vander Stichele + + * m4/gst-error.m4: + add macro to set ERROR_CFLAGS + +2005-06-30 Jan Schmidt + + * gst-autogen.sh: + Remove the old autoregen.sh if it exists before recreating it, + to prevent confusing any shell process that might be reading it + currently. + +2005-06-29 Thomas Vander Stichele + + * m4/gtk-doc.m4: + added + +2005-06-03 Stefan Kost + + * gst-autogen.sh: create autoregen.sh *before* shifting the options + +2005-05-17 Thomas Vander Stichele + + * gst-autogen.sh: only update autoregen.sh on actual runs + +2005-03-11 Thomas Vander Stichele + + * m4/check.m4: m4 from the check unit test suite + +2004-12-14 David Schleef + + * m4/gst-arch.m4: remove MMX stuff, since it doesn't work and + isn't needed anywhere + +2004-12-08 Thomas Vander Stichele + + * gst-autogen.sh: + allow failure command to be run so we can clean upfrom autopoint + +2004-09-03 Zeeshan Ali Khattak + * m4/gst-feature.m4: Trying to correct the GST_CHECK_CONFIGPROG macro + +2004-07-21 Benjamin Otte + + * m4/.cvsignore: exciting updates for libtool m4 files + +2004-07-12 David Schleef + + * m4/as-objc.m4: Add a macro to test for objective C + +2004-06-12 Thomas Vander Stichele + + * m4/gst-feature.m4: + not all of them support --plugin-libs, so redirect stderr + +2004-06-12 Thomas Vander Stichele + + * m4/as-scrub-include.m4: + sync with upstream to 0.1.4. Fixes #132440 + +2004-06-07 Benjamin Otte + + * m4/gst-feature.m4: + write a big marker into configure output when checking next plugin + to allow easier parsing of why plugins are(n't) built. + +2004-06-01 Thomas Vander Stichele + + * m4/as-compiler-flag.m4: + * m4/as-compiler.m4: + * m4/as-libtool.m4: + * m4/as-version.m4: + sync with upstream, change sticky options to -ko + +2004-05-24 Thomas Vander Stichele + + * m4/as-scrub-include.m4: synced with upstream + +2004-05-03 Thomas Vander Stichele + + * po.mak: + snippet for updating .po files + +2004-03-18 Thomas Vander Stichele + + * Makefile.am: + * m4/Makefile.am: + integrate these with the dist + +2004-03-17 Thomas Vander Stichele + + * release.mak: add a release target + +2004-03-09 Thomas Vander Stichele + + patch by: Stephane Loeuillet + + * m4/ax_create_stdint_h.m4: + use head -n instead of head - (#136500) + +2004-03-05 Thomas Vander Stichele + + * m4/gst-doc.m4: don't build PS without dvips binary + +2004-02-22 Julio M. Merino Vidal + + reviewed by: Benjamin Otte + + * m4/as-docbook.m4: + don't use == operator with test(1) (fixes #135115) + +2004-02-16 Thomas Vander Stichele + + * common/m4/gst-arch.m4: x86_64 is x86 too (clue from Fedora 2 test) + +2004-02-13 Thomas Vander Stichele + + * m4/gst-feature.m4: + remove AM_CONDITIONAL for the subsystem since automake 1.6.x + requires that call be in configure.ac + +2004-02-13 Thomas Vander Stichele + + * m4/gst-libxml2.m4: + take required version as argument, and default to 2.4.9 if not + specified + +2004-02-12 Thomas Vander Stichele + + * m4/gst-feature.m4: + rename and fix up GST_CHECK_DISABLE_SUBSYSTEM + +2004-02-11 Thomas Vander Stichele + + * common/m4/as-ac-expand.m4: + * common/m4/as-auto-alt.m4: + * common/m4/as-compiler-flag.m4: + * common/m4/as-compiler.m4: + * common/m4/as-docbook.m4: + * common/m4/as-libtool.m4: + * common/m4/as-scrub-include.m4: + * common/m4/as-version.m4: + * common/m4/glib-gettext.m4: + * common/m4/gst-arch.m4: + * common/m4/gst-debuginfo.m4: + * common/m4/gst-doc.m4: + * common/m4/gst-feature.m4: + * common/m4/gst-function.m4: + * common/m4/gst-glib2.m4: + * common/m4/gst-gstreamer.m4: + * common/m4/gst-libxml2.m4: + * common/m4/gst-makecontext.m4: + * common/m4/gst-mcsc.m4: + * common/m4/pkg.m4: + fix underquoted macros as reported by automake 1.8.x (#133800) + +2004-02-11 Johan Dahlin + + * gst-autogen.sh: Use A-Z instead of A-z in sed expression to + avoid a warning + +2004-02-05 Thomas Vander Stichele + + * m4/gst-doc.m4: + we use --output-format=xml and --ingnore-files options to + gtkdoc-mkdb, which got added between 0.9 and 1.0 + +2004-02-04 Thomas Vander Stichele + + * m4/as-libtool.m4: remove AM_PROG_LIBTOOL so it can move back + to configure.ac to shut up libtoolize + +2004-02-03 Thomas Vander Stichele + + * glib-gen.mak: added; used to generate enums and marshal code + +2004-01-13 Thomas Vander Stichele + + * gettext.patch: added; used by autogen.sh to make sure + GETTEXT_PACKAGE is understood from po/Makefile.in.in -> po/Makefile.in + diff --git a/common/Makefile.am b/common/Makefile.am new file mode 100644 index 0000000..25966fc --- /dev/null +++ b/common/Makefile.am @@ -0,0 +1,22 @@ +SUBDIRS = m4 + +EXTRA_DIST = \ + ChangeLog \ + gettext.patch \ + glib-gen.mak gtk-doc.mak upload-doc.mak \ + cruft.mak release.mak win32.mak po.mak \ + parallel-subdirs.mak \ + gst-autogen.sh \ + check-exports \ + c-to-xml.py mangle-tmpl.py scangobj-merge.py \ + gtk-doc-plugins.mak \ + plugins.xsl gstdoc-scangobj \ + gst.supp check.mak \ + coverage/lcov.mak \ + coverage/coverage-report.pl \ + coverage/coverage-report.xsl \ + coverage/coverage-report-entry.pl \ + download-translations \ + extract-release-date-from-doap-file \ + gst-indent \ + orc.mak diff --git a/common/Makefile.in b/common/Makefile.in new file mode 100644 index 0000000..b4465d3 --- /dev/null +++ b/common/Makefile.in @@ -0,0 +1,756 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = common +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ChangeLog \ + README +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-docbook.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-doc.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/introspection.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAT_ENTRY_END = @CAT_ENTRY_END@ +CAT_ENTRY_START = @CAT_ENTRY_START@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPD_PLUGINS_DIR = @GSTPD_PLUGINS_DIR@ +GSTPG_PLUGINS_DIR = @GSTPG_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALL_CFLAGS = @GST_ALL_CFLAGS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_ALL_LIBS = @GST_ALL_LIBS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OBJ_CFLAGS = @GST_OBJ_CFLAGS@ +GST_OBJ_LIBS = @GST_OBJ_LIBS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PKG_CONFIG_PATH = @GST_PKG_CONFIG_PATH@ +GST_PLUGINS_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@ +GST_PLUGINS_BAD_DIR = @GST_PLUGINS_BAD_DIR@ +GST_PLUGINS_BAD_LIBS = @GST_PLUGINS_BAD_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@ +GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@ +GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ +HAVE_DVIPS = @HAVE_DVIPS@ +HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ +HAVE_JADETEX = @HAVE_JADETEX@ +HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ +HAVE_PNMTOPS = @HAVE_PNMTOPS@ +HAVE_PS2PDF = @HAVE_PS2PDF@ +HAVE_XMLLINT = @HAVE_XMLLINT@ +HAVE_XSLTPROC = @HAVE_XSLTPROC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCGROUP_CFLAGS = @LIBCGROUP_CFLAGS@ +LIBCGROUP_LIBS = @LIBCGROUP_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XML_CATALOG = @XML_CATALOG@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = m4 +EXTRA_DIST = \ + ChangeLog \ + gettext.patch \ + glib-gen.mak gtk-doc.mak upload-doc.mak \ + cruft.mak release.mak win32.mak po.mak \ + parallel-subdirs.mak \ + gst-autogen.sh \ + check-exports \ + c-to-xml.py mangle-tmpl.py scangobj-merge.py \ + gtk-doc-plugins.mak \ + plugins.xsl gstdoc-scangobj \ + gst.supp check.mak \ + coverage/lcov.mak \ + coverage/coverage-report.pl \ + coverage/coverage-report.xsl \ + coverage/coverage-report-entry.pl \ + download-translations \ + extract-release-date-from-doap-file \ + gst-indent \ + orc.mak + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + 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 || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + 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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean 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-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-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: diff --git a/common/README b/common/README new file mode 100644 index 0000000..83a1b88 --- /dev/null +++ b/common/README @@ -0,0 +1,255 @@ +GStreamer @SERIES_VERSION@ + +WHAT IT IS +---------- + +This is GStreamer, a framework for streaming media. + +WHERE TO START +-------------- + +We have a website at +http://gstreamer.freedesktop.org/ + +You should start by going through our FAQ at +http://gstreamer.freedesktop.org/data/doc/gstreamer/head/faq/html/ + +There is more documentation; go to +http://gstreamer.freedesktop.org/documentation + +You can subscribe to our mailing lists; see the website for details. + +We track bugs in GNOME's bugzilla; see the website for details. + +You can join us on IRC - #gstreamer on irc.freenode.org + +GStreamer 1.0 series +-------------------- + +Starring + + GSTREAMER + +The core around which all other modules revolve. Base functionality and +libraries, some essential elements, documentation, and testing. + + BASE + +A well-groomed and well-maintained collection of GStreamer plug-ins and +elements, spanning the range of possible types of elements one would want +to write for GStreamer. + +And introducing, for the first time ever, on the development screen ... + + THE GOOD + + --- "Such ingratitude. After all the times I've saved your life." + +A collection of plug-ins you'd want to have right next to you on the +battlefield. Shooting sharp and making no mistakes, these plug-ins have it +all: good looks, good code, and good licensing. Documented and dressed up +in tests. If you're looking for a role model to base your own plug-in on, +here it is. + +If you find a plot hole or a badly lip-synced line of code in them, +let us know - it is a matter of honour for us to ensure Blondie doesn't look +like he's been walking 100 miles through the desert without water. + + THE UGLY + + --- "When you have to shoot, shoot. Don't talk." + +There are times when the world needs a color between black and white. +Quality code to match the good's, but two-timing, backstabbing and ready to +sell your freedom down the river. These plug-ins might have a patent noose +around their neck, or a lock-up license, or any other problem that makes you +think twice about shipping them. + +We don't call them ugly because we like them less. Does a mother love her +son less because he's not as pretty as the other ones ? No - she commends +him on his great personality. These plug-ins are the life of the party. +And we'll still step in and set them straight if you report any unacceptable +behaviour - because there are two kinds of people in the world, my friend: +those with a rope around their neck and the people who do the cutting. + + THE BAD + + --- "That an accusation?" + +No perfectly groomed moustache or any amount of fine clothing is going to +cover up the truth - these plug-ins are Bad with a capital B. +They look fine on the outside, and might even appear to get the job done, but +at the end of the day they're a black sheep. Without a golden-haired angel +to watch over them, they'll probably land in an unmarked grave at the final +showdown. + +Don't bug us about their quality - exercise your Free Software rights, +patch up the offender and send us the patch on the fastest steed you can +steal from the Confederates. Because you see, in this world, there's two +kinds of people, my friend: those with loaded guns and those who dig. +You dig. + +The Lowdown +----------- + + --- "I've never seen so many plug-ins wasted so badly." + +GStreamer Plug-ins has grown so big that it's hard to separate the wheat from +the chaff. Also, distributors have brought up issues about the legal status +of some of the plug-ins we ship. To remedy this, we've divided the previous +set of available plug-ins into four modules: + +- gst-plugins-base: a small and fixed set of plug-ins, covering a wide range + of possible types of elements; these are continuously kept up-to-date + with any core changes during the development series. + + - We believe distributors can safely ship these plug-ins. + - People writing elements should base their code on these elements. + - These elements come with examples, documentation, and regression tests. + +- gst-plugins-good: a set of plug-ins that we consider to have good quality + code, correct functionality, our preferred license (LGPL for the plug-in + code, LGPL or LGPL-compatible for the supporting library). + + - We believe distributors can safely ship these plug-ins. + - People writing elements should base their code on these elements. + +- gst-plugins-ugly: a set of plug-ins that have good quality and correct + functionality, but distributing them might pose problems. The license + on either the plug-ins or the supporting libraries might not be how we'd + like. The code might be widely known to present patent problems. + + - Distributors should check if they want/can ship these plug-ins. + - People writing elements should base their code on these elements. + +- gst-plugins-bad: a set of plug-ins that aren't up to par compared to the + rest. They might be close to being good quality, but they're missing + something - be it a good code review, some documentation, a set of tests, + a real live maintainer, or some actual wide use. + If the blanks are filled in they might be upgraded to become part of + either gst-plugins-good or gst-plugins-ugly, depending on the other factors. + + - If the plug-ins break, you can't complain - instead, you can fix the + problem and send us a patch, or bribe someone into fixing them for you. + - New contributors can start here for things to work on. + +PLATFORMS +--------- + +- Linux is of course fully supported +- FreeBSD is reported to work; other BSDs should work too +- Solaris is reported to work; a specific sunaudiosink plugin has been written +- MacOSX works, binary 1.x packages can be built using the cerbero build tool +- Windows works; binary 1.x packages can be built using the cerbero build tool + - MSys/MinGW builds + - Microsoft Visual Studio builds are not yet available or supported +- Android works, binary 1.x packages can be built using the cerbero build tool +- iOS works + +INSTALLING FROM PACKAGES +------------------------ + +You should always prefer installing from packages first. GStreamer is +well-maintained for a number of distributions, including Fedora, Debian, +Ubuntu, Mandrake, Gentoo, ... + +Only in cases where you: +- want to hack on GStreamer +- want to verify that a bug has been fixed +- do not have a sane distribution +should you choose to build from source tarballs or git. + +Find more information about the various packages at +http://gstreamer.freedesktop.org/download/ + +COMPILING FROM SOURCE TARBALLS +------------------------------ + +- again, make sure that you really need to install from source ! + If GStreamer is one of your first projects ever that you build from source, + consider taking on an easier project. + +- check output of ./configure --help to see if any options apply to you +- run + ./configure + make + + to build GStreamer. +- if you want to install it (not required, but what you usually want to do), run + make install + +- try out a simple test: + gst-launch -v fakesrc num_buffers=5 ! fakesink + (If you didn't install GStreamer, prefix gst-launch with tools/) + + If it outputs a bunch of messages from fakesrc and fakesink, everything is + ok. + + If it did not work, keep in mind that you might need to adjust the + PATH and/or LD_LIBRARY_PATH environment variables to make the system + find GStreamer in the prefix where you installed (by default that is /usr/local). + +- After this, you're ready to install gst-plugins, which will provide the + functionality you're probably looking for by now, so go on and read + that README. + +COMPILING FROM GIT +------------------ + +When building from git sources, you will need to run autogen.sh to generate +the build system files. + +You will need a set of additional tools typical for building from git, +including: +- autoconf +- automake +- libtool + +autogen.sh will check for recent enough versions and complain if you don't have +them. You can also specify specific versions of automake and autoconf with +--with-automake and --with-autoconf + +Check autogen.sh options by running autogen.sh --help + +autogen.sh can pass on arguments to configure + +When you have done this once, you can use autoregen.sh to re-autogen with +the last passed options as a handy shortcut. Use it. + +After the autogen.sh stage, you can follow the directions listed in +"COMPILING FROM SOURCE" + +You can also run your whole git stack uninstalled in your home directory, +so that you can quickly test changes without affecting your system setup or +interfering with GStreamer installed from packages. Many GStreamer developers +use an uninstalled setup for their work. + +There is a 'create-uninstalled-setup.sh' script in + + http://cgit.freedesktop.org/gstreamer/gstreamer/tree/scripts/ + +to easily create an uninstalled setup from scratch. + + +PLUG-IN DEPENDENCIES AND LICENSES +--------------------------------- + +GStreamer is developed under the terms of the LGPL (see LICENSE file for +details). Some of our plug-ins however rely on libraries which are available +under other licenses. This means that if you are distributing an application +which has a non-GPL compatible license (for instance a closed-source +application) with GStreamer, you have to make sure not to distribute GPL-linked +plug-ins. + +When using GPL-linked plug-ins, GStreamer is for all practical reasons +under the GPL itself. + +HISTORY +------- + +The fundamental design comes from the video pipeline at Oregon Graduate +Institute, as well as some ideas from DirectMedia. It's based on plug-ins that +will provide the various codec and other functionality. The interface +hopefully is generic enough for various companies (ahem, Apple) to release +binary codecs for Linux, until such time as they get a clue and release the +source. diff --git a/common/c-to-xml.py b/common/c-to-xml.py new file mode 100644 index 0000000..7a7a35b --- /dev/null +++ b/common/c-to-xml.py @@ -0,0 +1,36 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +""" +Convert a C program to valid XML to be included in docbook +""" + +from __future__ import print_function, unicode_literals + +import sys +import os +from xml.sax import saxutils + +def main(): + if len(sys.argv) == 1: + sys.stderr.write("Please specify a source file to convert") + sys.exit(1) + source = sys.argv[1] + + if not os.path.exists(source): + sys.stderr.write("%s does not exist.\n" % source) + sys.exit(1) + + content = open(source, "r").read() + + # print header + print ('') + print ('') + print () + print ('') + + # print content + print (saxutils.escape(content)) + print ('') + +main() diff --git a/common/check-exports b/common/check-exports new file mode 100755 index 0000000..ee01ff7 --- /dev/null +++ b/common/check-exports @@ -0,0 +1,54 @@ +#!/bin/sh +# check-exports +# +# quick'n'dirty script that retrieves the list of exported symbols of a given +# library using 'nm', and compares that against the list of symbols-to-export +# of our win32/common/libfoo.def files. + +if [ $# -ne 2 ]; then + echo "Usage: $0 library.def library.so" + exit 1 +fi + +def_path="$1" +def_name="$(basename $def_path)" +lib_path="$2" + +lib_result="`mktemp /tmp/defname.XXXXXX`" + +LC_ALL=C +export LC_ALL + +# On Solaris, add -p to get the correct output format +NMARGS= +if nm -V 2>&1 |grep Solaris > /dev/null; then + NMARGS=-p +fi + +# _end is special cased because for some reason it is reported as an exported +# BSS symbol, unlike on linux where it's a local absolute symbol. +nm $NMARGS $lib_path | awk \ + '{ + if ($3 ~ /^[_]?(gst_|Gst|GST_).*/) + { + if ($2 ~ /^[BSDG]$/) + print "\t" $3 " DATA" + else if ($2 == "T") + print "\t" $3 + } + }' | sort | awk '{ if (NR == 1) print "EXPORTS"; print $0; }' \ + > $lib_result + +diffoutput=`diff -u $def_path $lib_result` +diffresult=$? + +rm $lib_result + +if test "$diffresult" -eq 0; then + exit 0; +else + echo -n "$diffoutput" >&2 + echo >&2 + exit 1; +fi + diff --git a/common/check.mak b/common/check.mak new file mode 100644 index 0000000..611546a --- /dev/null +++ b/common/check.mak @@ -0,0 +1,252 @@ +# keep target around, since it's referenced in the modules' Makefiles +clean-local-check: + @echo + +if HAVE_VALGRIND +# hangs spectacularly on some machines, so let's not do this by default yet +check-valgrind: + $(MAKE) valgrind +else +check-valgrind: + @true +endif + +LOOPS ?= 10 + +# run any given test by running make test.check +# if the test fails, run it again at at least debug level 2 +%.check: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $* || \ + $(TESTS_ENVIRONMENT) \ + GST_DEBUG=$$GST_DEBUG,*:2 \ + CK_DEFAULT_TIMEOUT=20 \ + $* + +# just like 'check', but don't run it again if it fails (useful for debugging) +%.check-norepeat: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $* + +# run any given test in a loop +%.torture: % + @for i in `seq 1 $(LOOPS)`; do \ + $(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $*; done + +# run any given test in an infinite loop +%.forever: % + @while true; do \ + $(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $* || break; done + +# valgrind any given test by running make test.valgrind +%.valgrind: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=360 \ + G_SLICE=always-malloc \ + $(LIBTOOL) --mode=execute \ + $(VALGRIND_PATH) -q \ + $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ + --tool=memcheck --leak-check=full --trace-children=yes \ + --show-possibly-lost=no \ + --leak-resolution=high --num-callers=20 \ + ./$* 2>&1 | tee valgrind.log + @if grep "==" valgrind.log > /dev/null 2>&1; then \ + rm valgrind.log; \ + exit 1; \ + fi + @rm valgrind.log + +# valgrind any given test and generate suppressions for it +%.valgrind.gen-suppressions: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=360 \ + G_SLICE=always-malloc \ + $(LIBTOOL) --mode=execute \ + $(VALGRIND_PATH) -q \ + $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ + --tool=memcheck --leak-check=full --trace-children=yes \ + --show-possibly-lost=no \ + --leak-resolution=high --num-callers=20 \ + --gen-suppressions=all \ + ./$* 2>&1 | tee suppressions.log + +# valgrind torture any given test +%.valgrind-torture: % + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) $*.valgrind || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# valgrind any given test until failure by running make test.valgrind-forever +%.valgrind-forever: % + @while $(MAKE) $*.valgrind; do \ + true; done + +# gdb any given test by running make test.gdb +%.gdb: % + @$(TESTS_ENVIRONMENT) \ + CK_FORK=no \ + $(LIBTOOL) --mode=execute \ + gdb $* + +%.lcov-reset: + $(MAKE) $*.lcov-run + $(MAKE) $*.lcov-report + +%.lcov: % + $(MAKE) $*.lcov-reset + +if GST_GCOV_ENABLED +%.lcov-clean: + $(MAKE) -C $(top_builddir) lcov-clean + +%.lcov-run: + $(MAKE) $*.lcov-clean + $(MAKE) $*.check + +%.lcov-report: + $(MAKE) -C $(top_builddir) lcov-report +else +%.lcov-run: + echo "Need to reconfigure with --enable-gcov" + +%.lcov-report: + echo "Need to reconfigure with --enable-gcov" +endif + +# torture tests +torture: $(TESTS) + -rm test-registry.* + @echo "Torturing tests ..." + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) check || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# forever tests +forever: $(TESTS) + -rm test-registry.* + @echo "Forever tests ..." + @while true; do \ + $(MAKE) check || \ + (echo "Failure"; exit 1) || \ + exit 1; \ + done + +# valgrind all tests +valgrind: $(TESTS) + @echo "Valgrinding tests ..." + @failed=0; \ + for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \ + $(MAKE) $$t.valgrind; \ + if test "$$?" -ne 0; then \ + echo "Valgrind error for test $$t"; \ + failed=`expr $$failed + 1`; \ + whicht="$$whicht $$t"; \ + fi; \ + done; \ + if test "$$failed" -ne 0; then \ + echo "$$failed tests had leaks or errors under valgrind:"; \ + echo "$$whicht"; \ + false; \ + fi + +# valgrind all tests until failure +valgrind-forever: $(TESTS) + -rm test-registry.* + @echo "Forever valgrinding tests ..." + @while true; do \ + $(MAKE) valgrind || \ + (echo "Failure"; exit 1) || \ + exit 1; \ + done + +# valgrind torture all tests +valgrind-torture: $(TESTS) + -rm test-registry.* + @echo "Torturing and valgrinding tests ..." + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) valgrind || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# valgrind all tests and generate suppressions +valgrind.gen-suppressions: $(TESTS) + @echo "Valgrinding tests ..." + @failed=0; \ + for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \ + $(MAKE) $$t.valgrind.gen-suppressions; \ + if test "$$?" -ne 0; then \ + echo "Valgrind error for test $$t"; \ + failed=`expr $$failed + 1`; \ + whicht="$$whicht $$t"; \ + fi; \ + done; \ + if test "$$failed" -ne 0; then \ + echo "$$failed tests had leaks or errors under valgrind:"; \ + echo "$$whicht"; \ + false; \ + fi + +# inspect every plugin feature +GST_INSPECT = $(GST_TOOLS_DIR)/gst-inspect-$(GST_API_VERSION) +inspect: + @echo "Inspecting features ..." + @for e in `$(TESTS_ENVIRONMENT) $(GST_INSPECT) | head -n -2 \ + | cut -d: -f2`; \ + do echo Inspecting $$e; \ + $(GST_INSPECT) $$e > /dev/null 2>&1; done + +help: + @echo + @echo "make check -- run all checks" + @echo "make torture -- run all checks $(LOOPS) times" + @echo "make (dir)/(test).check -- run the given check once, repeat with GST_DEBUG=*:2 if it fails" + @echo "make (dir)/(test).check-norepeat -- run the given check once, but don't run it again if it fails" + @echo "make (dir)/(test).forever -- run the given check forever" + @echo "make (dir)/(test).torture -- run the given check $(LOOPS) times" + @echo + @echo "make (dir)/(test).gdb -- start up gdb for the given test" + @echo + @echo "make valgrind -- valgrind all tests" + @echo "make valgrind-forever -- valgrind all tests forever" + @echo "make valgrind-torture -- valgrind all tests $(LOOPS) times" + @echo "make valgrind.gen-suppressions -- generate suppressions for all tests" + @echo " and save to suppressions.log" + @echo "make (dir)/(test).valgrind -- valgrind the given test" + @echo "make (dir)/(test).valgrind-forever -- valgrind the given test forever" + @echo "make (dir)/(test).valgrind-torture -- valgrind the given test $(LOOPS) times" + @echo "make (dir)/(test).valgrind.gen-suppressions -- generate suppressions" + @echo " and save to suppressions.log" + @echo "make inspect -- inspect all plugin features" + @echo + @echo + @echo "Additionally, you can use the GST_CHECKS environment variable to" + @echo "specify which test(s) should be run. This is useful if you are" + @echo "debugging a failure in one particular test, or want to reproduce" + @echo "a race condition in a single test." + @echo + @echo "Examples:" + @echo + @echo " GST_CHECKS=test_this,test_that make element/foobar.check" + @echo " GST_CHECKS=test_many_threads make element/foobar.forever" + @echo + diff --git a/common/coverage/coverage-report-entry.pl b/common/coverage/coverage-report-entry.pl new file mode 100644 index 0000000..d0036b3 --- /dev/null +++ b/common/coverage/coverage-report-entry.pl @@ -0,0 +1,69 @@ +#!/usr/bin/perl +# +# Copyright (C) 2006 Daniel Berrange +# +# 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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +print < + +Coverage report for $ARGV[0] + + + +

Coverage report for $ARGV[0]

+ +
+EOF
+
+
+while (<>) {
+    s/&/&/g;
+    s//>/g;
+
+    if (/^\s*function (\S+) called (\d+) returned \d+% blocks executed \d+%/) {
+	my $class = $2 > 0 ? "perfect" : "terrible";
+	$_ = "$_";
+    } elsif (/^\s*branch\s+\d+\s+taken\s+(\d+)%\s+.*$/) {
+	my $class = $1 > 0 ? "perfect" : "terrible";
+	$_ = "$_";
+    } elsif (/^\s*branch\s+\d+\s+never executed.*$/) {
+	my $class = "terrible";
+	$_ = "$_";
+    } elsif (/^\s*call\s+\d+\s+never executed.*$/) {
+	my $class = "terrible";
+	$_ = "$_";
+    } elsif (/^\s*call\s+\d+\s+returned\s+(\d+)%.*$/) {
+	my $class = $1 > 0 ? "perfect" : "terrible";
+	$_ = "$_";
+    }
+
+    print;
+}
+
+print <
+
+
+EOF
diff --git a/common/coverage/coverage-report.pl b/common/coverage/coverage-report.pl
new file mode 100644
index 0000000..18bd6f1
--- /dev/null
+++ b/common/coverage/coverage-report.pl
@@ -0,0 +1,125 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2006 Daniel Berrange
+#
+# 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 St, Fifth Floor, Boston, MA  02110-1301  USA
+
+use warnings;
+use strict;
+
+my %coverage = ( functions => {}, files => {} );
+
+my %filemap;
+
+my $type;
+my $name;
+
+my @functions;
+
+while (<>) {
+    if (/^Function '(.*)'\s*$/) {
+	$type = "function";
+	$name = $1;
+	$coverage{$type}->{$name} = {};
+	push @functions, $name;
+    } elsif (/^File '(.*?)'\s*$/) {
+	$type = "file";
+	$name = $1;
+	$coverage{$type}->{$name} = {};
+
+	foreach my $func (@functions) {
+	    $coverage{"function"}->{$func}->{file} = $name;
+	}
+	@functions = ();
+    } elsif (/^Lines executed:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{lines} = $2;
+	$coverage{$type}->{$name}->{linesCoverage} = $1;
+    } elsif (/^Branches executed:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{branches} = $2;
+	$coverage{$type}->{$name}->{branchesCoverage} = $1;
+    } elsif (/^Taken at least once:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{conds} = $2;
+	$coverage{$type}->{$name}->{condsCoverage} = $1;
+    } elsif (/^Calls executed:(.*)%\s*of\s*(\d+)\s*$/) {
+	$coverage{$type}->{$name}->{calls} = $2;
+	$coverage{$type}->{$name}->{callsCoverage} = $1;
+    } elsif (/^No branches$/) {
+	$coverage{$type}->{$name}->{branches} = 0;
+	$coverage{$type}->{$name}->{branchesCoverage} = "100.00";
+	$coverage{$type}->{$name}->{conds} = 0;
+	$coverage{$type}->{$name}->{condsCoverage} = "100.00";
+    } elsif (/^No calls$/) {
+	$coverage{$type}->{$name}->{calls} = 0;
+	$coverage{$type}->{$name}->{callsCoverage} = "100.00";
+    } elsif (/^\s*(.*):creating '(.*)'\s*$/) {
+	$filemap{$1} = $2;
+    } elsif (/^\s*$/) {
+	# nada
+    } else {
+	warn "Shit [$_]\n";
+    }
+}
+
+my %summary;
+foreach my $type ("function", "file") {
+    $summary{$type} = {};
+    foreach my $m ("lines", "branches", "conds", "calls") {
+	my $totalGot = 0;
+	my $totalMiss = 0;
+	my $count = 0;
+	foreach my $func (keys %{$coverage{function}}) {
+	    $count++;
+	    my $got = $coverage{function}->{$func}->{$m};
+	    $totalGot += $got;
+	    my $miss = $got * $coverage{function}->{$func}->{$m ."Coverage"} / 100;
+	    $totalMiss += $miss;
+	}
+	$summary{$type}->{$m} = sprintf("%d", $totalGot);
+	$summary{$type}->{$m . "Coverage"} = sprintf("%.2f", $totalMiss / $totalGot * 100);
+    }
+}
+
+
+
+print "\n";
+
+foreach my $type ("function", "file") {
+    printf "<%ss>\n", $type;
+    foreach my $name (sort { $a cmp $b } keys %{$coverage{$type}}) {
+	my $rec = $coverage{$type}->{$name};
+	printf "  \n", $name, ($type eq "file" ? $filemap{$name} : $filemap{$rec->{file}});
+	printf "    \n", $rec->{lines}, $rec->{linesCoverage};
+	if (exists $rec->{branches}) {
+	    printf "    \n", $rec->{branches}, $rec->{branchesCoverage};
+	}
+	if (exists $rec->{conds}) {
+	    printf "    \n", $rec->{conds}, $rec->{condsCoverage};
+	}
+	if (exists $rec->{calls}) {
+	    printf "    \n", $rec->{calls}, $rec->{callsCoverage};
+	}
+	print  "  \n";
+    }
+
+    printf "  \n";
+    printf "    \n", $summary{$type}->{lines}, $summary{$type}->{linesCoverage};
+    printf "    \n", $summary{$type}->{branches}, $summary{$type}->{branchesCoverage};
+    printf "    \n", $summary{$type}->{conds}, $summary{$type}->{condsCoverage};
+    printf "    \n", $summary{$type}->{calls}, $summary{$type}->{callsCoverage};
+    printf  "  \n";
+    printf "\n", $type;
+}
+
+print "\n";
diff --git a/common/coverage/coverage-report.xsl b/common/coverage/coverage-report.xsl
new file mode 100644
index 0000000..3fe124b
--- /dev/null
+++ b/common/coverage/coverage-report.xsl
@@ -0,0 +1,235 @@
+
+
+
+
+  
+
+  
+    
+      
+        Coverage report
+        
+      
+      
+        

Coverage report

+ + + +
+ + +

Function coverage

+ + + +
+ + + +

File coverage

+ + + +
+ + + + + + + + + + + + + + + + + + + + + odd + + + even + + + + + + + + + + + + + + odd + + + even + + + + + + +
NameLinesBranchesConditionsCalls
+
+ + + + + + + + + + + + + + Summary + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + perfect + + + excellant + + + good + + + poor + + + bad + + + terrible + + + + + % of + + +
diff --git a/common/coverage/lcov.mak b/common/coverage/lcov.mak new file mode 100644 index 0000000..b45728a --- /dev/null +++ b/common/coverage/lcov.mak @@ -0,0 +1,47 @@ +## .PHONY so it always rebuilds it +.PHONY: lcov-reset lcov lcov-run lcov-report lcov-upload lcov-clean + +# run lcov from scratch, always +lcov-reset: + $(MAKE) lcov-run + $(MAKE) lcov-report + +# run lcov from scratch if the dir is not there +lcov: + $(MAKE) lcov-reset + +if GST_GCOV_ENABLED +# reset lcov stats +lcov-clean: + @-rm -rf lcov + lcov --directory . --zerocounters + +# reset run coverage tests +lcov-run: + -$(MAKE) lcov-clean + -if test -d tests/check; then $(MAKE) -C tests/check inspect; fi + -$(MAKE) check + +# generate report based on current coverage data +lcov-report: + mkdir lcov + lcov --compat-libtool --directory . --capture --output-file lcov/lcov.info + lcov --list-full-path -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d\| -f1 > lcov/remove + lcov --list-full-path -l lcov/lcov.info | grep "tests/check/" | cut -d\| -f1 >> lcov/remove + lcov --list-full-path -l lcov/lcov.info | grep "docs/plugins/" | cut -d\| -f1 >> lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov --num-spaces 2 lcov/lcov.info + +lcov-upload: lcov + rsync -rvz -e ssh --delete lcov/* gstreamer.freedesktop.org:/srv/gstreamer.freedesktop.org/www/data/coverage/lcov/$(PACKAGE) + +else +lcov-run: + echo "Need to reconfigure with --enable-gcov" + +lcov-report: + echo "Need to reconfigure with --enable-gcov" +endif + diff --git a/common/cruft.mak b/common/cruft.mak new file mode 100644 index 0000000..53eec24 --- /dev/null +++ b/common/cruft.mak @@ -0,0 +1,56 @@ +# checks for left-over files in the (usually uninstalled) tree, ie. for +# stuff that best be deleted to avoid problems like having old plugin binaries +# lying around. +# +# set CRUFT_FILES and/or CRUFT_DIRS in your Makefile.am when you include this + +check-cruft: + @cruft_files=""; cruft_dirs=""; \ + for f in $(CRUFT_FILES); do \ + if test -e $$f; then \ + cruft_files="$$cruft_files $$f"; \ + fi \ + done; \ + for d in $(CRUFT_DIRS); do \ + if test -e $$d; then \ + cruft_dirs="$$cruft_dirs $$d"; \ + fi \ + done; \ + if test "x$$cruft_files$$cruft_dirs" != x; then \ + echo; \ + echo "**** CRUFT ALERT *****"; \ + echo; \ + echo "The following files and directories may not be needed any "; \ + echo "longer (usually because a plugin has been merged into "; \ + echo "another plugin, moved to a different module, or been "; \ + echo "renamed), and you probably want to clean them up if you "; \ + echo "don't have local changes: "; \ + echo; \ + for f in $$cruft_files; do echo "file $$f"; done; \ + echo; \ + for d in $$cruft_dirs; do echo "directory $$d"; done; \ + echo; \ + echo "'make clean-cruft' will remove these for you."; \ + echo; \ + fi + +clean-cruft-dirs: + @for d in $(CRUFT_DIRS); do \ + if test -e $$d; then \ + rm -r "$$d" && echo "Removed directory $$d"; \ + fi \ + done + +clean-cruft-files: + @for f in $(CRUFT_FILES); do \ + if test -e $$f; then \ + rm "$$f" && echo "Removed file $$f"; \ + fi \ + done + +clean-cruft: clean-cruft-dirs clean-cruft-files + +# also might want to add this to your Makefile.am: +# +# all-local: check-cruft + diff --git a/common/download-translations b/common/download-translations new file mode 100755 index 0000000..aef1d31 --- /dev/null +++ b/common/download-translations @@ -0,0 +1,152 @@ +#!/bin/sh +# Shell script to download the latest translations for a given GStreamer +# package from translationproject.org + + +# DOMAINS based on http://translationproject.org/extra/matrix.html +# We need to check all domains, not only po/LINGUAS, since there might be +# new translations +DOMAINS=\ +"af am ar az be bg pt_BR bs ca zh_CN cs cy da de el eo es et eu fa fi fr "\ +"ga en_GB gl gu he hi zh_HK hr hu id is it ja ko ku ky lg lt lv mk mn ms "\ +"mt nb ne nl nn or pa pl pt rm ro ru rw sk sl sq sr sv ta tq th tk "\ +"tr zh_TW uk ven vi wa xh zu" + +# for testing/debugging: +#DOMAINS="es fr hu sv pl xx" + +# check for 'diff' program +diff --version 2>/dev/null >/dev/null +if [ ! $? ]; then + echo "==== You must have the 'diff' program installed for this script ====" + exit 1 +fi + +# check for 'wget' program +wget --version 2>/dev/null >/dev/null +if [ ! $? ]; then + echo "==== You must have the 'wget' program installed for this script ====" + exit 1 +fi + +# make sure we're in the top-level directory +if [ ! -d ./po ]; then + echo "==== No ./po directory in the current working directory ====" + exit 1 +fi + +# make sure a package argument was passed to us +if [ -z "$1" ]; then + echo "Usage: $0 PACKAGE, e.g. $0 gst-plugins-good" + exit 1 +fi + +if test "$1" != "gstreamer" -a \ + "$1" != "gst-plugins-base" -a \ + "$1" != "gst-plugins-good" -a \ + "$1" != "gst-plugins-ugly" -a \ + "$1" != "gst-plugins-bad"; then + echo "Unexpected package '$1' ?!" + exit 1 +fi + +PACKAGE="$1" + +DOMAINS_TO_ADD="" +DOMAINS_UPDATED="" +DOMAINS_NOT_IN_LINGUAS="" + +echo "Downloading latest translation files for package $PACKAGE ..." +echo + +for d in $DOMAINS +do + PACKAGE_PO_URL_BASE="http://translationproject.org/latest/$PACKAGE" + PO_URL="$PACKAGE_PO_URL_BASE/$d.po" + PO_FILENAME="$PACKAGE.$d.po" + if wget -q -nc -O $PO_FILENAME $PO_URL; then + # we want all .po files in UTF-8 format really, so convert if needed.. + CHARSET=`grep Content-Type $PO_FILENAME | sed -e 's/.*charset=\(.*\)\\\\n.*/\1/'` + if test "x$CHARSET" != "xUTF-8" -a "x$CHARSET" != "xutf-8"; then + # note: things like the bugs address will be added back by make update-po + if msguniq $PO_FILENAME --no-location \ + --output-file=$PO_FILENAME.utf8 \ + --to-code=UTF-8; then + mv $PO_FILENAME.utf8 $PO_FILENAME + else + echo "**** $d: conversion from $CHARSET to UTF-8 failed ****" + fi + fi + if [ -f "po/$d.po" ]; then + # ./po/foo.po exists, so let's check if ours matches the latest from the + # translation project website + REVDATE_NEW=`grep PO-Revision-Date $PO_FILENAME`; + REVDATE_OLD=`grep PO-Revision-Date po/$d.po`; + CHARSET_OLD=`grep Content-Type po/$d.po | sed -e 's/.*charset=\(.*\)\\\\n.*/\1/'` + if test "x$REVDATE_NEW" = "x$REVDATE_OLD" -a "x$CHARSET_OLD" = "xUTF-8"; then + # note: source code line markers will be removed later by make upload-po + echo "$d.po: up-to-date" + rm -f $PO_FILENAME + else + mv $PO_FILENAME "po/$d.po" + if test "x$CHARSET_OLD" != "xUTF-8" -a "x$CHARSET_OLD" != "xutf-8"; then + echo "$d.po: update (and charset converted from $CHARSET_OLD to UTF-8)" + else + echo "$d.po: updated" + fi + DOMAINS_UPDATED="$DOMAINS_UPDATED $d" + fi + # make sure domain is listed in LINGUAS + if ! grep $d "po/LINGUAS" >/dev/null 2>/dev/null; then + DOMAINS_NOT_IN_LINGUAS="$DOMAINS_NOT_IN_LINGUAS $d" + fi + else + # ./po/foo.po doesn't exist, but foo.po exists on the translation project + # website, so it's probably a new translation + echo "$d.po: new language" + mv $PO_FILENAME "po/$d.po" + DOMAINS_UPDATED="$DOMAINS_UPDATED $d" + DOMAINS_TO_ADD="$DOMAINS_TO_ADD $d" + fi + else + rm -f $PO_FILENAME + echo "$d.po: failure (does probably not exist)" + fi +done + +if [ -n "$DOMAINS_UPDATED" ]; then + echo "====================================================================" + echo + echo "Language domains updated :$DOMAINS_UPDATED" + echo "Language domains to git add :$DOMAINS_TO_ADD" + echo + echo "Source: http://translationproject.org/latest/$PACKAGE/" + echo + if [ -n "$DOMAINS_TO_ADD" ]; then + CMD_STRING="git add" + for d in $DOMAINS_TO_ADD; do + CMD_STRING="$CMD_STRING po/$d.po" + done + echo "Please run" + echo + echo " $CMD_STRING" + echo + echo "now and add the following domains to the po/LINGUAS file:" + echo + echo " $DOMAINS_TO_ADD" + echo + echo + fi + echo "====================================================================" +fi + +if [ -n "$DOMAINS_NOT_IN_LINGUAS" ]; then + echo + echo "Existing domains missing from the po/LINGUAS file:" + echo + echo " $DOMAINS_NOT_IN_LINGUAS" + echo + echo +fi + + diff --git a/common/extract-release-date-from-doap-file b/common/extract-release-date-from-doap-file new file mode 100755 index 0000000..f57e307 --- /dev/null +++ b/common/extract-release-date-from-doap-file @@ -0,0 +1,32 @@ +#!/bin/sh +# Shell script to extract the date given a release version and a .doap file + +if test "x$1" = "x" -o "x$2" = "x" -o ! -s "$2"; then + echo "Usage: $0 RELEASE-VERSION-NUMBER DOAP-FILE" >&2; + exit 1 +fi + +if ! grep '/dev/null ; then + echo "$2 does not look lika a .doap file" >&2; + exit 1 +fi + +if ! grep "$1" "$2" >/dev/null ; then + echo "$2 contains no reference to a version $1" >&2; + exit 1 +fi + +awk 'BEGIN {x=0} +{ +if ( $0 ~ // ) {x=1; chunk=""} +if (x==1) { + if ($0 ~ //) { chunk = chunk $0 } + if ($0 ~ //) { chunk = chunk $0 } +} +if ($0 ~ /<\/release>/) {x=0; print chunk} +}' < "$2" | \ +\ +grep ''"$1"'' | \ +\ +sed -e 's/^.*//' -e 's/<\/created>.*$//' + diff --git a/common/gettext.patch b/common/gettext.patch new file mode 100644 index 0000000..682b905 --- /dev/null +++ b/common/gettext.patch @@ -0,0 +1,12 @@ +--- po/Makefile.in.in.orig 2006-01-07 12:03:45.000000000 +0100 ++++ po/Makefile.in.in 2006-01-07 12:04:23.000000000 +0100 +@@ -11,6 +11,9 @@ + PACKAGE = @PACKAGE@ + VERSION = @VERSION@ + ++# thomas: add GETTEXT_PACKAGE substitution as used in Makevars ++GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ ++ + SHELL = /bin/sh + @SET_MAKE@ + diff --git a/common/glib-gen.mak b/common/glib-gen.mak new file mode 100644 index 0000000..ef93a5f --- /dev/null +++ b/common/glib-gen.mak @@ -0,0 +1,44 @@ +# these are the variables your Makefile.am should set +# the example is based on the colorbalance interface + +#glib_enum_headers=$(colorbalance_headers) +#glib_enum_define=GST_COLOR_BALANCE +#glib_enum_prefix=gst_color_balance + +enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\") + +# these are all the rules generating the relevant files +%-marshal.h: %-marshal.list + $(AM_V_GEN)glib-genmarshal --header --prefix=$(glib_enum_prefix)_marshal $^ > $*-marshal.h.tmp && \ + mv $*-marshal.h.tmp $*-marshal.h + +%-marshal.c: %-marshal.list + $(AM_V_GEN)echo "#include \"$*-marshal.h\"" >> $*-marshal.c.tmp && \ + glib-genmarshal --body --prefix=$(glib_enum_prefix)_marshal $^ >> $*-marshal.c.tmp && \ + mv $*-marshal.c.tmp $*-marshal.c + +%-enumtypes.h: $(glib_enum_headers) + $(AM_V_GEN)glib-mkenums \ + --fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ + --fprod "\n/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \ + $^ > $@ + +%-enumtypes.c: $(glib_enum_headers) + @if test "x$(glib_enum_headers)" = "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi + $(AM_V_GEN)glib-mkenums \ + --fhead "#include \"$*-enumtypes.h\"\n$(enum_headers)" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n if (g_once_init_enter (&g_define_type_id__volatile)) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n GType g_define_type_id = g_@type@_register_static (\"@EnumName@\", values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n return g_define_type_id__volatile;\n}\n" \ + $^ > $@ + +# a hack rule to make sure .Plo files exist because they get include'd +# from Makefile's +.deps/%-marshal.Plo: + @touch $@ + +.deps/%-enumtypes.Plo: + @touch $@ diff --git a/common/gst-autogen.sh b/common/gst-autogen.sh new file mode 100644 index 0000000..78cab66 --- /dev/null +++ b/common/gst-autogen.sh @@ -0,0 +1,345 @@ +# a silly hack that generates autoregen.sh but it's handy +# Remove the old autoregen.sh first to create a new file, +# as the current one may be being read by the shell executing +# this script. +if [ -f "autoregen.sh" ]; then + rm autoregen.sh +fi +echo "#!/bin/sh" > autoregen.sh +echo "./autogen.sh $@ \$@" >> autoregen.sh +chmod +x autoregen.sh + +# helper functions for autogen.sh + +debug () +# print out a debug message if DEBUG is a defined variable +{ + if test ! -z "$DEBUG" + then + echo "DEBUG: $1" + fi +} + +version_get () +# based on the command's version output, set variables +# _MAJOR, _MINOR, _MICRO, _VERSION, using the given prefix as variable prefix +# +# arg 1: command binary name +# arg 2: (uppercased) variable name prefix +{ + COMMAND=$1 + VARPREFIX=`echo $2 | tr .,- _` + local ${VARPREFIX}_VERSION + + # strip everything that's not a digit, then use cut to get the first field + pkg_version=`$COMMAND --version|head -n 1|sed 's/^.*)[^0-9]*//'|cut -d' ' -f1` + debug "pkg_version $pkg_version" + # remove any non-digit characters from the version numbers to permit numeric + # comparison + pkg_major=`echo $pkg_version | cut -d. -f1 | sed s/[a-zA-Z\-].*//g` + pkg_minor=`echo $pkg_version | cut -d. -f2 | sed s/[a-zA-Z\-].*//g` + pkg_micro=`echo $pkg_version | cut -d. -f3 | sed s/[a-zA-Z\-].*//g` + test -z "$pkg_major" && pkg_major=0 + test -z "$pkg_minor" && pkg_minor=0 + test -z "$pkg_micro" && pkg_micro=0 + debug "found major $pkg_major minor $pkg_minor micro $pkg_micro" + eval ${VARPREFIX}_MAJOR=$pkg_major + eval ${VARPREFIX}_MINOR=$pkg_minor + eval ${VARPREFIX}_MICRO=$pkg_micro + eval ${VARPREFIX}_VERSION=$pkg_version +} + +version_compare () +# Checks whether the version of VARPREFIX is equal to or +# newer than the requested version +# arg1: VARPREFIX +# arg2: MAJOR +# arg3: MINOR +# arg4: MICRO +{ + VARPREFIX=`echo $1 | tr .,- _` + MAJOR=$2 + MINOR=$3 + MICRO=$4 + + eval pkg_major=\$${VARPREFIX}_MAJOR; + eval pkg_minor=\$${VARPREFIX}_MINOR; + eval pkg_micro=\$${VARPREFIX}_MICRO; + + #start checking the version + debug "version_compare: $VARPREFIX against $MAJOR.$MINOR.$MICRO" + + # reset check + WRONG= + + if [ ! "$pkg_major" -gt "$MAJOR" ]; then + debug "major: $pkg_major <= $MAJOR" + if [ "$pkg_major" -lt "$MAJOR" ]; then + debug "major: $pkg_major < $MAJOR" + WRONG=1 + elif [ ! "$pkg_minor" -gt "$MINOR" ]; then + debug "minor: $pkg_minor <= $MINOR" + if [ "$pkg_minor" -lt "$MINOR" ]; then + debug "minor: $pkg_minor < $MINOR" + WRONG=1 + elif [ "$pkg_micro" -lt "$MICRO" ]; then + debug "micro: $pkg_micro < $MICRO" + WRONG=1 + fi + fi + fi + if test ! -z "$WRONG"; then + debug "version_compare: $VARPREFIX older than $MAJOR.$MINOR.$MICRO" + return 1 + fi + debug "version_compare: $VARPREFIX equal to/newer than $MAJOR.$MINOR.$MICRO" + return 0 +} + + +version_check () +# check the version of a package +# first argument : package name (executable) +# second argument : optional path where to look for it instead +# third argument : source download url +# rest of arguments : major, minor, micro version +# all consecutive ones : suggestions for binaries to use +# (if not specified in second argument) +{ + PACKAGE=$1 + PKG_PATH=$2 + URL=$3 + MAJOR=$4 + MINOR=$5 + MICRO=$6 + + # for backwards compatibility, we let PKG_PATH=PACKAGE when PKG_PATH null + if test -z "$PKG_PATH"; then PKG_PATH=$PACKAGE; fi + debug "major $MAJOR minor $MINOR micro $MICRO" + VERSION=$MAJOR + if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi + if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi + + debug "major $MAJOR minor $MINOR micro $MICRO" + + for SUGGESTION in $PKG_PATH; do + COMMAND="$SUGGESTION" + + # don't check if asked not to + test -z "$NOCHECK" && { + printf " checking for $COMMAND >= $VERSION ... " + } || { + # we set a var with the same name as the package, but stripped of + # unwanted chars + VAR=`echo $PACKAGE | sed 's/-//g'` + debug "setting $VAR" + eval $VAR="$COMMAND" + return 0 + } + + which $COMMAND > /dev/null 2>&1 + if test $? -eq 1; + then + debug "$COMMAND not found" + continue + fi + + VARPREFIX=`echo $COMMAND | sed 's/-//g' | tr [:lower:] [:upper:]` + version_get $COMMAND $VARPREFIX + + version_compare $VARPREFIX $MAJOR $MINOR $MICRO + if test $? -ne 0; then + echo "found $pkg_version, not ok !" + continue + else + echo "found $pkg_version, ok." + # we set a var with the same name as the package, but stripped of + # unwanted chars + VAR=`echo $PACKAGE | sed 's/-//g'` + debug "setting $VAR" + eval $VAR="$COMMAND" + return 0 + fi + done + + echo "$PACKAGE not found !" + echo "You must have $PACKAGE installed to compile $package." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at $URL" + return 1; +} + +aclocal_check () +{ + # normally aclocal is part of automake + # so we expect it to be in the same place as automake + # so if a different automake is supplied, we need to adapt as well + # so how's about replacing automake with aclocal in the set var, + # and saving that in $aclocal ? + # note, this will fail if the actual automake isn't called automake* + # or if part of the path before it contains it + if [ -z "$automake" ]; then + echo "Error: no automake variable set !" + return 1 + else + aclocal=`echo $automake | sed s/automake/aclocal/` + debug "aclocal: $aclocal" + if [ "$aclocal" != "aclocal" ]; + then + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-aclocal=$aclocal" + fi + if [ ! -x `which $aclocal` ]; then + echo "Error: cannot execute $aclocal !" + return 1 + fi + fi +} + +autoheader_check () +{ + # same here - autoheader is part of autoconf + # use the same voodoo + if [ -z "$autoconf" ]; then + echo "Error: no autoconf variable set !" + return 1 + else + autoheader=`echo $autoconf | sed s/autoconf/autoheader/` + debug "autoheader: $autoheader" + if [ "$autoheader" != "autoheader" ]; + then + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoheader=$autoheader" + fi + if [ ! -x `which $autoheader` ]; then + echo "Error: cannot execute $autoheader !" + return 1 + fi + fi + +} + +die_check () +{ + # call with $DIE + # if set to 1, we need to print something helpful then die + DIE=$1 + if test "x$DIE" = "x1"; + then + echo + echo "- Please get the right tools before proceeding." + echo "- Alternatively, if you're sure we're wrong, run with --nocheck." + exit 1 + fi +} + +autogen_options () +{ + if test "x$1" = "x"; then + return 0 + fi + + while test "x$1" != "x" ; do + optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + case "$1" in + --noconfigure) + NOCONFIGURE=defined + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --noconfigure" + echo "+ configure run disabled" + shift + ;; + --nocheck) + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --nocheck" + NOCHECK=defined + echo "+ autotools version check disabled" + shift + ;; + -d|--debug) + DEBUG=defined + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --debug" + echo "+ debug output enabled" + shift + ;; + -h|--help) + echo "autogen.sh (autogen options) -- (configure options)" + echo "autogen.sh help options: " + echo " --noconfigure don't run the configure script" + echo " --nocheck don't do version checks" + echo " --debug debug the autogen process" + echo + echo " --with-autoconf PATH use autoconf in PATH" + echo " --with-automake PATH use automake in PATH" + echo + echo "Any argument either not in the above list or after a '--' will be " + echo "passed to ./configure." + exit 1 + ;; + --with-automake=*) + AUTOMAKE=$optarg + echo "+ using alternate automake in $optarg" + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-automake=$AUTOMAKE" + shift + ;; + --with-autoconf=*) + AUTOCONF=$optarg + echo "+ using alternate autoconf in $optarg" + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoconf=$AUTOCONF" + shift + ;; + --) shift ; break ;; + *) + echo "+ passing argument $1 to configure" + CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $1" + shift + ;; + esac + done + + for arg do CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $arg"; done + if test ! -z "$CONFIGURE_EXT_OPT" + then + echo "+ options passed to configure: $CONFIGURE_EXT_OPT" + fi +} + +toplevel_check () +{ + srcfile=$1 + test -f $srcfile || { + echo "You must run this script in the top-level $package directory" + exit 1 + } +} + +tool_run () +{ + tool=$1 + options=$2 + run_if_fail=$3 + echo "+ running $tool $options..." + $tool $options || { + echo + echo $tool failed + eval $run_if_fail + exit 1 + } +} + +install_git_hooks () +{ + if test -d .git; then + # install pre-commit hook for doing clean commits + for hook in pre-commit; do + if test ! \( -x .git/hooks/$hook -a -L .git/hooks/$hook \); then + echo "+ Installing git $hook hook" + rm -f .git/hooks/$hook + ln -s ../../common/hooks/$hook.hook .git/hooks/$hook || { + # if we couldn't create a symbolic link, try doing a plain cp + if cp common/hooks/pre-commit.hook .git/hooks/pre-commit; then + chmod +x .git/hooks/pre-commit; + else + echo "********** Couldn't install git $hook hook **********"; + fi + } + fi + done + fi +} diff --git a/common/gst-indent b/common/gst-indent new file mode 100755 index 0000000..732b2ba --- /dev/null +++ b/common/gst-indent @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Check that the code follows a consistant code style +# + +# Check for existence of indent, and error out if not present. +# On some *bsd systems the binary seems to be called gnunindent, +# so check for that first. + +version=`gnuindent --version 2>/dev/null` +if test "x$version" = "x"; then + version=`indent --version 2>/dev/null` + if test "x$version" = "x"; then + echo "GStreamer git pre-commit hook:" + echo "Did not find GNU indent, please install it before continuing." + exit 1 + fi + INDENT=indent +else + INDENT=gnuindent +fi + +case `$INDENT --version` in + GNU*) + ;; + default) + echo "GStreamer git pre-commit hook:" + echo "Did not find GNU indent, please install it before continuing." + echo "(Found $INDENT, but it doesn't seem to be GNU indent)" + exit 1 + ;; +esac + +INDENT_PARAMETERS="--braces-on-if-line \ + --case-brace-indentation0 \ + --case-indentation2 \ + --braces-after-struct-decl-line \ + --line-length80 \ + --no-tabs \ + --cuddle-else \ + --dont-line-up-parentheses \ + --continuation-indentation4 \ + --honour-newlines \ + --tab-size8 \ + --indent-level2 \ + --leave-preprocessor-space" + +$INDENT ${INDENT_PARAMETERS} $@ + diff --git a/common/gst.supp b/common/gst.supp new file mode 100644 index 0000000..2c60392 --- /dev/null +++ b/common/gst.supp @@ -0,0 +1,3967 @@ +### this file contains suppressions for valgrind when running +### the gstreamer unit tests +### it might be useful for wider use as well + +### syscall suppressions + +{ + + Memcheck:Param + clone(parent_tidptr) + fun:clone + fun:clone +} + +{ + + Memcheck:Param + clone(child_tidptr) + fun:clone + fun:clone +} + +{ + + Memcheck:Param + clone(tlsinfo) + fun:clone + fun:clone +} + +### glibc suppressions + +{ + + Memcheck:Cond + obj:/lib/ld-2.*.so + fun:dl_open_worker + obj:/lib/ld-2.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.*.so + fun:_dlerror_run + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_file +} + +{ + + Memcheck:Cond + fun:strlen + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start + obj:/lib64/ld-2.*.so + obj:* + obj:* +} + +{ + + Memcheck:Cond + fun:_dl_relocate_object + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start +} + +{ + + Memcheck:Cond + fun:* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +# glibc does not deallocate thread-local storage + +{ + + Memcheck:Leak + fun:calloc + fun:_dl_allocate_tls + fun:pthread_create@@* +} + +{ + + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls +} + +# I get an extra stack entry on x86/dapper +{ + + Memcheck:Leak + fun:calloc + obj:/lib/ld-2.3.*.so + fun:_dl_allocate_tls + fun:pthread_create@@* +} + + +{ + + Memcheck:Cond + fun:strstr + fun:__pthread_initialize_minimal + obj:/lib/libpthread-*.so + obj:/lib/libpthread-*.so + fun:call_init + fun:_dl_init + obj:/lib/ld-*.so +} + +# a thread-related free problem in glibc from Edgard +{ + __libc_freeres_rw_acess + Memcheck:Addr4 + obj:* + obj:* + obj:* + obj:* + obj:* + fun:__libc_freeres +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so +} + +# g_module_open-related problems +{ + + Memcheck:Addr2 + fun:memcpy + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:init_post + fun:g_option_context_parse + fun:gst_init_check + fun:gst_init + fun:gst_check_init + fun:main +} + +{ + + Memcheck:Addr4 + fun:memcpy + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:gst_registry_scan_path_level + fun:init_post + fun:g_option_context_parse + fun:gst_init_check + fun:gst_init + fun:gst_check_init + fun:main +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:do_sym + fun:_dl_sym + fun:dlsym_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlsym + fun:g_module_symbol + fun:g_module_open + fun:gst_plugin_load_file +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file +} +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_plugin_load_by_name + fun:gst_plugin_feature_load +} + +{ + + Memcheck:Leak + fun:malloc + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_plugin_load_by_name +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:do_sym + fun:_dl_sym + fun:dlsym_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlsym + fun:g_module_symbol + fun:g_module_open +} + +{ + + Memcheck:Param + futex(uaddr2) + fun:pthread_once + obj:/lib/libc-2.3.*.so + obj:/lib/libc-2.3.*.so + fun:mbsnrtowcs + fun:vfprintf + fun:vsprintf + fun:sprintf + obj:/lib/libc-2.3.*.so + fun:tmpfile + fun:setup_pipe + fun:setup_messaging_with_key + fun:setup_messaging +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + fun:_dl_sym + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlsym + fun:g_module_symbol + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + obj:/lib/i686/cmov/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libc-2.7.so + fun:iconv_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/i686/cmov/libdl-2.7.so + fun:dlopen +} + +# suppression for a glibc bug: +# http://valgrind.org/docs/manual/faq.html#faq.exit_errors> +{ + + Memcheck:Free + fun:free + obj:*libc-*.so + fun:__libc_freeres + fun:* + fun:_Exit +} + +# same as above, just so it works for tpm on gutsy/x86-64 +{ + + Memcheck:Free + fun:free + fun:free_mem + fun:__libc_freeres +} + +# valgrind doesn't allow me to specify a suppression for Addr1, Addr2, Addr4 +# as Addr*, so 3 copies for that; and then 2 of each for that pesky memcpy +{ + + Memcheck:Addr1 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr2 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} +{ + + Memcheck:Addr4 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr1 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr2 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} +{ + + Memcheck:Addr4 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/libc-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:_dl_open + obj:/lib/libdl-2.3.*.so + obj:/lib/ld-2.3.*.so +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/libc-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:_dl_open + obj:/lib/libdl-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/libdl-2.3.*.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_file + fun:gst_plugin_load_by_name + fun:gst_plugin_feature_load +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +### glib suppressions +{ + + Memcheck:Cond + fun:g_parse_debug_string + obj:/usr/lib*/libglib-2.0.so.* + fun:g_slice_alloc + fun:g_slice_alloc0 +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_init* + fun:init_pre* +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_register_fundamental +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:type_node_any_new_W +} + +{ + + Memcheck:Leak + fun:realloc + fun:g_realloc + fun:type_node_any_new_W +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:g_type_class_ref +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:type_add_flags_W +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:type_add_flags_W +} + +#pthread memleaks + +{ + Thread creation leak + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_initialize_minimal +} + +{ + Thread management leak + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_* +} + +{ + Thread management leak 2 + Memcheck:Leak + fun:memalign + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_* +} + +{ + pthread_create Syscall param write(buf) points to uninitialised byte(s) + Memcheck:Param + write(buf) + fun:pthread_create@@GLIBC_2.2.5 + fun:g_thread_create* + +} + +# nss_parse_* memleak (used by g_option_context_parse) +{ + nss_parse_* memleak + Memcheck:Leak + fun:malloc + fun:nss_parse_service_list + fun:__nss_database_lookup +} + +# liboil suppressions +{ + + Memcheck:Value8 + obj:/usr/lib/liboil-0.3.so.0.1.0 + obj:/usr/lib/liboil-0.3.so.0.1.0 + obj:/usr/lib/liboil-0.3.so.0.1.0 + fun:oil_cpu_fault_check_try + fun:oil_test_check_impl + fun:oil_class_optimize + fun:oil_optimize_all + fun:oil_init +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.3.6.so +} + +{ + + Memcheck:Param + futex(uaddr2) + fun:pthread_once + obj:/lib/libc-2.3.6.so + obj:/lib/libc-2.3.6.so + fun:setlocale + fun:init_pre + fun:g_option_context_parse + fun:gst_init_check + fun:gst_init + fun:gst_check_init + fun:main +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/libdl-2.3.6.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_file +} +# this exists in a bunch of different variations, hence the short tail/trace +{ + + Memcheck:Addr4 + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} +{ + + Memcheck:Addr8 + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} + +# More edgy suppressions (Mike) +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:dlopen_doit + obj:/lib/ld-2.4.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:dlopen_doit + obj:/lib/ld-2.4.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:do_sym + fun:_dl_sym +} + +# This one's overly general, but there's zero other information in the stack +# trace - just these five lines! +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} + +{ + + Memcheck:Leak + fun:calloc + obj:/lib/ld-2.4.so + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.1 +} + +# TLS leaks for feisty/x86 +{ + + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.1 +} + +{ + + Memcheck:Leak + fun:calloc + obj:/usr/lib/libcdio.so.6.0.1 + fun:cdio_open_am_linux + obj:/usr/lib/libcdio.so.6.0.1 + fun:cdio_open_am +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.5.so +} + +{ + + Memcheck:Cond + fun:snd_pcm_direct_shm_create_or_connect + fun:snd_pcm_dsnoop_open + fun:_snd_pcm_dsnoop_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_plug_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_asym_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 +} + +{ + + Memcheck:Cond + fun:snd*_pcm_hw_param_set_near +} + +{ + + Memcheck:Cond + ... + fun:snd*_pcm_hw_param_set_near +} + +{ + + Memcheck:Cond + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_close + obj:/*lib/libasound.so.2.0.0 +} +{ + + Memcheck:Cond + fun:snd_pcm_direct_shm_create_or_connect + fun:snd_pcm_dmix_open + fun:_snd_pcm_dmix_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_softvol_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_plug_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_asym_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 +} +{ + + Memcheck:Leak + fun:malloc + fun:strdup + fun:snd_dlobj_cache_add + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:snd_pcm_dsnoop_open + fun:_snd_pcm_dsnoop_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_plug_open + obj:/*lib/libasound.so.2.0.0 + fun:snd_pcm_open_slave + fun:_snd_pcm_asym_open + obj:/*lib/libasound.so.2.0.0 + obj:/*lib/libasound.so.2.0.0 +} +# Catch about 15 variations on inserting info into an ALSA +# internal cache +{ + + Memcheck:Leak + fun:malloc + ... + fun:snd*_dlobj_cache_add + obj:/*lib*/libasound.so.2.0.0 +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:snd_pcm_open_conf +} + +{ + + Memcheck:Leak + fun:*alloc + obj:/*lib*/libasound.so.2.0.0 + ... + fun:snd_config_hook_load +} + +{ + + Memcheck:Leak + fun:*alloc + obj:/*lib*/libasound.so.2.0.0 + ... + fun:snd_config_update_r + fun:snd_config_update +} +{ + + Memcheck:Leak + fun:*alloc + fun:strdup + ... + fun:snd_config_update_r + fun:snd_config_update +} +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_close_worker + ... + fun:snd_config_searcha_hooks +} + +{ + + Memcheck:Leak + fun:malloc + obj:/lib/libc*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getgrnam_r + fun:getgrnam + fun:snd_pcm_direct_parse_open_conf +} + +{ + + Memcheck:Leak + fun:calloc + fun:_XCBInitDisplayLock + fun:XOpenDisplay +} + +# GConf internal initialisations related to getting the default client. +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + obj:/usr/lib/libORBit-2.so.* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so.* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so.* + obj:/usr/lib/libgconf-2.so.* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + obj:* + fun:PortableServer_POA_servant_to_reference + fun:* + fun:* + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + obj:/usr/lib/libORBit-2.so.* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so.* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so.* + obj:/usr/lib/libgconf-2.so.* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:ORBit_demarshal_value + fun:* + fun:ORBit_small_invoke_stub + fun:ConfigServer_get_default_database + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:* + fun:IOP_generate_profiles + fun:ORBit_marshal_object + fun:ORBit_marshal_value + fun:* + fun:ORBit_small_invoke_stub + fun:ConfigServer_add_client + fun:* + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_by_tc + fun:* + fun:PortableServer_POA_servant_to_reference + fun:* + fun:* + fun:* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_by_tc + obj:/usr/lib/libORBit-2.so.* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so.* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so.* + obj:/usr/lib/libgconf-2.so.* + fun:gconf_engine_get_default +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:* + fun:* + fun:gconf_activate_server +} + +# Some libORBit/bonobo initialisation stuff +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:ORBit_alloc_string + fun:CORBA_string_dup + fun:Bonobo_ActivationEnvValue_set + fun:bonobo_activation_init_activation_env + fun:bonobo_activation_orb_init + fun:bonobo_activation_init +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:PortableServer_POA_servant_to_reference + obj:/usr/lib/libbonobo-2.so* +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + fun:ORBit_small_allocbuf + fun:ORBit_adaptor_setup + obj:/usr/lib/libORBit-2.so* + fun:ORBit_POA_setup_root + fun:ORBit_init_internals + fun:CORBA_ORB_init +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc_tcval + fun:ORBit_adaptor_setup + fun:* + fun:ORBit_POA_setup_root + fun:ORBit_init_internals + fun:CORBA_ORB_init +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_allocbuf + fun:bonobo_activation_init_activation_env + fun:bonobo_activation_orb_init + fun:bonobo_activation_init +} + +# More GConf stuff from the FC5 buildbot, mostly variations on the +# above stack traces +{ + + Memcheck:Param + writev(vector[...]) + fun:writev + obj:/usr/lib/libORBit-2.so* + fun:link_connection_writev + fun:giop_send_buffer_write + obj:/usr/lib/libORBit-2.so* + fun:ORBit_small_invoke_stub + fun:ORBit_small_invoke_stub_n + fun:ORBit_c_stub_invoke + fun:ConfigServer_ping + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:PortableServer_POA_servant_to_reference + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc + obj:/usr/lib/libORBit-2.so* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:CORBA_ORB_string_to_object + obj:/usr/lib/libgconf-2.so* + fun:gconf_get_current_lock_holder + fun:gconf_activate_server + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:ORBit_demarshal_IOR + fun:ORBit_demarshal_object + fun:ORBit_demarshal_value + obj:/usr/lib/libORBit-2.so* + fun:ORBit_small_invoke_stub + fun:ORBit_small_invoke_stub_n + fun:ORBit_c_stub_invoke + fun:ConfigServer_get_default_database + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:ORBit_alloc* + fun:ORBit_small_alloc* + obj:/usr/lib/libORBit-2.so* + fun:ORBit_OAObject_object_to_objkey + fun:IOP_generate_profiles + fun:ORBit_marshal_object + fun:ORBit_marshal_value + obj:/usr/lib/libORBit-2.so* + fun:ORBit_small_invoke_stub + fun:ORBit_small_invoke_stub_n + fun:ORBit_c_stub_invoke + fun:ConfigServer_add_client + obj:/usr/lib/libgconf-2.so* + obj:/usr/lib/libgconf-2.so* + fun:gconf_engine_get_default +} +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.* + fun:g_get_home_dir +} +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.* + fun:g_get_user_name +} +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.* + fun:g_get_tmp_dir +} + +{ + + Memcheck:Leak + fun:malloc + obj:*libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + obj:/usr/lib*/libglib-2.0.so.0.* + fun:g_get_host_name +} + + +## Some Fontconfig errors. +{ + + Memcheck:Leak + fun:malloc + fun:FcPatternObjectInsertElt + fun:FcPatternObjectAddWithBinding + fun:FcPatternAppend + fun:FcEndElement + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + fun:XML_ParseBuffer + fun:FcConfigParseAndLoad + fun:FcConfigParseAndLoad + fun:FcParseInclude + fun:FcEndElement + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + obj:/usr/lib/libexpat.so.* + fun:XML_ParseBuffer + fun:FcConfigParseAndLoad +} +{ + + Memcheck:Leak + fun:*alloc + ... + fun:FcInitLoadConfig +} + +# Issues with ubuntu Hardy, same crack as for previous ubuntus +{ + + Memcheck:Leak + fun:calloc + obj:* + fun:_dl_allocate_tls + fun:pthread_create@@* + obj:/usr/lib/libgthread* + fun:g_thread_* +} + +# I've made this version generic, so that it covers future modifications +# of library names +{ + + Memcheck:Leak + fun:calloc + obj:* + fun:_dl_allocate_tls + fun:pthread_create@@* + fun:g_thread_* +} + +# series of invalid read of size 4 in g_module_open for ubuntu +# hardy x86/32bit +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load_* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlopen + fun:g_module_open + fun:gst_plugin_load* +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + fun:_dl_sym + obj:/lib/tls/i686/cmov/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libdl-2.7.so + fun:dlsym + fun:g_module_symbol + fun:g_module_open + fun:gst_plugin_load_* +} + +# series of invalid read of size 8 in g_module_open for ubuntu +# hardy x86/64bit +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/libdl-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libdl-2.7.so + fun:dlsym + fun:g_module_symbol + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libc-2.7.so + fun:__nss_passwd_lookup + fun:getpwnam_r +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libc-2.7.so + fun:__nss_passwd_lookup + fun:getpwnam_r +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libnss_compat-2.7.so + fun:_nss_compat_getpwnam_r + fun:getpwnam_r +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/tls/i686/cmov/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libnss_compat-2.7.so + fun:_nss_compat_getpwnam_r + fun:getpwnam_r +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so + obj:/lib/libc-2.7.so + obj:/lib/ld-2.7.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/libc-2.7.so + fun:getpwnam_r +} + +## Leaks in ALSA (variations of leak from snd_config_load1) + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:snd_config_load1 +} +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:snd_config_load1 +} +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} +{ + + Memcheck:Leak + fun:calloc + fun:_snd_config_make + fun:_snd_config_make_add + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:malloc + fun:snd1_dlobj_cache_add + fun:snd_ctl_open_noupdate +} + +{ + + Memcheck:Leak + fun:malloc + fun:* + fun:snd1_dlobj_cache_add + fun:snd_ctl_open_noupdate +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:snd_config_load1 +} + + +# The following are leaks of caps that need to be created dynamically +# in the type registration of the plugin (used for pad templates). + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_new_simple + fun:* + fun:g_type_class_ref + fun:gst_element_register +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:* + fun:* + fun:g_type_class_ref + fun:gst_element_register + fun:gst_ogm_parse_plugin_init + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_video_test_src_base_init + fun:g_type_class_ref + fun:gst_element_register +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_video_test_src_getcaps + fun:gst_video_test_src_base_init + fun:g_type_class_ref + fun:gst_element_register +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_ffmpegcsp_codectype_to_caps + fun:gst_ffmpegcolorspace_register + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_ffmpegcolorspace_register + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_new_any + fun:gst_ffmpegdemux_register + fun:plugin_init +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:realloc + fun:g_realloc + fun:g_ptr_array_maybe_expand + fun:g_ptr_array_add + fun:gst_caps_append + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_ptr_array_maybe_expand + fun:g_ptr_array_add + fun:gst_caps_append + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_ptr_array_maybe_expand + fun:g_ptr_array_add + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_ptr_array_sized_new + fun:gst_caps_new_empty + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_array_maybe_expand + fun:g_array_sized_new + fun:* + fun:* + fun:* + fun:gst_value_init_and_copy + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:g_array_maybe_expand + fun:g_array_sized_new + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_array_sized_new + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_audio_filter_class_add_pad_templates +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_riff_create_*_template_caps +} +{ + + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + fun:* + fun:* + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_caps_append + fun:gst_riff_create_*_template_caps +} +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_array_sized_new + fun:* + fun:gst_structure_copy + fun:gst_caps_copy + fun:gst_caps_append + fun:gst_riff_create_*_template_caps +} + +## Leaks in pango (bilboed: gentoo unstable amd64) + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:pango_layout_get_pixel_extents +} +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:pango_language_from_string + fun:pango_language_get_default + fun:pango_context_init + fun:g_type_create_instance + fun:g_object_constructor + fun:g_object_newv + fun:g_object_new_valist + fun:g_object_new + fun:pango_font_map_create_context +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:pango_language_from_string +} + + +## Leak of everything allocated by gst-libav plugin init +{ + + Memcheck:Leak + fun:*alloc + ... + fun:gst_ffmpeg_cfg_init +} + +## Leak of GIO module through gnomevfs + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:* + fun:* + fun:g_type_create_instance + fun:* + fun:* + fun:* + fun:* + fun:g_io_module_new + fun:g_io_modules_load_all_in_directory + fun:* + fun:get_default_vfs +} + +## Conditional jump in getaddrinfo (bilboed, gentoo ~amd64, Dec 13 2008) +{ + + Memcheck:Cond + fun:gaih_inet + fun:getaddrinfo +} + +## Dynamic pad templates in mxfmux +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:gst_caps_new_empty + fun:gst_caps_from_string + fun:mxf_*_init + fun:plugin_init +} + +## We don't know if ffmpeg frees this or not and better pass a copy for safety +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_strdup + fun:gst_ffmpeg_cfg_fill_context + fun:gst_ffmpegenc_setcaps + fun:gst_pad_set_caps +} + +## Leak/overreads with glibc-2.10 + +{ + + Memcheck:Value8 + fun:do_sym + fun:dlsym_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlsym +} +{ + + Memcheck:Cond + fun:do_sym + fun:dlsym_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlsym +} + +{ + + Memcheck:Value8 + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_relocate_object + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_check_map_versions + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_relocate_object + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_check_map_versions + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_map_object* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_map_object* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + fun:_dl_check_caller + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Cond + fun:_dl_check_caller + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen* +} + +{ + + Memcheck:Value8 + obj:/lib*/libc-2.10.*.so + obj:/lib*/libc-2.10.*.so + fun:_vgnU_freeres +} +{ + + Memcheck:Cond + obj:/lib*/libc-2.10.*.so + obj:/lib*/libc-2.10.*.so + fun:_vgnU_freeres +} +{ + + Memcheck:Free + fun:free + obj:/lib*/libc-2.10.*.so + obj:/lib*/libc-2.10.*.so + fun:_vgnU_freeres +} + +{ + + Memcheck:Value8 + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} + +{ + + Memcheck:Cond + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} +{ + + Memcheck:Value8 + fun:_dl_sort_fini + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} + +{ + + Memcheck:Cond + fun:_dl_sort_fini + fun:_dl_fini + fun:__run_exit_handlers + fun:exit +} + +# glibc-2.10 dl overreads +{ + + Memcheck:Value8 + fun:_dl_fixup + fun:_dl_runtime_resolve +} +{ + + Memcheck:Cond + fun:_dl_fixup + fun:_dl_runtime_resolve +} + +{ + + Memcheck:Value8 + fun:_dl_lookup_symbol_x + fun:_dl_fixup + fun:_dl_runtime_resolve +} +{ + + Memcheck:Cond + fun:_dl_lookup_symbol_x + fun:_dl_fixup + fun:_dl_runtime_resolve +} +{ + + Memcheck:Value8 + fun:call_init + fun:_dl_init +} +{ + + Memcheck:Value8 + fun:_dl_init +} +{ + + Memcheck:Value8 + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Cond + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_relocate_object + fun:dl_main +} +{ + + Memcheck:Value8 + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start +} +{ + + Memcheck:Cond + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start +} + +{ + + Memcheck:Cond + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:_dl_check_map_versions + fun:_dl_check_all_versions + fun:version_check_doit + fun:_dl_receive_error + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Cond + fun:init_tls + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_map_object_deps + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_protect_relro + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_setup_hash + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:open_path + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Cond + fun:* + fun:open_path + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_name_match_p + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:* + fun:* + fun:_dl_map_object +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_name_match_p + fun:_dl_check_map_versions + fun:_dl_check_all_versions +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Cond + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Value8 + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Value8 + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} +{ + + Memcheck:Cond + fun:* + fun:do_lookup_x + fun:_dl_lookup_symbol_x +} + +{ + + Memcheck:Value8 + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} +{ + + Memcheck:Cond + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} + +{ + + Memcheck:Value8 + fun:* + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} +{ + + Memcheck:Cond + fun:* + fun:_dl_name_match_p + fun:_dl_map_object + fun:dl_open_worker +} + +{ + + Memcheck:Value8 + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object +} +{ + + Memcheck:Cond + fun:_dl_lookup_symbol_x + fun:_dl_relocate_object +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Cond + fun:* + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Cond + fun:* + fun:_dl_check_map_versions +} +{ + + Memcheck:Value8 + fun:openaux +} +{ + + Memcheck:Value8 + fun:_dl_name_match_p + fun:_dl_map_object +} + +{ + + Memcheck:Cond + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} +{ + + Memcheck:Value8 + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} +{ + + Memcheck:Cond + fun:* + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:dlerror_run +} + +{ + + Memcheck:Cond + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} +{ + + Memcheck:Value8 + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:fillin_rpath + fun:_dl_init_paths + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_map_object + fun:map_doit + fun:_dl_catch_error + fun:do_preload + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_map_object + fun:map_doit + fun:_dl_catch_error + fun:do_preload + fun:dl_main +} +{ + + Memcheck:Param + open(filename) + fun:open + fun:open_verify + fun:_dl_map_object + fun:map_doit + fun:_dl_catch_error + fun:do_preload + fun:dl_main +} + +{ + + Memcheck:Param + stat(file_name) + fun:_xstat + fun:open_path + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_open_worker +} + +{ + + Memcheck:Cond + fun:* + fun:_dl_map_object_deps + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_map_object_deps + fun:dl_main +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:_dl_map_object_deps + fun:dl_main +} + +# glibc-2.10 tls issues +{ + + Memcheck:Cond + fun:* + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:* + fun:init_tls + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:* + fun:init_tls + fun:dl_main +} + +{ + + Memcheck:Cond + fun:_dl_allocate_tls_init + fun:dl_main +} +{ + + Memcheck:Value8 + fun:_dl_allocate_tls_init + fun:dl_main +} +{ + + Memcheck:Cond + fun:* + fun:_dl_allocate_tls_init + fun:dl_main +} +{ + + Memcheck:Value8 + fun:* + fun:_dl_allocate_tls_init + fun:dl_main +} + +{ + + Memcheck:Cond + fun:__tls* + obj:* + obj:* + fun:_vgnU_freeres +} + +{ + + Memcheck:Param + arch_prctl(arg2) + fun:init_tls +} +# GLib caching tmp/home directories (glibc-2.10 variants) +{ + + Memcheck:Cond + fun:* + fun:dl_open_worker + fun:* + fun:* + fun:* + fun:_dl_catch_error + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} +{ + + Memcheck:Value8 + fun:* + fun:dl_open_worker + fun:* + fun:* + fun:* + fun:_dl_catch_error + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} +{ + + Memcheck:Cond + fun:dl_open_worker + fun:* + fun:* + fun:do_dlopen + fun:* + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} +{ + + Memcheck:Value8 + fun:dl_open_worker + fun:* + fun:* + fun:do_dlopen + fun:* + fun:dlerror_run + fun:* + fun:__nss_lookup_function + fun:__nss_lookup + fun:getpwnam* +} + +{ + + Memcheck:Value8 + fun:_dl_add_to_slotinfo + fun:dl_main +} +{ + + Memcheck:Param + open(filename) + fun:open + fun:open_verify + fun:open_path + fun:_dl_map_object +} + + + +# GModule issues with glibc-2.10 +{ + + Memcheck:Value8 + fun:* + fun:* + fun:dlsym + fun:g_module_symbol +} +{ + + Memcheck:Value8 + fun:g_module_* + fun:gst_plugin* +} +{ + + Memcheck:Value8 + fun:* + fun:g_module_* + fun:gst_plugin* +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:dlopen* + fun:g_module_open +} +{ + + Memcheck:Value8 + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:dlsym + fun:g_module_symbol +} + +{ + + Memcheck:Value8 + fun:* + fun:* + fun:* + fun:* + fun:* + fun:dlopen* + fun:g_module_open +} + +# Leak in GSlice +{ + + Memcheck:Value8 + fun:g_parse_debug_string + fun:slice_config_init + fun:g_slice_init_nomessage + fun:_g_slice_thread_init_nomessage + fun:g_thread_init_glib +} + +# 2.10 pthread issues +{ + + Memcheck:Value8 + fun:__pthread_initialize_minimal +} + +# glibc 2.11 conditional +{ + + Memcheck:Cond + fun:_dl_relocate_object + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start + obj:/lib64/ld-2.11.so +} + +# glibc 2.11 Leak + +{ + + Memcheck:Leak + fun:*alloc + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_* + fun:_dl_* + fun:_dl_* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:_dl_* + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:_dl_map_object + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:_dl_* + fun:_dl_* + fun:_dl_* + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} + +# glib type leaks +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_register_static +} + +# new registry system +# all of this will only be created once when loading registry. + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_priv_gst_registry_chunks_load_plugin +} + +# system-wide tags +# these tags are registered once + +{ + + Memcheck:Leak + fun:*alloc + fun:* + fun:* + fun:gst_tag_register + fun:_gst_tag_initialize +} + +# system-wide type classes that we keep referenced + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_class_ref +} + +# leaking cached queries which are only initialized once +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_gst_query_initialize + fun:init_post +} + +# macosx (leopard) library loader leak +{ + + Memcheck:Leak + fun:_Znwm + fun:_ZNSs4_Rep9_S_createEmmRKSaIcE + fun:_ZNSs12_S_constructIPKcEEPcT_S3_RKSaIcESt20forward_iterator_tag + fun:_ZNSsC2EPKcRKSaIcE + fun:_Z41__static_initialization_and_destruction_0ii + fun:_ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE +} + +# GObject type registration +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_g_atomic_array_copy +} + +{ + + Memcheck:Leak + fun:*alloc + fun:getdelim + obj:*libselinux* +} + +{ + + Memcheck:Leak + fun:*alloc + ... + obj:*/sed +} + +{ + + Memcheck:Addr8 + ... + obj:*/sed +} + +# GLib 2.23 interface vtable +{ + + Memcheck:Leak + fun:*alloc + ... + fun:g_type_add_interface_static +} + +{ + + Memcheck:Leak + fun:*alloc + obj:*/dash +} + +# libtool/gentoo fake leak +# it actually runs bash and valgrind complains +{ + + Memcheck:Leak + fun:*alloc + obj:/bin/bash +} + +{ + + Memcheck:Leak + fun:*alloc + ... + fun:_gst_plugin_loader_client_run + fun:main +} + +{ + + Memcheck:Cond + fun:*strcasecmp* + ... + fun:__dcigettext +} + +{ + + Memcheck:Value8 + fun:*strcasecmp* + ... + fun:__dcigettext +} + +{ + + Memcheck:Leak + fun:malloc + ... + fun:gst_poll_new + fun:gst_poll_new_timer + fun:gst_system_clock_init +} + +{ + + Memcheck:Leak + fun:calloc + ... + fun:gobject_init_ctor +} + +{ + + Memcheck:Leak + fun:malloc + ... + fun:g_quark_from*_string +} diff --git a/common/gstdoc-scangobj b/common/gstdoc-scangobj new file mode 100755 index 0000000..4ad9786 --- /dev/null +++ b/common/gstdoc-scangobj @@ -0,0 +1,1617 @@ +#!/usr/bin/env perl +# -*- cperl -*- +# +# gtk-doc - GTK DocBook documentation generator. +# Copyright (C) 1998 Damon Chaplin +# +# 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 St, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# +# This gets information about object hierarchies and signals +# by compiling a small C program. CFLAGS and LDFLAGS must be +# set appropriately before running this script. +# + +use Getopt::Long; + +my $GTK_DOC_PREFIX=`pkg-config --variable prefix gtk-doc`; +if ($GTK_DOC_PREFIX) { + chomp $GTK_DOC_PREFIX; + #print "Adding $GTK_DOC_PREFIX/share/gtk-doc/data to \@INC\n"; + unshift @INC, "$GTK_DOC_PREFIX/share/gtk-doc/data"; +} else { + unshift @INC, '/usr/share/gtk-doc/data'; +} +require "gtkdoc-common.pl"; + +# Options + +# name of documentation module +my $MODULE; +my $OUTPUT_DIR; +my $INSPECT_DIR; +my $VERBOSE; +my $PRINT_VERSION; +my $PRINT_HELP; +my $TYPE_INIT_FUNC="g_type_init ()"; + +# --nogtkinit is deprecated, as it is the default now anyway. +%optctl = (module => \$MODULE, + source => \$SOURCE, + types => \$TYPES_FILE, + nogtkinit => \$NO_GTK_INIT, + 'type-init-func' => \$TYPE_INIT_FUNC, + 'output-dir' => \$OUTPUT_DIR, + 'inspect-dir' => \$INSPECT_DIR, + 'verbose' => \$VERBOSE, + 'version' => \$PRINT_VERSION, + 'help' => \$PRINT_HELP); + +GetOptions(\%optctl, "module=s", "source=s", "types:s", "output-dir:s", "inspect-dir:s", "nogtkinit", "type-init-func:s", "verbose", "version", "help"); + +if ($NO_GTK_INIT) { + # Do nothing. This just avoids a warning. + # the option is not used anymore +} + +if ($PRINT_VERSION) { + print "1.5\n"; + exit 0; +} + +if (!$MODULE) { + $PRINT_HELP = 1; +} + +if ($PRINT_HELP) { + print <$MODULE-scan.c") || die "Cannot open $MODULE-scan.c: $!\n"; + +my $old_signals_filename = "$OUTPUT_DIR/$MODULE.signals"; +my $new_signals_filename = "$OUTPUT_DIR/$MODULE.signals.new"; +my $old_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy"; +my $new_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy.new"; +my $old_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces"; +my $new_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces.new"; +my $old_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites"; +my $new_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites.new"; +my $old_args_filename = "$OUTPUT_DIR/$MODULE.args"; +my $new_args_filename = "$OUTPUT_DIR/$MODULE.args.new"; + +my $debug_log="g_message"; +if (!defined($VERBOSE) or $VERBOSE eq "0") { + $debug_log="//$debug_log"; +} + +# write a C program to scan the types + +$includes = ""; +@types = (); +@impl_types = (); + +for () { + if (/^#include/) { + $includes .= $_; + } elsif (/^%/) { + next; + } elsif (/^\s*$/) { + next; + } elsif (/^type:(.*)$/) { + $t = $1; + chomp $t; + push @impl_types, $t; + } else { + chomp; + push @types, $_; + } +} + +$ntypes = @types + @impl_types + 1; + +print OUTPUT < +#include +#include +#include + +#include +EOT + +if ($includes) { + print OUTPUT $includes; +} else { + for (@types) { + print OUTPUT "extern GType $_ (void);\n"; + } +} + +print OUTPUT < +#endif + +static GType *object_types = NULL; + +static GString *xmlstr = NULL; + +static const gchar* +xmlprint (gint indent, const gchar *tag, const gchar *data) +{ + const gchar indent_str[] = " "; + + /* reset */ + g_string_truncate (xmlstr, 0); + g_string_append_len (xmlstr, indent_str, MIN (indent, strlen (indent_str))); + g_string_append_printf (xmlstr, "<%s>", tag); + + if (data) { + gchar *s; + + s = g_markup_escape_text (data, -1); + g_string_append (xmlstr, s); + g_free (s); + } + + g_string_append_printf (xmlstr, "\\n", tag); + return xmlstr->str; +} + +static gint +gst_feature_sort_compare (gconstpointer a, gconstpointer b) +{ + const gchar *name_a = gst_plugin_feature_get_name ((GstPluginFeature *) a); + const gchar *name_b = gst_plugin_feature_get_name ((GstPluginFeature *) b); + return strcmp (name_a, name_b); +} + +static gint +static_pad_template_compare (gconstpointer a, gconstpointer b) +{ + GstStaticPadTemplate *spt_a = (GstStaticPadTemplate *) a; + GstStaticPadTemplate *spt_b = (GstStaticPadTemplate *) b; + + /* we want SINK before SRC (enum is UNKNOWN, SRC, SINK) */ + if (spt_a->direction != spt_b->direction) + return spt_b->direction - spt_a->direction; + + /* we want ALWAYS first, SOMETIMES second, REQUEST last + * (enum is ALWAYS, SOMETIMES, REQUEST) */ + if (spt_a->presence != spt_b->presence) + return spt_a->presence - spt_b->presence; + + return strcmp (spt_a->name_template, spt_b->name_template); +} + +static GType * +get_object_types (void) +{ + gpointer g_object_class; + GList *plugins = NULL; + GList *factories = NULL; + GList *l; + GstElementFactory *factory = NULL; + GType type; + gint i = 0; + gboolean reinspect; + + /* get a list of features from plugins in our source module */ + plugins = gst_registry_get_plugin_list (gst_registry_get ()); + + xmlstr = g_string_new (""); + + reinspect = !g_file_test ("scanobj-build.stamp", G_FILE_TEST_EXISTS); + + while (plugins) { + GList *features; + GstPlugin *plugin; + const gchar *source; + FILE *inspect = NULL; + gchar *inspect_name; + + plugin = (GstPlugin *) (plugins->data); + plugins = g_list_next (plugins); + source = gst_plugin_get_source (plugin); + if (!source || strcmp (source, "$SOURCE") != 0) { + continue; + } + + /* skip static coreelements plugin with pipeline and bin element factory */ + if (gst_plugin_get_filename (plugin) == NULL) + continue; + + $debug_log ("plugin: %s source: %s", gst_plugin_get_name (plugin), source); + + if (reinspect) { + gchar *basename; + + inspect_name = g_strdup_printf ("$INSPECT_DIR" G_DIR_SEPARATOR_S "plugin-%s.xml", + gst_plugin_get_name (plugin)); + inspect = fopen (inspect_name, "w"); + if (inspect == NULL) { + g_error ("Could not open %s for writing: %s\\n", inspect_name, + g_strerror (errno)); + } + g_free (inspect_name); + + basename = g_path_get_basename (gst_plugin_get_filename (plugin)); + + /* output plugin data */ + fputs ("\\n",inspect); + fputs (xmlprint(2, "name", gst_plugin_get_name (plugin)),inspect); + fputs (xmlprint(2, "description", gst_plugin_get_description (plugin)),inspect); + fputs (xmlprint(2, "filename", gst_plugin_get_filename (plugin)),inspect); + fputs (xmlprint(2, "basename", basename),inspect); + fputs (xmlprint(2, "version", gst_plugin_get_version (plugin)),inspect); + fputs (xmlprint(2, "license", gst_plugin_get_license (plugin)),inspect); + fputs (xmlprint(2, "source", gst_plugin_get_source (plugin)),inspect); + fputs (xmlprint(2, "package", gst_plugin_get_package (plugin)),inspect); + fputs (xmlprint(2, "origin", gst_plugin_get_origin (plugin)),inspect); + fputs (" \\n", inspect); + + g_free (basename); + } + + features = + gst_registry_get_feature_list_by_plugin (gst_registry_get (), + gst_plugin_get_name (plugin)); + + /* sort factories by feature->name */ + features = g_list_sort (features, gst_feature_sort_compare); + + while (features) { + GstPluginFeature *feature; + feature = GST_PLUGIN_FEATURE (features->data); + feature = gst_plugin_feature_load (feature); + if (!feature) { + g_warning ("Could not load plugin feature %s", + gst_plugin_feature_get_name (feature)); + } + + if (GST_IS_ELEMENT_FACTORY (feature)) { + const gchar *pad_dir[] = { "unknown","source","sink" }; + const gchar *pad_pres[] = { "always","sometimes","request" }; + GList *pads, *pad; + + $debug_log (" feature: %s", gst_plugin_feature_get_name (feature)); + + factory = GST_ELEMENT_FACTORY (feature); + factories = g_list_prepend (factories, factory); + + if (reinspect) { + /* output element data */ + fputs (" \\n", inspect); + fputs (xmlprint(6, "name", gst_plugin_feature_get_name (feature)),inspect); + fputs (xmlprint(6, "longname", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_LONGNAME)),inspect); + fputs (xmlprint(6, "class", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS)),inspect); + fputs (xmlprint(6, "description", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_DESCRIPTION)),inspect); + fputs (xmlprint(6, "author", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_AUTHOR)),inspect); + fputs (" \\n", inspect); + + /* output pad-template data */ + pads = g_list_copy ((GList *) gst_element_factory_get_static_pad_templates (factory)); + pads = g_list_sort (pads, static_pad_template_compare); + for (pad = pads; pad != NULL; pad = pad->next) { + GstStaticPadTemplate *pt = pad->data; + + fputs (" \\n", inspect); + fputs (xmlprint(10, "name", pt->name_template),inspect); + fputs (xmlprint(10, "direction", pad_dir[pt->direction]),inspect); + fputs (xmlprint(10, "presence", pad_pres[pt->presence]),inspect); + fputs (xmlprint(10, "details", pt->static_caps.string),inspect); + fputs (" \\n", inspect); + } + g_list_free (pads); + fputs (" \\n \\n", inspect); + } + } + features = g_list_next (features); + } + + if (reinspect) { + fputs (" \\n", inspect); + fclose (inspect); + } + } + + g_string_free (xmlstr, TRUE); + + $debug_log ("number of element factories: %d", g_list_length (factories)); + + /* allocate the object_types array to hold them */ + object_types = g_new0 (GType, g_list_length (factories)+$ntypes+1); + + l = factories; + i = 0; + + /* fill it */ + while (l) { + factory = GST_ELEMENT_FACTORY (l->data); + type = gst_element_factory_get_element_type (factory); + if (type != 0) { + $debug_log ("adding type for factory %s", gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_LONGNAME)); + object_types[i++] = type; + } else { + g_message ("type info for factory %s not found", + gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_LONGNAME)); + } + l = g_list_next (l); + } + +EOT + +# get_type functions: +for (@types) { +print OUTPUT < uppercase with '_' + * GFileMonitor -> file_monitor + * GIOExtensionPoint -> extension_point + * GtkTreeView -> tree_view + * if 2nd char is upper case too + * search for first lower case and go back one char + * else + * search for next upper case + */ + if (!strncmp (object_name, "Gtk", 3)) + object_arg = object_name + 3; + else if (!strncmp (object_name, "Gnome", 5)) + object_arg = object_name + 5; + else + object_arg = object_name; + + object_arg_lower = g_ascii_strdown (object_arg, -1); + sprintf (pos, "*%s\\n", object_arg_lower); + pos += strlen (pos); + if (!strncmp (object_arg_lower, "widget", 6)) + widget_num = 2; + g_free(object_arg_lower); + + /* Convert signal name to use underscores rather than dashes '-'. */ + strncpy (signal_name, query_info.signal_name, 127); + signal_name[127] = '\\0'; + for (i = 0; signal_name[i]; i++) + { + if (signal_name[i] == '-') + signal_name[i] = '_'; + } + + /* Output the signal parameters. */ + for (param = 0; param < query_info.n_params; param++) + { + type_name = get_type_name (query_info.param_types[param] & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer); + + /* Most arguments to the callback are called "arg1", "arg2", etc. + GtkWidgets are called "widget", "widget2", ... + GtkCallbacks are called "callback", "callback2", ... */ + if (!strcmp (type_name, "GtkWidget")) + { + arg_name = "widget"; + arg_num = &widget_num; + } + else if (!strcmp (type_name, "GtkCallback") + || !strcmp (type_name, "GtkCCallback")) + { + arg_name = "callback"; + arg_num = &callback_num; + } + else + { + arg_name = "arg"; + arg_num = ¶m_num; + } + sprintf (pos, "%s ", type_name); + pos += strlen (pos); + + if (!arg_num || *arg_num == 0) + sprintf (pos, "%s%s\\n", is_pointer ? "*" : " ", arg_name); + else + sprintf (pos, "%s%s%i\\n", is_pointer ? "*" : " ", arg_name, + *arg_num); + pos += strlen (pos); + + if (arg_num) + { + if (*arg_num == 0) + *arg_num = 2; + else + *arg_num += 1; + } + } + + pos = flags; + /* We use one-character flags for simplicity. */ + if (query_info.signal_flags & G_SIGNAL_RUN_FIRST) + *pos++ = 'f'; + if (query_info.signal_flags & G_SIGNAL_RUN_LAST) + *pos++ = 'l'; + if (query_info.signal_flags & G_SIGNAL_RUN_CLEANUP) + *pos++ = 'c'; + if (query_info.signal_flags & G_SIGNAL_NO_RECURSE) + *pos++ = 'r'; + if (query_info.signal_flags & G_SIGNAL_DETAILED) + *pos++ = 'd'; + if (query_info.signal_flags & G_SIGNAL_ACTION) + *pos++ = 'a'; + if (query_info.signal_flags & G_SIGNAL_NO_HOOKS) + *pos++ = 'h'; + *pos = 0; + + /* Output the return type and function name. */ + ret_type = get_type_name (query_info.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer); + + fprintf (fp, + "\\n%s::%s\\n%s%s\\n%s\\n%s\\n\\n", + object_name, query_info.signal_name, ret_type, is_pointer ? "*" : "", flags, buffer); +} + + +/* Returns the type name to use for a signal argument or return value, given + the GtkType from the signal info. It also sets is_pointer to TRUE if the + argument needs a '*' since it is a pointer. */ +static const gchar * +get_type_name (GType type, gboolean * is_pointer) +{ + const gchar *type_name; + + *is_pointer = FALSE; + type_name = g_type_name (type); + + switch (type) { + case G_TYPE_NONE: + case G_TYPE_CHAR: + case G_TYPE_UCHAR: + case G_TYPE_BOOLEAN: + case G_TYPE_INT: + case G_TYPE_UINT: + case G_TYPE_LONG: + case G_TYPE_ULONG: + case G_TYPE_FLOAT: + case G_TYPE_DOUBLE: + case G_TYPE_POINTER: + /* These all have normal C type names so they are OK. */ + return type_name; + + case G_TYPE_STRING: + /* A GtkString is really a gchar*. */ + *is_pointer = TRUE; + return "gchar"; + + case G_TYPE_ENUM: + case G_TYPE_FLAGS: + /* We use a gint for both of these. Hopefully a subtype with a decent + name will be registered and used instead, as GTK+ does itself. */ + return "gint"; + + case G_TYPE_BOXED: + /* The boxed type shouldn't be used itself, only subtypes. Though we + return 'gpointer' just in case. */ + return "gpointer"; + + case G_TYPE_PARAM: + /* A GParam is really a GParamSpec*. */ + *is_pointer = TRUE; + return "GParamSpec"; + +#if GLIB_CHECK_VERSION (2, 25, 9) + case G_TYPE_VARIANT: + *is_pointer = TRUE; + return "GVariant"; +#endif + +default: + break; + } + + /* For all GObject subclasses we can use the class name with a "*", + e.g. 'GtkWidget *'. */ + if (g_type_is_a (type, G_TYPE_OBJECT)) + *is_pointer = TRUE; + + /* Also catch non GObject root types */ + if (G_TYPE_IS_CLASSED (type)) + *is_pointer = TRUE; + + /* All boxed subtypes will be pointers as well. */ + /* Exception: GStrv */ + if (g_type_is_a (type, G_TYPE_BOXED) && + !g_type_is_a (type, G_TYPE_STRV)) + *is_pointer = TRUE; + + /* All pointer subtypes will be pointers as well. */ + if (g_type_is_a (type, G_TYPE_POINTER)) + *is_pointer = TRUE; + + /* But enums are not */ + if (g_type_is_a (type, G_TYPE_ENUM) || + g_type_is_a (type, G_TYPE_FLAGS)) + *is_pointer = FALSE; + + return type_name; +} + + +/* This outputs the hierarchy of all objects which have been initialized, + i.e. by calling their XXX_get_type() initialization function. */ +static void +output_object_hierarchy (void) +{ + FILE *fp; + gint i,j; + GType root, type; + GType root_types[$ntypes] = { G_TYPE_INVALID, }; + + fp = fopen (hierarchy_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", hierarchy_filename, g_strerror(errno)); + return; + } + output_hierarchy (fp, G_TYPE_OBJECT, 0); + output_hierarchy (fp, G_TYPE_INTERFACE, 0); + + for (i=0; object_types[i]; i++) { + root = object_types[i]; + while ((type = g_type_parent (root))) { + root = type; + } + if ((root != G_TYPE_OBJECT) && (root != G_TYPE_INTERFACE)) { + for (j=0; root_types[j]; j++) { + if (root == root_types[j]) { + root = G_TYPE_INVALID; break; + } + } + if(root) { + root_types[j] = root; + output_hierarchy (fp, root, 0); + } + } + } + + fclose (fp); +} + +static int +compare_types (const void *a, const void *b) +{ + const char *na = g_type_name (*((GType *)a)); + const char *nb = g_type_name (*((GType *)b)); + + return g_strcmp0 (na, nb); +} + + +/* This is called recursively to output the hierarchy of a object. */ +static void +output_hierarchy (FILE *fp, + GType type, + guint level) +{ + guint i; + GType *children; + guint n_children; + + if (!type) + return; + + for (i = 0; i < level; i++) + fprintf (fp, " "); + fprintf (fp, "%s\\n", g_type_name (type)); + + children = g_type_children (type, &n_children); + qsort (children, n_children, sizeof (GType), compare_types); + + + for (i=0; i < n_children; i++) + output_hierarchy (fp, children[i], level + 1); + + g_free (children); +} + +static void output_object_interfaces (void) +{ + guint i; + FILE *fp; + + fp = fopen (interfaces_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", interfaces_filename, g_strerror(errno)); + return; + } + output_interfaces (fp, G_TYPE_OBJECT); + + for (i = 0; object_types[i]; i++) + { + if (!g_type_parent (object_types[i]) && + (object_types[i] != G_TYPE_OBJECT) && + G_TYPE_IS_INSTANTIATABLE (object_types[i])) + { + output_interfaces (fp, object_types[i]); + } + } + fclose (fp); +} + +static void +output_interfaces (FILE *fp, + GType type) +{ + guint i; + GType *children, *interfaces; + guint n_children, n_interfaces; + + if (!type) + return; + + interfaces = g_type_interfaces (type, &n_interfaces); + + if (n_interfaces > 0) + { + fprintf (fp, "%s", g_type_name (type)); + for (i=0; i < n_interfaces; i++) + fprintf (fp, " %s", g_type_name (interfaces[i])); + fprintf (fp, "\\n"); + } + g_free (interfaces); + + children = g_type_children (type, &n_children); + + for (i=0; i < n_children; i++) + output_interfaces (fp, children[i]); + + g_free (children); +} + +static void output_interface_prerequisites (void) +{ + FILE *fp; + + fp = fopen (prerequisites_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", prerequisites_filename, g_strerror(errno)); + return; + } + output_prerequisites (fp, G_TYPE_INTERFACE); + fclose (fp); +} + +static void +output_prerequisites (FILE *fp, + GType type) +{ +#if GLIB_CHECK_VERSION(2,1,0) + guint i; + GType *children, *prerequisites; + guint n_children, n_prerequisites; + + if (!type) + return; + + prerequisites = g_type_interface_prerequisites (type, &n_prerequisites); + + if (n_prerequisites > 0) + { + fprintf (fp, "%s", g_type_name (type)); + for (i=0; i < n_prerequisites; i++) + fprintf (fp, " %s", g_type_name (prerequisites[i])); + fprintf (fp, "\\n"); + } + g_free (prerequisites); + + children = g_type_children (type, &n_children); + + for (i=0; i < n_children; i++) + output_prerequisites (fp, children[i]); + + g_free (children); +#endif +} + +static void +output_args (void) +{ + FILE *fp; + gint i; + + fp = fopen (args_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s : %s", args_filename, g_strerror(errno)); + return; + } + + for (i = 0; object_types[i]; i++) { + output_object_args (fp, object_types[i]); + } + + fclose (fp); +} + +static gint +compare_param_specs (const void *a, const void *b) +{ + GParamSpec *spec_a = *(GParamSpec **)a; + GParamSpec *spec_b = *(GParamSpec **)b; + + return strcmp (g_param_spec_get_name (spec_a), g_param_spec_get_name (spec_b)); +} + +/* Its common to have unsigned properties restricted + * to the signed range. Therefore we make this look + * a bit nicer by spelling out the max constants. + */ + +/* Don't use "==" with floats, it might trigger a gcc warning. */ +#define GTKDOC_COMPARE_FLOAT(x, y) (x <= y && x >= y) + +static gchar* +describe_double_constant (gdouble value) +{ + gchar *desc; + + if (GTKDOC_COMPARE_FLOAT (value, G_MAXDOUBLE)) + desc = g_strdup ("G_MAXDOUBLE"); + else if (GTKDOC_COMPARE_FLOAT (value, G_MINDOUBLE)) + desc = g_strdup ("G_MINDOUBLE"); + else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXDOUBLE)) + desc = g_strdup ("-G_MAXDOUBLE"); + else if (GTKDOC_COMPARE_FLOAT (value, G_MAXFLOAT)) + desc = g_strdup ("G_MAXFLOAT"); + else if (GTKDOC_COMPARE_FLOAT (value, G_MINFLOAT)) + desc = g_strdup ("G_MINFLOAT"); + else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXFLOAT)) + desc = g_strdup ("-G_MAXFLOAT"); + else{ + /* make sure floats are output with a decimal dot irrespective of + * current locale. Use formatd since we want human-readable numbers + * and do not need the exact same bit representation when deserialising */ + desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE); + g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", value); + } + + return desc; +} + +static gchar* +describe_signed_constant (gsize size, gint64 value) +{ + gchar *desc = NULL; + + switch (size) { + case 8: + if (value == G_MAXINT64) + desc = g_strdup ("G_MAXINT64"); + else if (value == G_MININT64) + desc = g_strdup ("G_MININT64"); + /* fall through */ + case 4: + if (sizeof (int) == 4) { + if (value == G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MININT) + desc = g_strdup ("G_MININT"); + else if (value == (gint64)G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + if (value == G_MAXLONG) + desc = g_strdup ("G_MAXLONG"); + else if (value == G_MINLONG) + desc = g_strdup ("G_MINLONG"); + else if (value == (gint64)G_MAXULONG) + desc = g_strdup ("G_MAXULONG"); + /* fall through */ + case 2: + if (sizeof (int) == 2) { + if (value == G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MININT) + desc = g_strdup ("G_MININT"); + else if (value == (gint64)G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + break; + default: + break; + } + if (!desc) + desc = g_strdup_printf ("%" G_GINT64_FORMAT, value); + + return desc; +} + +static gchar* +describe_unsigned_constant (gsize size, guint64 value) +{ + gchar *desc = NULL; + + switch (size) { + case 8: + if (value == G_MAXINT64) + desc = g_strdup ("G_MAXINT64"); + else if (value == G_MAXUINT64) + desc = g_strdup ("G_MAXUINT64"); + /* fall through */ + case 4: + if (sizeof (int) == 4) { + if (value == (guint64)G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + if (value == (guint64)G_MAXLONG) + desc = g_strdup ("G_MAXLONG"); + else if (value == G_MAXULONG) + desc = g_strdup ("G_MAXULONG"); + /* fall through */ + case 2: + if (sizeof (int) == 2) { + if (value == (guint64)G_MAXINT) + desc = g_strdup ("G_MAXINT"); + else if (value == G_MAXUINT) + desc = g_strdup ("G_MAXUINT"); + } + break; + default: + break; + } + if (!desc) + desc = g_strdup_printf ("%" G_GUINT64_FORMAT, value); + + return desc; +} + +static gchar* +describe_type (GParamSpec *spec) +{ + gchar *desc; + gchar *lower; + gchar *upper; + + if (G_IS_PARAM_SPEC_CHAR (spec)) + { + GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec); + + lower = describe_signed_constant (sizeof(gchar), pspec->minimum); + upper = describe_signed_constant (sizeof(gchar), pspec->maximum); + if (pspec->minimum == G_MININT8 && pspec->maximum == G_MAXINT8) + desc = g_strdup (""); + else if (pspec->minimum == G_MININT8) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXINT8) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_UCHAR (spec)) + { + GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec); + + lower = describe_unsigned_constant (sizeof(guchar), pspec->minimum); + upper = describe_unsigned_constant (sizeof(guchar), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT8) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXUINT8) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_INT (spec)) + { + GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec); + + lower = describe_signed_constant (sizeof(gint), pspec->minimum); + upper = describe_signed_constant (sizeof(gint), pspec->maximum); + if (pspec->minimum == G_MININT && pspec->maximum == G_MAXINT) + desc = g_strdup (""); + else if (pspec->minimum == G_MININT) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXINT) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_UINT (spec)) + { + GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec); + + lower = describe_unsigned_constant (sizeof(guint), pspec->minimum); + upper = describe_unsigned_constant (sizeof(guint), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXUINT) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_LONG (spec)) + { + GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec); + + lower = describe_signed_constant (sizeof(glong), pspec->minimum); + upper = describe_signed_constant (sizeof(glong), pspec->maximum); + if (pspec->minimum == G_MINLONG && pspec->maximum == G_MAXLONG) + desc = g_strdup (""); + else if (pspec->minimum == G_MINLONG) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXLONG) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_ULONG (spec)) + { + GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec); + + lower = describe_unsigned_constant (sizeof(gulong), pspec->minimum); + upper = describe_unsigned_constant (sizeof(gulong), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXULONG) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXULONG) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_INT64 (spec)) + { + GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec); + + lower = describe_signed_constant (sizeof(gint64), pspec->minimum); + upper = describe_signed_constant (sizeof(gint64), pspec->maximum); + if (pspec->minimum == G_MININT64 && pspec->maximum == G_MAXINT64) + desc = g_strdup (""); + else if (pspec->minimum == G_MININT64) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXINT64) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_UINT64 (spec)) + { + GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec); + + lower = describe_unsigned_constant (sizeof(guint64), pspec->minimum); + upper = describe_unsigned_constant (sizeof(guint64), pspec->maximum); + if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT64) + desc = g_strdup (""); + else if (pspec->minimum == 0) + desc = g_strdup_printf ("<= %s", upper); + else if (pspec->maximum == G_MAXUINT64) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_FLOAT (spec)) + { + GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec); + + lower = describe_double_constant (pspec->minimum); + upper = describe_double_constant (pspec->maximum); + if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXFLOAT)) + { + if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT)) + desc = g_strdup (""); + else + desc = g_strdup_printf ("<= %s", upper); + } + else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT)) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } + else if (G_IS_PARAM_SPEC_DOUBLE (spec)) + { + GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec); + + lower = describe_double_constant (pspec->minimum); + upper = describe_double_constant (pspec->maximum); + if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXDOUBLE)) + { + if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE)) + desc = g_strdup (""); + else + desc = g_strdup_printf ("<= %s", upper); + } + else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE)) + desc = g_strdup_printf (">= %s", lower); + else + desc = g_strdup_printf ("[%s,%s]", lower, upper); + g_free (lower); + g_free (upper); + } +#if GLIB_CHECK_VERSION (2, 12, 0) + else if (G_IS_PARAM_SPEC_GTYPE (spec)) + { + GParamSpecGType *pspec = G_PARAM_SPEC_GTYPE (spec); + gboolean is_pointer; + + desc = g_strdup (get_type_name (pspec->is_a_type, &is_pointer)); + } +#endif +#if GLIB_CHECK_VERSION (2, 25, 9) + else if (G_IS_PARAM_SPEC_VARIANT (spec)) + { + GParamSpecVariant *pspec = G_PARAM_SPEC_VARIANT (spec); + gchar *variant_type; + + variant_type = g_variant_type_dup_string (pspec->type); + desc = g_strdup_printf ("GVariant<%s>", variant_type); + g_free (variant_type); + } +#endif + else + { + desc = g_strdup (""); + } + + return desc; +} + +static gchar* +describe_default (GParamSpec *spec) +{ + gchar *desc; + + if (G_IS_PARAM_SPEC_CHAR (spec)) + { + GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec); + + desc = g_strdup_printf ("%d", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UCHAR (spec)) + { + GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec); + + desc = g_strdup_printf ("%u", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_BOOLEAN (spec)) + { + GParamSpecBoolean *pspec = G_PARAM_SPEC_BOOLEAN (spec); + + desc = g_strdup_printf ("%s", pspec->default_value ? "TRUE" : "FALSE"); + } + else if (G_IS_PARAM_SPEC_INT (spec)) + { + GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec); + + desc = g_strdup_printf ("%d", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UINT (spec)) + { + GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec); + + desc = g_strdup_printf ("%u", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_LONG (spec)) + { + GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec); + + desc = g_strdup_printf ("%ld", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_LONG (spec)) + { + GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec); + + desc = g_strdup_printf ("%lu", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_INT64 (spec)) + { + GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec); + + desc = g_strdup_printf ("%" G_GINT64_FORMAT, pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UINT64 (spec)) + { + GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec); + + desc = g_strdup_printf ("%" G_GUINT64_FORMAT, pspec->default_value); + } + else if (G_IS_PARAM_SPEC_UNICHAR (spec)) + { + GParamSpecUnichar *pspec = G_PARAM_SPEC_UNICHAR (spec); + + if (g_unichar_isprint (pspec->default_value)) + desc = g_strdup_printf ("'%c'", pspec->default_value); + else + desc = g_strdup_printf ("%u", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_ENUM (spec)) + { + GParamSpecEnum *pspec = G_PARAM_SPEC_ENUM (spec); + + GEnumValue *value = g_enum_get_value (pspec->enum_class, pspec->default_value); + if (value) + desc = g_strdup_printf ("%s", value->value_name); + else + desc = g_strdup_printf ("%d", pspec->default_value); + } + else if (G_IS_PARAM_SPEC_FLAGS (spec)) + { + GParamSpecFlags *pspec = G_PARAM_SPEC_FLAGS (spec); + guint default_value; + GString *acc; + + default_value = pspec->default_value; + acc = g_string_new (""); + + while (default_value) + { + GFlagsValue *value = g_flags_get_first_value (pspec->flags_class, default_value); + + if (!value) + break; + + if (acc->len > 0) + g_string_append (acc, "|"); + g_string_append (acc, value->value_name); + + default_value &= ~value->value; + } + + if (default_value == 0) + desc = g_string_free (acc, FALSE); + else + { + desc = g_strdup_printf ("%d", pspec->default_value); + g_string_free (acc, TRUE); + } + } + else if (G_IS_PARAM_SPEC_FLOAT (spec)) + { + GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec); + + /* make sure floats are output with a decimal dot irrespective of + * current locale. Use formatd since we want human-readable numbers + * and do not need the exact same bit representation when deserialising */ + desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE); + g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", + pspec->default_value); + } + else if (G_IS_PARAM_SPEC_DOUBLE (spec)) + { + GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec); + + /* make sure floats are output with a decimal dot irrespective of + * current locale. Use formatd since we want human-readable numbers + * and do not need the exact same bit representation when deserialising */ + desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE); + g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", + pspec->default_value); + } + else if (G_IS_PARAM_SPEC_STRING (spec)) + { + GParamSpecString *pspec = G_PARAM_SPEC_STRING (spec); + + if (pspec->default_value) + { + gchar *esc = g_strescape (pspec->default_value, NULL); + + desc = g_strdup_printf ("\\"%s\\"", esc); + + g_free (esc); + } + else + desc = g_strdup_printf ("NULL"); + } + else + { + desc = g_strdup (""); + } + + return desc; +} + + +static void +output_object_args (FILE *fp, GType object_type) +{ + gpointer class; + const gchar *object_class_name; + guint arg; + gchar flags[16], *pos; + GParamSpec **properties; + guint n_properties; + gboolean child_prop; + gboolean style_prop; + gboolean is_pointer; + const gchar *type_name; + gchar *type_desc; + gchar *default_value; + + if (G_TYPE_IS_OBJECT (object_type)) + { + class = g_type_class_peek (object_type); + if (!class) + return; + + properties = g_object_class_list_properties (class, &n_properties); + } +#if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 3) + else if (G_TYPE_IS_INTERFACE (object_type)) + { + class = g_type_default_interface_ref (object_type); + + if (!class) + return; + + properties = g_object_interface_list_properties (class, &n_properties); + } +#endif + else + return; + + object_class_name = g_type_name (object_type); + + child_prop = FALSE; + style_prop = FALSE; + + while (TRUE) { + qsort (properties, n_properties, sizeof (GParamSpec *), compare_param_specs); + for (arg = 0; arg < n_properties; arg++) + { + GParamSpec *spec = properties[arg]; + const gchar *nick, *blurb, *dot; + + if (spec->owner_type != object_type) + continue; + + pos = flags; + /* We use one-character flags for simplicity. */ + if (child_prop && !style_prop) + *pos++ = 'c'; + if (style_prop) + *pos++ = 's'; + if (spec->flags & G_PARAM_READABLE) + *pos++ = 'r'; + if (spec->flags & G_PARAM_WRITABLE) + *pos++ = 'w'; + if (spec->flags & G_PARAM_CONSTRUCT) + *pos++ = 'x'; + if (spec->flags & G_PARAM_CONSTRUCT_ONLY) + *pos++ = 'X'; + *pos = 0; + + nick = g_param_spec_get_nick (spec); + blurb = g_param_spec_get_blurb (spec); + + dot = ""; + if (blurb) { + int str_len = strlen (blurb); + if (str_len > 0 && blurb[str_len - 1] != '.') + dot = "."; + } + + type_desc = describe_type (spec); + default_value = describe_default (spec); + type_name = get_type_name (spec->value_type, &is_pointer); + fprintf (fp, "\\n%s::%s\\n%s%s\\n%s\\n%s\\n%s\\n%s%s\\n%s\\n\\n\\n", + object_class_name, g_param_spec_get_name (spec), type_name, is_pointer ? "*" : "", type_desc, flags, nick ? nick : "(null)", blurb ? blurb : "(null)", dot, default_value); + g_free (type_desc); + g_free (default_value); + } + + g_free (properties); + +#ifdef GTK_IS_CONTAINER_CLASS + if (!child_prop && GTK_IS_CONTAINER_CLASS (class)) { + properties = gtk_container_class_list_child_properties (class, &n_properties); + child_prop = TRUE; + continue; + } +#endif + +#ifdef GTK_IS_CELL_AREA_CLASS + if (!child_prop && GTK_IS_CELL_AREA_CLASS (class)) { + properties = gtk_cell_area_class_list_cell_properties (class, &n_properties); + child_prop = TRUE; + continue; + } +#endif + +#ifdef GTK_IS_WIDGET_CLASS +#if GTK_CHECK_VERSION(2,1,0) + if (!style_prop && GTK_IS_WIDGET_CLASS (class)) { + properties = gtk_widget_class_list_style_properties (GTK_WIDGET_CLASS (class), &n_properties); + style_prop = TRUE; + continue; + } +#endif +#endif + + break; + } +} +EOT + +close OUTPUT; + +# Compile and run our file + +$CC = $ENV{CC} ? $ENV{CC} : "gcc"; +$LD = $ENV{LD} ? $ENV{LD} : $CC; +$CFLAGS = $ENV{CFLAGS} ? "$ENV{CFLAGS}" : ""; +$LDFLAGS = $ENV{LDFLAGS} ? $ENV{LDFLAGS} : ""; + +my $o_file; +if ($CC =~ /libtool/) { + $o_file = "$MODULE-scan.lo" +} else { + $o_file = "$MODULE-scan.o" +} + +my $stdout=""; +if (!defined($VERBOSE) or $VERBOSE eq "0") { + $stdout=">/dev/null"; +} + +# Compiling scanner +$command = "$CC $stdout $CFLAGS -c -o $o_file $MODULE-scan.c"; +system("($command)") == 0 or die "Compilation of scanner failed: $!\n"; + +# Linking scanner +$command = "$LD $stdout -o $MODULE-scan $o_file $LDFLAGS"; +system($command) == 0 or die "Linking of scanner failed: $!\n"; + +# Running scanner $MODULE-scan "; +system("sh -c ./$MODULE-scan") == 0 or die "Scan failed: $!\n"; + +if (!defined($ENV{"GTK_DOC_KEEP_INTERMEDIATE"})) { + unlink "./$MODULE-scan.c", "./$MODULE-scan.o", "./$MODULE-scan.lo", "./$MODULE-scan"; +} + +&UpdateFileIfChanged ($old_hierarchy_filename, $new_hierarchy_filename, 0); +# we will merge these in scangobj-merge.py +#&UpdateFileIfChanged ($old_interfaces_filename, $new_interfaces_filename, 0); +#&UpdateFileIfChanged ($old_prerequisites_filename, $new_prerequisites_filename, 0); +#&UpdateFileIfChanged ($old_signals_filename, $new_signals_filename, 0); +#&UpdateFileIfChanged ($old_args_filename, $new_args_filename, 0); + diff --git a/common/gtk-doc-plugins.mak b/common/gtk-doc-plugins.mak new file mode 100644 index 0000000..f19e7d7 --- /dev/null +++ b/common/gtk-doc-plugins.mak @@ -0,0 +1,382 @@ +# This is an include file specifically tuned for building documentation +# for GStreamer plug-ins + +help: + @echo + @echo "If you are a doc maintainer, run 'make update' to update" + @echo "the documentation files maintained in git" + @echo + @echo Other useful make targets: + @echo + @echo check-inspected-versions: make sure the inspected plugin info + @echo is up to date before a release + @echo + +# update the stuff maintained by doc maintainers +update: scanobj-update + $(MAKE) check-outdated-docs + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +# thomas: make docs parallel installable +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_API_VERSION@ + +MAINTAINER_DOC_STAMPS = \ + scanobj-build.stamp + +EXTRA_DIST = \ + $(MAINTAINER_DOC_STAMPS) \ + $(srcdir)/inspect/*.xml \ + $(SCANOBJ_FILES) \ + $(content_files) \ + $(extra_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_OVERRIDES) \ + $(DOC_MODULE)-sections.txt + +# we don't add scanobj-build.stamp here since they are built manually by docs +# maintainers and result is commited to git +DOC_STAMPS = \ + scan-build.stamp \ + tmpl-build.stamp \ + sgml-build.stamp \ + html-build.stamp \ + scan.stamp \ + tmpl.stamp \ + sgml.stamp \ + html.stamp + +# files generated/updated by gtkdoc-scangobj +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals \ + $(DOC_MODULE).types + +SCANOBJ_FILES_O = \ + .libs/$(DOC_MODULE)-scan.o + +# files generated/updated by gtkdoc-scan +SCAN_FILES = \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt \ + $(DOC_MODULE)-decl.txt \ + $(DOC_MODULE)-decl-list.txt + + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = \ + $(SCANOBJ_FILES_O) \ + $(REPORT_FILES) \ + $(DOC_STAMPS) \ + inspect-registry.xml + +INSPECT_DIR = inspect + +if ENABLE_GTK_DOC +all-local: html-build.stamp + +### inspect GStreamer plug-ins; done by documentation maintainer ### + +# only look at the plugins in this module when building inspect .xml stuff +INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml +INSPECT_ENVIRONMENT=\ + LC_ALL=C \ + GST_PLUGIN_SYSTEM_PATH_1_0= \ + GST_PLUGIN_PATH_1_0=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext:$(top_builddir)/plugins:$(top_builddir)/src:$(top_builddir)/gnl \ + GST_REGISTRY_1_0=$(INSPECT_REGISTRY) \ + PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ + $(INSPECT_EXTRA_ENVIRONMENT) + +#### scan gobjects; done by documentation maintainer #### +scanobj-update: + -rm scanobj-build.stamp + $(MAKE) scanobj-build.stamp + +# gstdoc-scanobj produces 5 output files (.new) +# scangobj-merge.py merges them into the file which we commit later +# TODO: also merge the hierarchy +scanobj-build.stamp: $(SCANOBJ_DEPS) $(basefiles) + @echo " DOC Introspecting gobjects" + @if test x"$(srcdir)" != x. ; then \ + for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ + do \ + if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ + done; \ + fi; \ + mkdir -p $(INSPECT_DIR); \ + scanobj_options=""; \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + $(INSPECT_ENVIRONMENT) \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \ + CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS) $(WARNING_CFLAGS)" \ + LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + $(GST_DOC_SCANOBJ) $$scanobj_options --type-init-func="gst_init(NULL,NULL)" \ + --module=$(DOC_MODULE) --source=$(PACKAGE) --inspect-dir=$(INSPECT_DIR) && \ + echo " DOC Merging introspection data" && \ + $(PYTHON) \ + $(top_srcdir)/common/scangobj-merge.py $(DOC_MODULE) || exit 1; \ + if test x"$(srcdir)" != x. ; then \ + for f in $(SCANOBJ_FILES); \ + do \ + cmp -s ./$$f $(srcdir)/$$f || cp ./$$f $(srcdir)/ ; \ + done; \ + fi; \ + touch scanobj-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(SCANOBJ_FILES_O): scan-build.stamp + @true + +### scan headers; done on every build ### +scan-build.stamp: $(HFILE_GLOB) $(EXTRA_HFILES) $(basefiles) scanobj-build.stamp + @echo ' DOC Scanning header files' + @if test x"$(srcdir)" != x. ; then \ + for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ + do \ + if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ + done; \ + fi + @_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan \ + $(SCAN_OPTIONS) $(EXTRA_HFILES) \ + --module=$(DOC_MODULE) \ + $${_source_dir} \ + --ignore-headers="$(IGNORE_HFILES)"; \ + touch scan-build.stamp + +#### update templates; done on every build #### + +# in a non-srcdir build, we need to copy files from the previous step +# and the files from previous runs of this step +tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES) + @echo ' DOC Rebuilding template files' + @if test x"$(srcdir)" != x. ; then \ + for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ + do \ + if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ + done; \ + fi + @gtkdoc-mktmpl --module=$(DOC_MODULE) + @$(PYTHON) \ + $(top_srcdir)/common/mangle-tmpl.py $(srcdir)/$(INSPECT_DIR) tmpl + @touch tmpl-build.stamp + +tmpl.stamp: tmpl-build.stamp + @true + +#### xml #### + +sgml-build.stamp: tmpl.stamp scan-build.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xsl $(expand_content_files) + @echo ' DOC Building XML' + @-mkdir -p xml + @for a in $(srcdir)/$(INSPECT_DIR)/*.xml; do \ + xsltproc --stringparam module $(MODULE) \ + $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done + @for f in $(EXAMPLE_CFILES); do \ + $(PYTHON) $(top_srcdir)/common/c-to-xml.py $$f > xml/element-`basename $$f .c`.xml; done + @gtkdoc-mkdb \ + --module=$(DOC_MODULE) \ + --source-dir=$(DOC_SOURCE_DIR) \ + --expand-content-files="$(expand_content_files)" \ + --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \ + --output-format=xml \ + --ignore-files="$(IGNORE_HFILES) $(IGNORE_CFILES)" \ + $(MKDB_OPTIONS) + @cp ../version.entities xml + @touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo ' DOC Building HTML' + @rm -rf html + @mkdir html + @cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html + @for f in $(content_files); do cp $(srcdir)/$$f html; done + @cp -pr xml html + @cp ../version.entities html + @mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$(?)" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(DOC_MODULE)-@GST_API_VERSION@ $(DOC_MAIN_SGML_FILE) + @rm -f html/$(DOC_MAIN_SGML_FILE) + @rm -rf html/xml + @rm -f html/version.entities + @test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \ + if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done + @echo ' DOC Fixing cross-references' + @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @touch html-build.stamp + +clean-local-gtkdoc: + @rm -rf xml tmpl html +# clean files copied for nonsrcdir templates build + @if test x"$(srcdir)" != x. ; then \ + rm -rf $(SCANOBJ_FILES) $(SCAN_FILES) $(REPORT_FILES) \ + $(MAINTAINER_DOC_STAMPS); \ + fi +else +all-local: +clean-local-gtkdoc: +endif + +clean-local: clean-local-gtkdoc + @rm -f *~ *.bak + @rm -rf .libs + +distclean-local: + @rm -f $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @rm -rf tmpl/*.sgml.bak + @rm -f $(DOC_MODULE).hierarchy + @rm -f *.stamp || true + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(DOC_MODULE)-docs.sgml ; \ + rm -f $(DOC_MODULE).types ; \ + rm -f $(DOC_MODULE).interfaces ; \ + rm -f $(DOC_MODULE)-overrides.txt ; \ + rm -f $(DOC_MODULE).prerequisites ; \ + rm -f $(DOC_MODULE)-sections.txt ; \ + rm -rf tmpl/*.sgml ; \ + rm -rf $(INSPECT_DIR); \ + fi + @rm -rf *.o + +MAINTAINERCLEANFILES = $(MAINTAINER_DOC_STAMPS) + +# thomas: make docs parallel installable; devhelp requires majorminor too +install-data-local: + (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \ + if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \ + then echo '-- Nothing to install' ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + pngfiles=`echo ./html/*.png`; \ + if test "$$pngfiles" != './html/*.png'; then \ + for i in $$pngfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + fi; \ + echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2' ; \ + if test -e $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; then \ + $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2 \ + $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ + fi) +uninstall-local: + if test -d $(DESTDIR)$(TARGET_DIR); then \ + rm -rf $(DESTDIR)$(TARGET_DIR)/*; \ + rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \ + else \ + echo '-- Nothing to uninstall' ; \ + fi; + +# +# Checks +# +if ENABLE_GTK_DOC +check-hierarchy: $(DOC_MODULE).hierarchy + @if grep ' ' $(DOC_MODULE).hierarchy; then \ + echo "$(DOC_MODULE).hierarchy contains tabs, please fix"; \ + /bin/false; \ + fi + +check: check-hierarchy +endif + +# wildcard is apparently not portable to other makes, hence the use of find +inspect_files = $(shell find $(srcdir)/$(INSPECT_DIR) -name '*.xml') + +check-inspected-versions: + @echo Checking plugin versions of inspected plugin data ...; \ + fail=0 ; \ + for each in $(inspect_files) ; do \ + if (grep -H '' $$each | grep -v '$(VERSION)'); then \ + echo $$each should be fixed to say version $(VERSION) or be removed ; \ + echo "sed -i -e 's//$(VERSION)<\/version>/'" $$each; \ + echo ; \ + fail=1; \ + fi ; \ + done ; \ + exit $$fail + +check-outdated-docs: + $(AM_V_GEN)echo Checking for outdated plugin inspect data ...; \ + fail=0 ; \ + if [ -d $(top_srcdir)/.git/ ]; then \ + files=`find $(srcdir)/inspect/ -name '*xml'`; \ + for f in $$files; do \ + ver=`grep '$(PACKAGE_VERSION)' $$f`; \ + if test "x$$ver" = "x"; then \ + plugin=`echo $$f | sed -e 's/^.*plugin-//' -e 's/.xml//'`; \ + # echo "Checking $$plugin $$f"; \ + pushd "$(top_srcdir)" >/dev/null; \ + pinit=`git grep -A3 GST_PLUGIN_DEFINE -- ext/ gst/ sys/ | grep "\"$$plugin\""`; \ + popd >/dev/null; \ + # echo "[$$pinit]"; \ + if test "x$$pinit" = "x"; then \ + printf " **** outdated docs for plugin %-15s: %s\n" $$plugin $$f; \ + fail=1; \ + fi; \ + fi; \ + done; \ + fi ; \ + exit $$fail + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +# FIXME: decide whether we want to dist generated html or not +# also this only works, if the project has been build before +# we could dist html only if its there, but that might lead to missing html in +# tarballs +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/html + cp html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs check-outdated-docs inspect + +# avoid spurious build errors when distchecking with -jN +.NOTPARALLEL: diff --git a/common/gtk-doc.mak b/common/gtk-doc.mak new file mode 100644 index 0000000..9d76889 --- /dev/null +++ b/common/gtk-doc.mak @@ -0,0 +1,227 @@ +########################################################################### +# Everything below here is generic and you shouldn't need to change it. +########################################################################### +# thomas: except of course that we did + +# thomas: copied from glib-2 +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +# thomas: make docs parallel installable +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_API_VERSION@ + +EXTRA_DIST = \ + $(content_files) \ + $(extra_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE).types \ + $(DOC_OVERRIDES) \ + $(DOC_MODULE)-sections.txt + +DOC_STAMPS = \ + setup-build.stamp \ + scan-build.stamp \ + sgml-build.stamp \ + html-build.stamp \ + sgml.stamp \ + html.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals \ + .libs/$(DOC_MODULE)-scan.o + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) doc-registry.xml + +if ENABLE_GTK_DOC +all-local: html-build.stamp + +#### setup #### + +setup-build.stamp: $(content_files) + -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + echo ' DOC Preparing build'; \ + files=`echo $(DOC_MAIN_SGML_FILE) $(DOC_OVERRIDES) $(DOC_MODULE)-sections.txt $(DOC_MODULE).types $(content_files)`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + test -f $(abs_srcdir)/$$file && \ + cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ + done; \ + fi; \ + fi + @touch setup-build.stamp + +#### scan #### + +# in the case of non-srcdir builds, the built gst directory gets added +# to gtk-doc scanning; but only then, to avoid duplicates +scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) + @echo ' DOC Scanning header files' + @_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan \ + $(SCAN_OPTIONS) $(EXTRA_HFILES) \ + --module=$(DOC_MODULE) \ + $${_source_dir} \ + --ignore-headers="$(IGNORE_HFILES)" + @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null; then \ + echo " DOC Introspecting gobjects"; \ + GST_PLUGIN_SYSTEM_PATH_1_0=`cd $(top_builddir) && pwd` \ + GST_PLUGIN_PATH_1_0= \ + GST_REGISTRY_1_0=doc-registry.xml \ + $(GTKDOC_EXTRA_ENVIRONMENT) \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \ + CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \ + LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \ + --module=$(DOC_MODULE) ; \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + @touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### xml #### + +sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files) + @echo ' DOC Building XML' + @gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) + @cp ../version.entities xml + @touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo ' DOC Building HTML' + @rm -rf html + @mkdir html + @cp -pr xml html + @cp ../version.entities ./ + @mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$(?)" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + @gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$(?)" = "0"; then \ + mkhtml_options=--path="$(abs_srcdir)"; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE)-@GST_API_VERSION@ ../$(DOC_MAIN_SGML_FILE) + @rm -rf html/xml + @rm -f version.entities + @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html ) + @echo ' DOC Fixing cross-references' + @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @touch html-build.stamp + +clean-local-gtkdoc: + @rm -rf xml tmpl html +# clean files copied for nonsrcdir templates build + @if test x"$(srcdir)" != x. ; then \ + rm -rf $(DOC_MODULE).types; \ + fi +else +all-local: +clean-local-gtkdoc: +endif + +clean-local: clean-local-gtkdoc + @rm -f *~ *.bak + @rm -rf .libs + +distclean-local: + @rm -f $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @rm -rf tmpl/*.sgml.bak + @rm -f $(DOC_MODULE).hierarchy + @rm -f *.stamp || true + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(DOC_MAIN_SGML_FILE) ; \ + rm -f $(DOC_OVERRIDES) ; \ + rm -f $(DOC_MODULE).types ; \ + rm -f $(DOC_MODULE).interfaces ; \ + rm -f $(DOC_MODULE).prerequisites ; \ + rm -f $(DOC_MODULE)-sections.txt ; \ + rm -f $(content_files) ; \ + rm -rf tmpl/*.sgml ; \ + fi + @rm -rf *.o + +maintainer-clean-local: clean + @cd $(srcdir) && rm -rf html \ + xml $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +# thomas: make docs parallel installable; devhelp requires majorminor too +install-data-local: + (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \ + if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \ + then echo '-- Nothing to install' ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2' ; \ + if test -e $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; then \ + $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2 \ + $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ + fi) +uninstall-local: + if test -d $(DESTDIR)$(TARGET_DIR); then \ + rm -rf $(DESTDIR)$(TARGET_DIR)/*; \ + rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \ + else \ + echo '-- Nothing to uninstall' ; \ + fi; + + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/html + cp html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs + +# avoid spurious build errors when distchecking with -jN +.NOTPARALLEL: diff --git a/common/m4/Makefile.am b/common/m4/Makefile.am new file mode 100644 index 0000000..3d387ee --- /dev/null +++ b/common/m4/Makefile.am @@ -0,0 +1,40 @@ +EXTRA_DIST = \ + README \ + as-ac-expand.m4 \ + as-auto-alt.m4 \ + as-compiler-flag.m4 \ + as-compiler.m4 \ + as-docbook.m4 \ + as-gcc-inline-assembly.m4 \ + as-libtool.m4 \ + as-libtool-tags.m4 \ + as-python.m4 \ + as-version.m4 \ + ax_create_stdint_h.m4 \ + glib-gettext.m4 \ + gst-arch.m4 \ + gst-args.m4 \ + gst-check.m4 \ + gst-debuginfo.m4 \ + gst-default.m4 \ + gst-doc.m4 \ + gst-dowhile.m4 \ + gst-error.m4 \ + gst-feature.m4 \ + gst-function.m4 \ + gst-gettext.m4 \ + gst-glib2.m4 \ + gst-libxml2.m4 \ + gst-parser.m4 \ + gst-package-release-datetime.m4 \ + gst-platform.m4 \ + gst-plugindir.m4 \ + gst-plugin-docs.m4 \ + gst-valgrind.m4 \ + gst-x11.m4 \ + gst.m4 \ + gtk-doc.m4 \ + introspection.m4 \ + pkg.m4 \ + check.m4 \ + orc.m4 diff --git a/common/m4/Makefile.in b/common/m4/Makefile.in new file mode 100644 index 0000000..80550ab --- /dev/null +++ b/common/m4/Makefile.in @@ -0,0 +1,594 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = common/m4 +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am README +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-docbook.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-doc.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/introspection.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAT_ENTRY_END = @CAT_ENTRY_END@ +CAT_ENTRY_START = @CAT_ENTRY_START@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPD_PLUGINS_DIR = @GSTPD_PLUGINS_DIR@ +GSTPG_PLUGINS_DIR = @GSTPG_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALL_CFLAGS = @GST_ALL_CFLAGS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_ALL_LIBS = @GST_ALL_LIBS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OBJ_CFLAGS = @GST_OBJ_CFLAGS@ +GST_OBJ_LIBS = @GST_OBJ_LIBS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PKG_CONFIG_PATH = @GST_PKG_CONFIG_PATH@ +GST_PLUGINS_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@ +GST_PLUGINS_BAD_DIR = @GST_PLUGINS_BAD_DIR@ +GST_PLUGINS_BAD_LIBS = @GST_PLUGINS_BAD_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@ +GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@ +GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ +HAVE_DVIPS = @HAVE_DVIPS@ +HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ +HAVE_JADETEX = @HAVE_JADETEX@ +HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ +HAVE_PNMTOPS = @HAVE_PNMTOPS@ +HAVE_PS2PDF = @HAVE_PS2PDF@ +HAVE_XMLLINT = @HAVE_XMLLINT@ +HAVE_XSLTPROC = @HAVE_XSLTPROC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCGROUP_CFLAGS = @LIBCGROUP_CFLAGS@ +LIBCGROUP_LIBS = @LIBCGROUP_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XML_CATALOG = @XML_CATALOG@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + README \ + as-ac-expand.m4 \ + as-auto-alt.m4 \ + as-compiler-flag.m4 \ + as-compiler.m4 \ + as-docbook.m4 \ + as-gcc-inline-assembly.m4 \ + as-libtool.m4 \ + as-libtool-tags.m4 \ + as-python.m4 \ + as-version.m4 \ + ax_create_stdint_h.m4 \ + glib-gettext.m4 \ + gst-arch.m4 \ + gst-args.m4 \ + gst-check.m4 \ + gst-debuginfo.m4 \ + gst-default.m4 \ + gst-doc.m4 \ + gst-dowhile.m4 \ + gst-error.m4 \ + gst-feature.m4 \ + gst-function.m4 \ + gst-gettext.m4 \ + gst-glib2.m4 \ + gst-libxml2.m4 \ + gst-parser.m4 \ + gst-package-release-datetime.m4 \ + gst-platform.m4 \ + gst-plugindir.m4 \ + gst-plugin-docs.m4 \ + gst-valgrind.m4 \ + gst-x11.m4 \ + gst.m4 \ + gtk-doc.m4 \ + introspection.m4 \ + pkg.m4 \ + check.m4 \ + orc.m4 + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/m4/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/m4/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 +installdirs: +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-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: diff --git a/common/m4/README b/common/m4/README new file mode 100644 index 0000000..867a344 --- /dev/null +++ b/common/m4/README @@ -0,0 +1,3 @@ +All aclocal .m4 files we need are put here and cat'd to acinclude.m4 in +the source root. Official ones (taken from the relevant devel packages) +are named as-is, unofficial ones (or changed ones) get a gst-prefix. diff --git a/common/m4/as-ac-expand.m4 b/common/m4/as-ac-expand.m4 new file mode 100644 index 0000000..d6c9e33 --- /dev/null +++ b/common/m4/as-ac-expand.m4 @@ -0,0 +1,43 @@ +dnl as-ac-expand.m4 0.2.0 +dnl autostars m4 macro for expanding directories using configure's prefix +dnl thomas@apestaart.org + +dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR) +dnl example +dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) +dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local + +AC_DEFUN([AS_AC_EXPAND], +[ + EXP_VAR=[$1] + FROM_VAR=[$2] + + dnl first expand prefix and exec_prefix if necessary + prefix_save=$prefix + exec_prefix_save=$exec_prefix + + dnl if no prefix given, then use /usr/local, the default prefix + if test "x$prefix" = "xNONE"; then + prefix="$ac_default_prefix" + fi + dnl if no exec_prefix given, then use prefix + if test "x$exec_prefix" = "xNONE"; then + exec_prefix=$prefix + fi + + full_var="$FROM_VAR" + dnl loop until it doesn't change anymore + while true; do + new_full_var="`eval echo $full_var`" + if test "x$new_full_var" = "x$full_var"; then break; fi + full_var=$new_full_var + done + + dnl clean up + full_var=$new_full_var + AC_SUBST([$1], "$full_var") + + dnl restore prefix and exec_prefix + prefix=$prefix_save + exec_prefix=$exec_prefix_save +]) diff --git a/common/m4/as-auto-alt.m4 b/common/m4/as-auto-alt.m4 new file mode 100644 index 0000000..3f7920d --- /dev/null +++ b/common/m4/as-auto-alt.m4 @@ -0,0 +1,50 @@ +dnl as-auto-alt.m4 0.0.2 +dnl autostars m4 macro for supplying alternate autotools versions to configure +dnl thomas@apestaart.org +dnl +dnl AS_AUTOTOOLS_ALTERNATE() +dnl +dnl supplies --with arguments for autoconf, autoheader, automake, aclocal + +AC_DEFUN([AS_AUTOTOOLS_ALTERNATE], +[ + dnl allow for different autoconf version + AC_ARG_WITH(autoconf, + AC_HELP_STRING([--with-autoconf], + [use a different autoconf for regeneration of Makefiles]), + [ + unset AUTOCONF + AM_MISSING_PROG(AUTOCONF, ${withval}) + AC_MSG_NOTICE([Using $AUTOCONF as autoconf]) + ]) + + dnl allow for different autoheader version + AC_ARG_WITH(autoheader, + AC_HELP_STRING([--with-autoheader], + [use a different autoheader for regeneration of Makefiles]), + [ + unset AUTOHEADER + AM_MISSING_PROG(AUTOHEADER, ${withval}) + AC_MSG_NOTICE([Using $AUTOHEADER as autoheader]) + ]) + + dnl allow for different automake version + AC_ARG_WITH(automake, + AC_HELP_STRING([--with-automake], + [use a different automake for regeneration of Makefiles]), + [ + unset AUTOMAKE + AM_MISSING_PROG(AUTOMAKE, ${withval}) + AC_MSG_NOTICE([Using $AUTOMAKE as automake]) + ]) + + dnl allow for different aclocal version + AC_ARG_WITH(aclocal, + AC_HELP_STRING([--with-aclocal], + [use a different aclocal for regeneration of Makefiles]), + [ + unset ACLOCAL + AM_MISSING_PROG(ACLOCAL, ${withval}) + AC_MSG_NOTICE([Using $ACLOCAL as aclocal]) + ]) +]) diff --git a/common/m4/as-compiler-flag.m4 b/common/m4/as-compiler-flag.m4 new file mode 100644 index 0000000..8bb853a --- /dev/null +++ b/common/m4/as-compiler-flag.m4 @@ -0,0 +1,96 @@ +dnl as-compiler-flag.m4 0.1.0 + +dnl autostars m4 macro for detection of compiler flags + +dnl David Schleef +dnl Tim-Philipp Müller + +dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_COMPILER_FLAG], +[ + AC_MSG_CHECKING([to see if compiler understands $1]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + +dnl AS_CXX_COMPILER_FLAG(CPPFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CPPFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_CXX_COMPILER_FLAG], +[ + AC_REQUIRE([AC_PROG_CXX]) + + AC_MSG_CHECKING([to see if c++ compiler understands $1]) + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $1" + + AC_LANG_PUSH(C++) + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CPPFLAGS="$save_CPPFLAGS" + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + + AC_LANG_POP(C++) + + AC_MSG_RESULT([$flag_ok]) +]) + +dnl AS_OBJC_COMPILER_FLAG(CPPFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CPPFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_OBJC_COMPILER_FLAG], +[ + AC_REQUIRE([AC_PROG_OBJC]) + + AC_MSG_CHECKING([to see if Objective C compiler understands $1]) + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $1" + + AC_LANG_PUSH([Objective C]) + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CPPFLAGS="$save_CPPFLAGS" + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + + AC_LANG_POP([Objective C]) + + AC_MSG_RESULT([$flag_ok]) +]) + diff --git a/common/m4/as-compiler.m4 b/common/m4/as-compiler.m4 new file mode 100644 index 0000000..309a060 --- /dev/null +++ b/common/m4/as-compiler.m4 @@ -0,0 +1,44 @@ +dnl as-compiler.m4 0.1.0 + +dnl autostars m4 macro for detection of compiler flavor + +dnl Thomas Vander Stichele + +dnl $Id: as-compiler.m4,v 1.4 2004/06/01 09:44:19 thomasvs Exp $ + +dnl AS_COMPILER(COMPILER) +dnl will set variable COMPILER to +dnl - gcc +dnl - forte +dnl - (empty) if no guess could be made + +AC_DEFUN([AS_COMPILER], +[ + as_compiler= + AC_MSG_CHECKING(for compiler flavour) + + dnl is it gcc ? + if test "x$GCC" = "xyes"; then + as_compiler="gcc" + fi + + dnl is it forte ? + AC_TRY_RUN([ +int main +(int argc, char *argv[]) +{ +#ifdef __sun + return 0; +#else + return 1; +#endif +} + ], as_compiler="forte", ,) + + if test "x$as_compiler" = "x"; then + AC_MSG_RESULT([unknown !]) + else + AC_MSG_RESULT($as_compiler) + fi + [$1]=$as_compiler +]) diff --git a/common/m4/as-docbook.m4 b/common/m4/as-docbook.m4 new file mode 100644 index 0000000..2e27050 --- /dev/null +++ b/common/m4/as-docbook.m4 @@ -0,0 +1,78 @@ +dnl AS_DOCBOOK([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl checks if xsltproc can build docbook documentation +dnl (which is possible if the catalog is set up properly +dnl I also tried checking for a specific version and type of docbook +dnl but xsltproc seemed to happily run anyway, so we can't check for that +dnl and version +dnl this macro takes inspiration from +dnl http://www.movement.uklinux.net/docs/docbook-autotools/configure.html +AC_DEFUN([AS_DOCBOOK], +[ + XSLTPROC_FLAGS=--nonet + DOCBOOK_ROOT= + TYPE_LC=xml + TYPE_UC=XML + DOCBOOK_VERSION=4.1.2 + + if test -n "$XML_CATALOG_FILES"; then + oldIFS=$IFS + IFS=' ' + for xml_catalog_file in $XML_CATALOG_FILES; do + if test -f $xml_catalog_file; then + XML_CATALOG=$xml_catalog_file + CAT_ENTRY_START='' + break + fi + done + IFS=$oldIFS + elif test ! -f /etc/xml/catalog; then + for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/ /usr/local/share/xsl/docbook ; + do + if test -d "$i"; then + DOCBOOK_ROOT=$i + fi + done + else + XML_CATALOG=/etc/xml/catalog + CAT_ENTRY_START='' + fi + + dnl We need xsltproc to process the test + AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,) + XSLTPROC_WORKS=no + if test -n "$XSLTPROC"; then + AC_MSG_CHECKING([whether xsltproc docbook processing works]) + + if test -n "$XML_CATALOG"; then + DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" + else + DB_FILE="$DOCBOOK_ROOT/xhtml/docbook.xsl" + fi + $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END + + + + +END + if test "$?" = 0; then + XSLTPROC_WORKS=yes + fi + AC_MSG_RESULT($XSLTPROC_WORKS) + fi + + if test "x$XSLTPROC_WORKS" = "xyes"; then + dnl execute ACTION-IF-FOUND + ifelse([$1], , :, [$1]) + else + dnl execute ACTION-IF-NOT-FOUND + ifelse([$2], , :, [$2]) + fi + + AC_SUBST(XML_CATALOG) + AC_SUBST(XSLTPROC_FLAGS) + AC_SUBST(DOCBOOK_ROOT) + AC_SUBST(CAT_ENTRY_START) + AC_SUBST(CAT_ENTRY_END) +]) diff --git a/common/m4/as-gcc-inline-assembly.m4 b/common/m4/as-gcc-inline-assembly.m4 new file mode 100644 index 0000000..af32104 --- /dev/null +++ b/common/m4/as-gcc-inline-assembly.m4 @@ -0,0 +1,52 @@ +dnl as-gcc-inline-assembly.m4 0.1.0 + +dnl autostars m4 macro for detection of gcc inline assembly + +dnl David Schleef + +dnl $Id$ + +dnl AS_COMPILER_FLAG(ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_GCC_INLINE_ASSEMBLY], +[ + AC_MSG_CHECKING([if compiler supports gcc-style inline assembly]) + + AC_TRY_COMPILE([], [ +#ifdef __GNUC_MINOR__ +#if (__GNUC__ * 1000 + __GNUC_MINOR__) < 3004 +#error GCC before 3.4 has critical bugs compiling inline assembly +#endif +#endif +__asm__ (""::) ], [flag_ok=yes], [flag_ok=no]) + + if test "X$flag_ok" = Xyes ; then + $1 + true + else + $2 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + + +AC_DEFUN([AS_GCC_ASM_POWERPC_FPU], +[ + AC_MSG_CHECKING([if compiler supports FPU instructions on PowerPC]) + + AC_TRY_COMPILE([], [__asm__ ("fadd 0,0,0"::) ], [flag_ok=yes], [flag_ok=no]) + + if test "X$flag_ok" = Xyes ; then + $1 + true + else + $2 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + diff --git a/common/m4/as-libtool-tags.m4 b/common/m4/as-libtool-tags.m4 new file mode 100644 index 0000000..06f0ae4 --- /dev/null +++ b/common/m4/as-libtool-tags.m4 @@ -0,0 +1,83 @@ +dnl as-libtool-tags.m4 0.1.4 + +dnl autostars m4 macro for selecting libtool "tags" (languages) + +dnl Andy Wingo does not claim credit for this macro +dnl backported from libtool 1.6 by Paolo Bonzini +dnl see http://lists.gnu.org/archive/html/libtool/2003-12/msg00007.html + +dnl $Id$ + +dnl AS_LIBTOOL_TAGS([tags...]) + +dnl example +dnl AS_LIBTOOL_TAGS([]) for only C (no fortran, etc) + +dnl When AC_LIBTOOL_TAGS is used, I redefine _LT_AC_TAGCONFIG +dnl to be more similar to the libtool 1.6 implementation, which +dnl uses an m4 loop and m4 case instead of a shell loop. This +dnl way the CXX/GCJ/F77/RC tests are not always expanded. + +dnl AS_LIBTOOL_TAGS +dnl --------------- +dnl tags to enable +AC_DEFUN([AS_LIBTOOL_TAGS], +[m4_define([_LT_TAGS],[$1]) +m4_define([_LT_AC_TAGCONFIG], [ + # redefined LT AC TAGCONFIG + if test -f "$ltmain"; 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 + + AC_FOREACH([_LT_TAG], _LT_TAGS, + echo THOMAS: tag _LT_TAG + [m4_case(_LT_TAG, + [CXX], [ + if test -n "$CXX" && test "X$CXX" != "Xno"; then + echo "THOMAS: YAY CXX" + AC_LIBTOOL_LANG_CXX_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [F77], [ + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [GCJ], [ + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [RC], [ + if test -n "$RC" && test "X$RC" != "Xno"; then + AC_LIBTOOL_LANG_RC_CONFIG + available_tags="$available_tags _LT_TAG" + fi], + [m4_errprintn(m4_location[: error: invalid tag name: ]"_LT_TAG") + m4_exit(1)]) + ]) + echo THOMAS: available tags: $available_tags + fi + # 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" + AC_MSG_NOTICE([updated available libtool tags with $available_tags.]) + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + + fi + +])dnl _LT_AC_TAG_CONFIG +]) diff --git a/common/m4/as-libtool.m4 b/common/m4/as-libtool.m4 new file mode 100644 index 0000000..3b16095 --- /dev/null +++ b/common/m4/as-libtool.m4 @@ -0,0 +1,46 @@ +dnl as-libtool.m4 0.1.4 + +dnl autostars m4 macro for libtool versioning + +dnl Thomas Vander Stichele + +dnl $Id: as-libtool.m4,v 1.10 2005/10/15 13:44:23 thomasvs Exp $ + +dnl AS_LIBTOOL(PREFIX, CURRENT, REVISION, AGE, [RELEASE]) + +dnl example +dnl AS_LIBTOOL(GST, 2, 0, 0) + +dnl this macro +dnl - defines [$PREFIX]_CURRENT, REVISION and AGE +dnl - defines [$PREFIX]_LIBVERSION +dnl - defines [$PREFIX]_LT_LDFLAGS to set versioning +dnl - AC_SUBST's them all + +dnl if RELEASE is given, then add a -release option to the LDFLAGS +dnl with the given release version +dnl then use [$PREFIX]_LT_LDFLAGS in the relevant Makefile.am's + +dnl call AM_PROG_LIBTOOL after this call + +AC_DEFUN([AS_LIBTOOL], +[ + [$1]_CURRENT=[$2] + [$1]_REVISION=[$3] + [$1]_AGE=[$4] + [$1]_LIBVERSION=[$2]:[$3]:[$4] + AC_SUBST([$1]_CURRENT) + AC_SUBST([$1]_REVISION) + AC_SUBST([$1]_AGE) + AC_SUBST([$1]_LIBVERSION) + + [$1]_LT_LDFLAGS="$[$1]_LT_LDFLAGS -version-info $[$1]_LIBVERSION" + if test ! -z "[$5]" + then + [$1]_LT_LDFLAGS="$[$1]_LT_LDFLAGS -release [$5]" + fi + AC_SUBST([$1]_LT_LDFLAGS) + + LT_PREREQ([2.2.6]) + LT_INIT([dlopen win32-dll disable-static]) +]) diff --git a/common/m4/as-python.m4 b/common/m4/as-python.m4 new file mode 100644 index 0000000..eb9b175 --- /dev/null +++ b/common/m4/as-python.m4 @@ -0,0 +1,152 @@ +## ------------------------ +## Python file handling +## From Andrew Dalke +## Updated by James Henstridge +## Updated by Andy Wingo to loop through possible pythons +## ------------------------ + +# AS_PATH_PYTHON([MINIMUM-VERSION]) + +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. + +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. + +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). + +# If the MINIMUM-VERSION argument is passed, AS_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. + +# Updated to loop over all possible python binaries by Andy Wingo +# +# Updated to only warn and unset PYTHON if no good one is found + +AC_DEFUN([AS_PATH_PYTHON], + [ + dnl Find a version of Python. I could check for python versions 1.4 + dnl or earlier, but the default installation locations changed from + dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages + dnl in 1.5, and I don't want to maintain that logic. + + dnl should we do the version check? + PYTHON_CANDIDATES="python python2.2 python2.1 python2.0 python2 \ + python1.6 python1.5" + ifelse([$1],[], + [AC_PATH_PROG(PYTHON, $PYTHON_CANDIDATES)], + [ + AC_MSG_NOTICE(Looking for Python version >= $1) + changequote(<<, >>)dnl + prog=" +import sys, string +minver = '$1' +# split string by '.' and convert to numeric +minver_info = map(string.atoi, string.split(minver, '.')) +# we can now do comparisons on the two lists: +if sys.version_info >= tuple(minver_info): + sys.exit(0) +else: + sys.exit(1)" + changequote([, ])dnl + + python_good=false + for python_candidate in $PYTHON_CANDIDATES; do + unset PYTHON + AC_PATH_PROG(PYTHON, $python_candidate) 1> /dev/null 2> /dev/null + + if test "x$PYTHON" = "x"; then continue; fi + + if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC; then + AC_MSG_CHECKING(["$PYTHON":]) + AC_MSG_RESULT([okay]) + python_good=true + break; + else + dnl clear the cache val + unset ac_cv_path_PYTHON + fi + done + ]) + + if test "$python_good" != "true"; then + AC_MSG_WARN([No suitable version of python found]) + PYTHON= + else + + AC_MSG_CHECKING([local Python configuration]) + + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. Need to change quote character because of [:3] + + AC_SUBST(PYTHON_VERSION) + changequote(<<, >>)dnl + PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"` + changequote([, ])dnl + + + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. + + AC_SUBST(PYTHON_PREFIX) + PYTHON_PREFIX='${prefix}' + + AC_SUBST(PYTHON_EXEC_PREFIX) + PYTHON_EXEC_PREFIX='${exec_prefix}' + + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. + + AC_SUBST(PYTHON_PLATFORM) + PYTHON_PLATFORM=`$PYTHON -c "import sys; print sys.platform"` + + + dnl Set up 4 directories: + + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behaviour + dnl is more consistent with lispdir.m4 for example. + dnl + dnl Also, if the package prefix isn't the same as python's prefix, + dnl then the old $(pythondir) was pretty useless. + + AC_SUBST(pythondir) + pythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpythondir) + pkgpythondir=\${pythondir}/$PACKAGE + + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) Was PYTHON_SITE_EXEC in previous betas. + + AC_SUBST(pyexecdir) + pyexecdir=$PYTHON_EXEC_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpyexecdir) + pkgpyexecdir=\${pyexecdir}/$PACKAGE + + AC_MSG_RESULT([looks good]) + + fi +]) diff --git a/common/m4/as-version.m4 b/common/m4/as-version.m4 new file mode 100644 index 0000000..22ff774 --- /dev/null +++ b/common/m4/as-version.m4 @@ -0,0 +1,75 @@ +dnl as-version.m4 0.2.0 + +dnl autostars m4 macro for versioning + +dnl Thomas Vander Stichele + +dnl $Id: as-version.m4,v 1.15 2006/04/01 09:40:24 thomasvs Exp $ + +dnl AS_VERSION + +dnl example +dnl AS_VERSION + +dnl this macro +dnl - AC_SUBST's PACKAGE_VERSION_MAJOR, _MINOR, _MICRO +dnl - AC_SUBST's PACKAGE_VERSION_RELEASE, +dnl which can be used for rpm release fields +dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents +dnl maintainer mode from running correctly +dnl +dnl don't forget to put #undef PACKAGE_VERSION_RELEASE in acconfig.h +dnl if you use acconfig.h + +AC_DEFUN([AS_VERSION], +[ + PACKAGE_VERSION_MAJOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f1) + PACKAGE_VERSION_MINOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f2) + PACKAGE_VERSION_MICRO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f3) + + AC_SUBST(PACKAGE_VERSION_MAJOR) + AC_SUBST(PACKAGE_VERSION_MINOR) + AC_SUBST(PACKAGE_VERSION_MICRO) +]) + +dnl AS_NANO(ACTION-IF-NANO-NON-NULL, [ACTION-IF-NANO-NULL]) + +dnl requires AC_INIT to be called before +dnl For projects using a fourth or nano number in your versioning to indicate +dnl development or prerelease snapshots, this macro allows the build to be +dnl set up differently accordingly. + +dnl this macro: +dnl - parses AC_PACKAGE_VERSION, set by AC_INIT, and extracts the nano number +dnl - sets the variable PACKAGE_VERSION_NANO +dnl - sets the variable PACKAGE_VERSION_RELEASE, which can be used +dnl for rpm release fields +dnl - executes ACTION-IF-NANO-NON-NULL or ACTION-IF-NANO-NULL + +dnl example: +dnl AS_NANO(RELEASE="yes", RELEASE="no") + +AC_DEFUN([AS_NANO], +[ + AC_MSG_CHECKING(nano version) + + NANO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f4) + + if test x"$NANO" = x || test "x$NANO" = "x0" ; then + AC_MSG_RESULT([0 (release)]) + NANO=0 + PACKAGE_VERSION_RELEASE=1 + ifelse([$1], , :, [$1]) + else + AC_MSG_RESULT($NANO) + PACKAGE_VERSION_RELEASE=0.`date +%Y%m%d.%H%M%S` + if test "x$NANO" != "x1" ; then + ifelse([$1], , :, [$1]) + else + ifelse([$2], , :, [$2]) + fi + fi + PACKAGE_VERSION_NANO=$NANO + AC_SUBST(PACKAGE_VERSION_NANO) + AC_SUBST(PACKAGE_VERSION_RELEASE) +]) diff --git a/common/m4/ax_create_stdint_h.m4 b/common/m4/ax_create_stdint_h.m4 new file mode 100644 index 0000000..13bf699 --- /dev/null +++ b/common/m4/ax_create_stdint_h.m4 @@ -0,0 +1,734 @@ +##### http://autoconf-archive.cryp.to/ax_create_stdint_h.html +# +# SYNOPSIS +# +# AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] +# +# DESCRIPTION +# +# the "ISO C9X: 7.18 Integer types " section requires the +# existence of an include file that defines a set of +# typedefs, especially uint8_t,int32_t,uintptr_t. Many older +# installations will not provide this file, but some will have the +# very same definitions in . In other enviroments we can +# use the inet-types in which would define the typedefs +# int8_t and u_int8_t respectivly. +# +# This macros will create a local "_stdint.h" or the headerfile given +# as an argument. In many cases that file will just "#include +# " or "#include ", while in other environments +# it will provide the set of basic 'stdint's definitions/typedefs: +# +# int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t +# int_least32_t.. int_fast32_t.. intmax_t +# +# which may or may not rely on the definitions of other files, or +# using the AC_CHECK_SIZEOF macro to determine the actual sizeof each +# type. +# +# if your header files require the stdint-types you will want to +# create an installable file mylib-int.h that all your other +# installable header may include. So if you have a library package +# named "mylib", just use +# +# AX_CREATE_STDINT_H(mylib-int.h) +# +# in configure.ac and go to install that very header file in +# Makefile.am along with the other headers (mylib.h) - and the +# mylib-specific headers can simply use "#include " to +# obtain the stdint-types. +# +# Remember, if the system already had a valid , the +# generated file will include it directly. No need for fuzzy +# HAVE_STDINT_H things... (oops, GCC 4.2.x has deliberatly disabled +# its stdint.h for non-c99 compilation and the c99-mode is not the +# default. Therefore this macro will not use the compiler's stdint.h +# - please complain to the GCC developers). +# +# LAST MODIFICATION +# +# 2007-06-27 +# +# COPYLEFT +# +# Copyright (c) 2007 Guido U. Draheim +# +# 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, the respective Autoconf Macro's copyright +# owner gives unlimited permission to copy, distribute and modify the +# configure scripts that are the output of Autoconf when processing +# the Macro. You need not follow the terms of the GNU General Public +# License when using or distributing such scripts, even though +# portions of the text of the Macro appear in them. The GNU General +# Public License (GPL) does govern all other use of the material that +# constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the +# Autoconf Macro released by the Autoconf Macro Archive. When you +# make and distribute a modified version of the Autoconf Macro, you +# may extend this special exception to the GPL to apply to your +# modified version as well. + +AC_DEFUN([AX_CHECK_DATA_MODEL],[ + AC_CHECK_SIZEOF(char) + AC_CHECK_SIZEOF(short) + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + AC_CHECK_SIZEOF(void*) + ac_cv_char_data_model="" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" + ac_cv_long_data_model="" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" + AC_MSG_CHECKING([data model]) + case "$ac_cv_char_data_model/$ac_cv_long_data_model" in + 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; + 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; + 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; + 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; + 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; + 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; + 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; + 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; + 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; + 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; + 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; + 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; + 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; + 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; + 222/*|333/*|444/*|666/*|888/*) : + ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; + *) ac_cv_data_model="none" ; n="very unusual model" ;; + esac + AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)]) +]) + +dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF]) +AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[ +AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ + ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h sys/types.h]) + do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uint64_t + AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + done + AC_MSG_CHECKING([for stdint uintptr_t]) + ]) +]) + +AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[ +AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ + ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h sys/types.h stdint.h]) + do + unset ac_cv_type_uint32_t + unset ac_cv_type_uint64_t + AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + break; + done + AC_MSG_CHECKING([for stdint uint32_t]) + ]) +]) + +AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[ +AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ + ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do + unset ac_cv_type_u_int32_t + unset ac_cv_type_u_int64_t + AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + break; + done + AC_MSG_CHECKING([for stdint u_int32_t]) + ]) +]) + +AC_DEFUN([AX_CREATE_STDINT_H], +[# ------ AX CREATE STDINT H ------------------------------------- +AC_MSG_CHECKING([for stdint types]) +ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` +# try to shortcircuit - if the default include path of the compiler +# can find a "stdint.h" header then we assume that all compilers can. +AC_CACHE_VAL([ac_cv_header_stdint_t],[ +old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" +old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" +old_CFLAGS="$CFLAGS" ; CFLAGS="" +AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], +[ac_cv_stdint_result="(assuming C99 compatible system)" + ac_cv_header_stdint_t="stdint.h"; ], +[ac_cv_header_stdint_t=""]) +if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then +CFLAGS="-std=c99" +AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], +[AC_MSG_WARN(your GCC compiler has a defunct stdint.h for its default-mode)]) +fi +CXXFLAGS="$old_CXXFLAGS" +CPPFLAGS="$old_CPPFLAGS" +CFLAGS="$old_CFLAGS" ]) + +v="... $ac_cv_header_stdint_h" +if test "$ac_stdint_h" = "stdint.h" ; then + AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)]) +elif test "$ac_stdint_h" = "inttypes.h" ; then + AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)]) +elif test "_$ac_cv_header_stdint_t" = "_" ; then + AC_MSG_RESULT([(putting them into $ac_stdint_h)$v]) +else + ac_cv_header_stdint="$ac_cv_header_stdint_t" + AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)]) +fi + +if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. + +dnl .....intro message done, now do a few system checks..... +dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, +dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW +dnl instead that is triggered with 3 or more arguments (see types.m4) + +inttype_headers=`echo $2 | sed -e 's/,/ /g'` + +ac_cv_stdint_result="(no helpful system typedefs seen)" +AX_CHECK_HEADER_STDINT_X(dnl + stdint.h inttypes.h sys/inttypes.h $inttype_headers, + ac_cv_stdint_result="(seen uintptr_t$and64 in $i)") + +if test "_$ac_cv_header_stdint_x" = "_" ; then +AX_CHECK_HEADER_STDINT_O(dnl, + inttypes.h sys/inttypes.h stdint.h $inttype_headers, + ac_cv_stdint_result="(seen uint32_t$and64 in $i)") +fi + +if test "_$ac_cv_header_stdint_x" = "_" ; then +if test "_$ac_cv_header_stdint_o" = "_" ; then +AX_CHECK_HEADER_STDINT_U(dnl, + sys/types.h inttypes.h sys/inttypes.h $inttype_headers, + ac_cv_stdint_result="(seen u_int32_t$and64 in $i)") +fi fi + +dnl if there was no good C99 header file, do some typedef checks... +if test "_$ac_cv_header_stdint_x" = "_" ; then + AC_MSG_CHECKING([for stdint datatype model]) + AC_MSG_RESULT([(..)]) + AX_CHECK_DATA_MODEL +fi + +if test "_$ac_cv_header_stdint_x" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_x" +elif test "_$ac_cv_header_stdint_o" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_o" +elif test "_$ac_cv_header_stdint_u" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_u" +else + ac_cv_header_stdint="stddef.h" +fi + +AC_MSG_CHECKING([for extra inttypes in chosen header]) +AC_MSG_RESULT([($ac_cv_header_stdint)]) +dnl see if int_least and int_fast types are present in _this_ header. +unset ac_cv_type_int_least32_t +unset ac_cv_type_int_fast32_t +AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) +AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) +AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>]) + +fi # shortcircut to system "stdint.h" +# ------------------ PREPARE VARIABLES ------------------------------ +if test "$GCC" = "yes" ; then +ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` +else +ac_cv_stdint_message="using $CC" +fi + +AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl +$ac_cv_stdint_result]) + +dnl ----------------------------------------------------------------- +# ----------------- DONE inttypes.h checks START header ------------- +AC_CONFIG_COMMANDS([$ac_stdint_h],[ +AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h) +ac_stdint=$tmp/_stdint.h + +echo "#ifndef" $_ac_stdint_h >$ac_stdint +echo "#define" $_ac_stdint_h "1" >>$ac_stdint +echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint +echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint +echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint +if test "_$ac_cv_header_stdint_t" != "_" ; then +echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint +echo "#include " >>$ac_stdint +echo "#endif" >>$ac_stdint +echo "#endif" >>$ac_stdint +else + +cat >>$ac_stdint < +#else +#include + +/* .................... configured part ............................ */ + +STDINT_EOF + +echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint +if test "_$ac_cv_header_stdint_x" != "_" ; then + ac_header="$ac_cv_header_stdint_x" + echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint +fi + +echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint +if test "_$ac_cv_header_stdint_o" != "_" ; then + ac_header="$ac_cv_header_stdint_o" + echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint +fi + +echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint +if test "_$ac_cv_header_stdint_u" != "_" ; then + ac_header="$ac_cv_header_stdint_u" + echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint +fi + +echo "" >>$ac_stdint + +if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then + echo "#include <$ac_header>" >>$ac_stdint + echo "" >>$ac_stdint +fi fi + +echo "/* which 64bit typedef has been found */" >>$ac_stdint +if test "$ac_cv_type_uint64_t" = "yes" ; then +echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint +fi +if test "$ac_cv_type_u_int64_t" = "yes" ; then +echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint +fi +echo "" >>$ac_stdint + +echo "/* which type model has been detected */" >>$ac_stdint +if test "_$ac_cv_char_data_model" != "_" ; then +echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint +echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint +else +echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint +echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint +fi +echo "" >>$ac_stdint + +echo "/* whether int_least types were detected */" >>$ac_stdint +if test "$ac_cv_type_int_least32_t" = "yes"; then +echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint +fi +echo "/* whether int_fast types were detected */" >>$ac_stdint +if test "$ac_cv_type_int_fast32_t" = "yes"; then +echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint +fi +echo "/* whether intmax_t type was detected */" >>$ac_stdint +if test "$ac_cv_type_intmax_t" = "yes"; then +echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint +fi +echo "" >>$ac_stdint + + cat >>$ac_stdint <= 199901L +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; + +#elif !defined __STRICT_ANSI__ +#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ +#define _HAVE_UINT64_T +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + +#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ +/* note: all ELF-systems seem to have loff-support which needs 64-bit */ +#if !defined _NO_LONGLONG +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif + +#elif defined __alpha || (defined __mips && defined _ABIN32) +#if !defined _NO_LONGLONG +typedef long int64_t; +typedef unsigned long uint64_t; +#endif + /* compiler/cpu type to define int64_t */ +#endif +#endif +#endif + +#if defined _STDINT_HAVE_U_INT_TYPES +/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ +typedef u_int8_t uint8_t; +typedef u_int16_t uint16_t; +typedef u_int32_t uint32_t; + +/* glibc compatibility */ +#ifndef __int8_t_defined +#define __int8_t_defined +#endif +#endif + +#ifdef _STDINT_NEED_INT_MODEL_T +/* we must guess all the basic types. Apart from byte-adressable system, */ +/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ +/* (btw, those nibble-addressable systems are way off, or so we assume) */ + +dnl /* have a look at "64bit and data size neutrality" at */ +dnl /* http://unix.org/version2/whatsnew/login_64bit.html */ +dnl /* (the shorthand "ILP" types always have a "P" part) */ + +#if defined _STDINT_BYTE_MODEL +#if _STDINT_LONG_MODEL+0 == 242 +/* 2:4:2 = IP16 = a normal 16-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef long int32_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 +/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ +/* 4:4:4 = ILP32 = a normal 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 +/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ +/* 4:8:8 = LP64 = a normal 64-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +/* this system has a "long" of 64bit */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef unsigned long uint64_t; +typedef long int64_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 448 +/* LLP64 a 64-bit system derived from a 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +/* assuming the system has a "long long" */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef unsigned long long uint64_t; +typedef long long int64_t; +#endif +#else +#define _STDINT_NO_INT32_T +#endif +#else +#define _STDINT_NO_INT8_T +#define _STDINT_NO_INT32_T +#endif +#endif + +/* + * quote from SunOS-5.8 sys/inttypes.h: + * Use at your own risk. As of February 1996, the committee is squarely + * behind the fixed sized types; the "least" and "fast" types are still being + * discussed. The probability that the "fast" types may be removed before + * the standard is finalized is high enough that they are not currently + * implemented. + */ + +#if defined _STDINT_NEED_INT_LEAST_T +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +#ifdef _HAVE_UINT64_T +typedef int64_t int_least64_t; +#endif + +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +#ifdef _HAVE_UINT64_T +typedef uint64_t uint_least64_t; +#endif + /* least types */ +#endif + +#if defined _STDINT_NEED_INT_FAST_T +typedef int8_t int_fast8_t; +typedef int int_fast16_t; +typedef int32_t int_fast32_t; +#ifdef _HAVE_UINT64_T +typedef int64_t int_fast64_t; +#endif + +typedef uint8_t uint_fast8_t; +typedef unsigned uint_fast16_t; +typedef uint32_t uint_fast32_t; +#ifdef _HAVE_UINT64_T +typedef uint64_t uint_fast64_t; +#endif + /* fast types */ +#endif + +#ifdef _STDINT_NEED_INTMAX_T +#ifdef _HAVE_UINT64_T +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; +#else +typedef long intmax_t; +typedef unsigned long uintmax_t; +#endif +#endif + +#ifdef _STDINT_NEED_INTPTR_T +#ifndef __intptr_t_defined +#define __intptr_t_defined +/* we encourage using "long" to store pointer values, never use "int" ! */ +#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 +typedef unsigned int uintptr_t; +typedef int intptr_t; +#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 +typedef unsigned long uintptr_t; +typedef long intptr_t; +#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T +typedef uint64_t uintptr_t; +typedef int64_t intptr_t; +#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ +typedef unsigned long uintptr_t; +typedef long intptr_t; +#endif +#endif +#endif + +/* The ISO C99 standard specifies that in C++ implementations these + should only be defined if explicitly requested. */ +#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS +#ifndef UINT32_C + +/* Signed. */ +# define INT8_C(c) c +# define INT16_C(c) c +# define INT32_C(c) c +# ifdef _HAVE_LONGLONG_UINT64_T +# define INT64_C(c) c ## L +# else +# define INT64_C(c) c ## LL +# endif + +/* Unsigned. */ +# define UINT8_C(c) c ## U +# define UINT16_C(c) c ## U +# define UINT32_C(c) c ## U +# ifdef _HAVE_LONGLONG_UINT64_T +# define UINT64_C(c) c ## UL +# else +# define UINT64_C(c) c ## ULL +# endif + +/* Maximal type. */ +# ifdef _HAVE_LONGLONG_UINT64_T +# define INTMAX_C(c) c ## L +# define UINTMAX_C(c) c ## UL +# else +# define INTMAX_C(c) c ## LL +# define UINTMAX_C(c) c ## ULL +# endif + + /* literalnumbers */ +#endif +#endif + +/* These limits are merily those of a two complement byte-oriented system */ + +/* Minimum of signed integral types. */ +# define INT8_MIN (-128) +# define INT16_MIN (-32767-1) +# define INT32_MIN (-2147483647-1) +# define INT64_MIN (-__INT64_C(9223372036854775807)-1) +/* Maximum of signed integral types. */ +# define INT8_MAX (127) +# define INT16_MAX (32767) +# define INT32_MAX (2147483647) +# define INT64_MAX (__INT64_C(9223372036854775807)) + +/* Maximum of unsigned integral types. */ +# define UINT8_MAX (255) +# define UINT16_MAX (65535) +# define UINT32_MAX (4294967295U) +# define UINT64_MAX (__UINT64_C(18446744073709551615)) + +/* Minimum of signed integral types having a minimum size. */ +# define INT_LEAST8_MIN INT8_MIN +# define INT_LEAST16_MIN INT16_MIN +# define INT_LEAST32_MIN INT32_MIN +# define INT_LEAST64_MIN INT64_MIN +/* Maximum of signed integral types having a minimum size. */ +# define INT_LEAST8_MAX INT8_MAX +# define INT_LEAST16_MAX INT16_MAX +# define INT_LEAST32_MAX INT32_MAX +# define INT_LEAST64_MAX INT64_MAX + +/* Maximum of unsigned integral types having a minimum size. */ +# define UINT_LEAST8_MAX UINT8_MAX +# define UINT_LEAST16_MAX UINT16_MAX +# define UINT_LEAST32_MAX UINT32_MAX +# define UINT_LEAST64_MAX UINT64_MAX + + /* shortcircuit*/ +#endif + /* once */ +#endif +#endif +STDINT_EOF +fi + if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then + AC_MSG_NOTICE([$ac_stdint_h is unchanged]) + else + ac_dir=`AS_DIRNAME(["$ac_stdint_h"])` + AS_MKDIR_P(["$ac_dir"]) + rm -f $ac_stdint_h + mv $ac_stdint $ac_stdint_h + fi +],[# variables for create stdint.h replacement +PACKAGE="$PACKAGE" +VERSION="$VERSION" +ac_stdint_h="$ac_stdint_h" +_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h) +ac_cv_stdint_message="$ac_cv_stdint_message" +ac_cv_header_stdint_t="$ac_cv_header_stdint_t" +ac_cv_header_stdint_x="$ac_cv_header_stdint_x" +ac_cv_header_stdint_o="$ac_cv_header_stdint_o" +ac_cv_header_stdint_u="$ac_cv_header_stdint_u" +ac_cv_type_uint64_t="$ac_cv_type_uint64_t" +ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" +ac_cv_char_data_model="$ac_cv_char_data_model" +ac_cv_long_data_model="$ac_cv_long_data_model" +ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" +ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" +ac_cv_type_intmax_t="$ac_cv_type_intmax_t" +]) +]) diff --git a/common/m4/check.m4 b/common/m4/check.m4 new file mode 100644 index 0000000..afd26eb --- /dev/null +++ b/common/m4/check.m4 @@ -0,0 +1,181 @@ +dnl _AM_TRY_CHECK(MINIMUM-VERSION, EXTRA-CFLAGS, EXTRA-LIBS, CHECK-LIB-NAME +dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS +dnl Done this way because of the brokenness that is +dnl https://launchpad.net/distros/ubuntu/+source/check/+bug/5840 +dnl + +AC_DEFUN([_AM_TRY_CHECK], +[ + min_check_version=$1 + extra_cflags=$2 + extra_libs=$3 + check_lib_name=$4 + + CHECK_CFLAGS="$extra_cflags" + CHECK_LIBS="$extra_libs -l$check_lib_name" + + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + + CFLAGS="$CFLAGS $CHECK_CFLAGS" + LIBS="$CHECK_LIBS $LIBS" + + AC_MSG_CHECKING(for check named $check_lib_name - version >= $min_check_version) + + rm -f conf.check-test + dnl unset no_check, since in our second run it would have been set to yes + dnl before + no_check= + AC_TRY_RUN([ +#include +#include + +#include + +int main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.check-test"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = strdup("$min_check_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_check_version"); + return 1; + } + + if ((CHECK_MAJOR_VERSION != check_major_version) || + (CHECK_MINOR_VERSION != check_minor_version) || + (CHECK_MICRO_VERSION != check_micro_version)) + { + printf("\n*** The check header file (version %d.%d.%d) does not match\n", + CHECK_MAJOR_VERSION, CHECK_MINOR_VERSION, CHECK_MICRO_VERSION); + printf("*** the check library (version %d.%d.%d).\n", + check_major_version, check_minor_version, check_micro_version); + return 1; + } + + if ((check_major_version > major) || + ((check_major_version == major) && (check_minor_version > minor)) || + ((check_major_version == major) && (check_minor_version == minor) && (check_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of check (%d.%d.%d) was found.\n", + check_major_version, check_minor_version, check_micro_version); + printf("*** You need a version of check being at least %d.%d.%d.\n", major, minor, micro); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the check library and header\n"); + printf("*** file is being found. Rerun configure with the --with-check=PATH option\n"); + printf("*** to specify the prefix where the correct version was installed.\n"); + } + + return 1; +} +],, no_check=yes, [echo $ac_n "cross compiling; assumed OK... $ac_c"]) + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + + if test "x$no_check" = x ; then + AC_MSG_RESULT(yes) + ifelse([$5], , :, [$5]) + else + AC_MSG_RESULT(no) + if test -f conf.check-test ; then + : + else + echo "*** Could not run check test program, checking why..." + CFLAGS="$CFLAGS $CHECK_CFLAGS" + LIBS="$CHECK_LIBS $LIBS" + AC_TRY_LINK([ +#include +#include + +#include +], , [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding check. You'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for" + echo "*** the exact error that occured." ]) + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + + CHECK_CFLAGS="" + CHECK_LIBS="" + + rm -f conf.check-test + ifelse([$6], , AC_MSG_ERROR([check not found]), [$6]) + fi +]) + + +dnl AM_PATH_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS +dnl + +AC_DEFUN([AM_PATH_CHECK], +[ + AC_ARG_WITH(check, + [ --with-check=PATH prefix where check is installed [default=auto]]) + + AC_ARG_WITH(checklibname, + AC_HELP_STRING([--with-check-lib-name=NAME], + [name of the PIC check library (default=check)])) + + min_check_version=ifelse([$1], ,0.8.2,$1) + + if test x$with_check = xno; then + AC_MSG_RESULT(disabled) + ifelse([$3], , AC_MSG_ERROR([disabling check is not supported]), [$3]) + else + if test "x$with_check" != x; then + CHECK_EXTRA_CFLAGS="-I$with_check/include" + CHECK_EXTRA_LIBS="-L$with_check/lib" + else + CHECK_EXTRA_CFLAGS="" + CHECK_EXTRA_LIBS="" + fi + + if test x$with_checklibname = x; then + _AM_TRY_CHECK($min_check_version, $CHECK_EXTRA_CFLAGS, $CHECK_EXTRA_LIBS, + check_pic, [have_check=true], [have_check=false]) + if test x$have_check = xtrue; then + ifelse([$2], , :, [$2]) + else + _AM_TRY_CHECK($min_check_version, $CHECK_EXTRA_CFLAGS, $CHECK_EXTRA_LIBS, + check, [have_check=true], [have_check=false]) + if test x$have_check = xtrue; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , AC_MSG_ERROR([check not found]), [$3]) + fi + fi + else + _AM_TRY_CHECK($min_check_version, $CHECK_EXTRA_CFLAGS, $CHECK_EXTRA_LIBS, + $with_checklibname, [have_check=true], [have_check=false]) + if test x$have_check = xtrue; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , AC_MSG_ERROR([check not found]), [$3]) + fi + fi + + AC_SUBST(CHECK_CFLAGS) + AC_SUBST(CHECK_LIBS) + rm -f conf.check-test + fi +]) diff --git a/common/m4/glib-gettext.m4 b/common/m4/glib-gettext.m4 new file mode 100644 index 0000000..f8d442f --- /dev/null +++ b/common/m4/glib-gettext.m4 @@ -0,0 +1,432 @@ +# Copyright (C) 1995-2002 Free Software Foundation, Inc. +# Copyright (C) 2001-2003,2004 Red Hat, Inc. +# +# This file is free software, distributed under the terms of the GNU +# General Public License. As a special exception to the GNU General +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995, 1996 +# +# Modified to never use included libintl. +# Owen Taylor , 12/15/1998 +# +# Major rework to remove unused code +# Owen Taylor , 12/11/2002 +# +# Added better handling of ALL_LINGUAS from GNU gettext version +# written by Bruno Haible, Owen Taylor 5/30/3002 +# +# Modified to require ngettext +# Matthias Clasen 08/06/2004 +# +# We need this here as well, since someone might use autoconf-2.5x +# to configure GLib then an older version to configure a package +# using AM_GLIB_GNU_GETTEXT +AC_PREREQ(2.53) + +dnl +dnl We go to great lengths to make sure that aclocal won't +dnl try to pull in the installed version of these macros +dnl when running aclocal in the glib directory. +dnl +m4_copy([AC_DEFUN],[glib_DEFUN]) +m4_copy([AC_REQUIRE],[glib_REQUIRE]) +dnl +dnl At the end, if we're not within glib, we'll define the public +dnl definitions in terms of our private definitions. +dnl + +# GLIB_LC_MESSAGES +#-------------------- +glib_DEFUN([GLIB_LC_MESSAGES], + [AC_CHECK_HEADERS([locale.h]) + if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi + fi]) + +# GLIB_PATH_PROG_WITH_TEST +#---------------------------- +dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# GLIB_WITH_NLS +#----------------- +glib_DEFUN([GLIB_WITH_NLS], + dnl NLS is obligatory + [USE_NLS=yes + AC_SUBST(USE_NLS) + + gt_cv_have_gettext=no + + CATOBJEXT=NONE + XGETTEXT=: + INTLLIBS= + + AC_CHECK_HEADER(libintl.h, + [gt_cv_func_dgettext_libintl="no" + libintl_extra_libs="" + + # + # First check in libc + # + AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, + [AC_TRY_LINK([ +#include +], + [return !ngettext ("","", 1)], + gt_cv_func_ngettext_libc=yes, + gt_cv_func_ngettext_libc=no) + ]) + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, + [AC_TRY_LINK([ +#include +], + [return !dgettext ("","")], + gt_cv_func_dgettext_libc=yes, + gt_cv_func_dgettext_libc=no) + ]) + fi + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CHECK_FUNCS(bind_textdomain_codeset) + fi + + # + # If we don't have everything we want, check in libintl + # + if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$gt_cv_func_ngettext_libc" != "yes" \ + || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then + + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dgettext, + gt_cv_func_dgettext_libintl=yes)])]) + + if test "$gt_cv_func_dgettext_libintl" != "yes" ; then + AC_MSG_CHECKING([if -liconv is needed to use gettext]) + AC_MSG_RESULT([]) + AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dcgettext, + [gt_cv_func_dgettext_libintl=yes + libintl_extra_libs=-liconv], + :,-liconv)], + :,-liconv) + fi + + # + # If we found libintl, then check in it for bind_textdomain_codeset(); + # we'll prefer libc if neither have bind_textdomain_codeset(), + # and both have dgettext and ngettext + # + if test "$gt_cv_func_dgettext_libintl" = "yes" ; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $libintl_extra_libs" + unset ac_cv_func_bind_textdomain_codeset + AC_CHECK_FUNCS(bind_textdomain_codeset) + LIBS="$glib_save_LIBS" + + if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then + gt_cv_func_dgettext_libc=no + else + if test "$gt_cv_func_dgettext_libc" = "yes" \ + && test "$gt_cv_func_ngettext_libc" = "yes"; then + gt_cv_func_dgettext_libintl=no + fi + fi + fi + fi + + if test "$gt_cv_func_dgettext_libc" = "yes" \ + || test "$gt_cv_func_dgettext_libintl" = "yes"; then + gt_cv_have_gettext=yes + fi + + if test "$gt_cv_func_dgettext_libintl" = "yes"; then + INTLLIBS="-lintl $libintl_extra_libs" + fi + + if test "$gt_cv_have_gettext" = "yes"; then + AC_DEFINE(HAVE_GETTEXT,1, + [Define if the GNU gettext() function is already present or preinstalled.]) + GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + AC_CHECK_FUNCS(dcgettext) + MSGFMT_OPTS= + AC_MSG_CHECKING([if msgfmt accepts -c]) + GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: test 1.0\n" +"PO-Revision-Date: 2007-02-15 12:01+0100\n" +"Last-Translator: test \n" +"Language-Team: C \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) + AC_SUBST(MSGFMT_OPTS) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [case $host in + *-*-solaris*) + dnl On Solaris, if bind_textdomain_codeset is in libc, + dnl GNU format message catalog is always supported, + dnl since both are added to the libc all together. + dnl Hence, we'd like to go with DATADIRNAME=share and + dnl and CATOBJEXT=.gmo in this case. + AC_CHECK_FUNC(bind_textdomain_codeset, + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib + ;; + esac]) + LIBS="$glib_save_LIBS" + INSTOBJEXT=.mo + else + gt_cv_have_gettext=no + fi + fi + ]) + + if test "$gt_cv_have_gettext" = "yes" ; then + AC_DEFINE(ENABLE_NLS, 1, + [always defined to indicate that i18n is enabled]) + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is not GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + + AC_OUTPUT_COMMANDS( + [case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac]) + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLLIBS) + AC_SUBST(PO_IN_DATADIR_TRUE) + AC_SUBST(PO_IN_DATADIR_FALSE) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +# AM_GLIB_GNU_GETTEXT +# ------------------- +# Do checks necessary for use of gettext. If a suitable implementation +# of gettext is found in either in libintl or in the C library, +# it will set INTLLIBS to the libraries needed for use of gettext +# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable +# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() +# on various variables needed by the Makefile.in.in installed by +# glib-gettextize. +dnl +glib_DEFUN([GLIB_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + + GLIB_LC_MESSAGES + GLIB_WITH_NLS + + if test "$gt_cv_have_gettext" = "yes"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but ($top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl Generate list of files to be processed by xgettext which will + dnl be included in po/Makefile. + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + ]) + +# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) +# ------------------------------- +# Define VARIABLE to the location where catalog files will +# be installed by po/Makefile. +glib_DEFUN([GLIB_DEFINE_LOCALEDIR], +[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl +glib_save_prefix="$prefix" +glib_save_exec_prefix="$exec_prefix" +glib_save_datarootdir="$datarootdir" +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +datarootdir=`eval echo "${datarootdir}"` +if test "x$CATOBJEXT" = "x.mo" ; then + localedir=`eval echo "${libdir}/locale"` +else + localedir=`eval echo "${datadir}/locale"` +fi +prefix="$glib_save_prefix" +exec_prefix="$glib_save_exec_prefix" +datarootdir="$glib_save_datarootdir" +AC_DEFINE_UNQUOTED($1, "$localedir", + [Define the location where the catalogs will be installed]) +]) + +dnl +dnl Now the definitions that aclocal will find +dnl +ifdef(glib_configure_in,[],[ +AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) +AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) +])dnl + +# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) +# +# Create a temporary file with TEST-FILE as its contents and pass the +# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with +# 0 and perform ACTION-IF-FAIL for any other exit status. +AC_DEFUN([GLIB_RUN_PROG], +[cat >conftest.foo <<_ACEOF +$2 +_ACEOF +if AC_RUN_LOG([$1 conftest.foo]); then + m4_ifval([$3], [$3], [:]) +m4_ifvaln([$4], [else $4])dnl +echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD +sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD +fi]) + diff --git a/common/m4/gst-arch.m4 b/common/m4/gst-arch.m4 new file mode 100644 index 0000000..077a20b --- /dev/null +++ b/common/m4/gst-arch.m4 @@ -0,0 +1,140 @@ +dnl AG_GST_ARCH +dnl sets up defines and automake conditionals for host architecture +dnl checks endianness +dnl defines HOST_CPU + +AC_DEFUN([AG_GST_ARCH], +[ + dnl Determine CPU + case "x${target_cpu}" in + xi?86 | xk? | xi?86_64) + case $target_os in + solaris*) + AC_CHECK_DECL([__i386], [I386_ABI="yes"], [I386_ABI="no"]) + AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"]) + + if test "x$I386_ABI" = "xyes" ; then + HAVE_CPU_I386=yes + AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86]) + fi + if test "x$AMD64_ABI" = "xyes" ; then + HAVE_CPU_X86_64=yes + AC_DEFINE(HAVE_CPU_X86_64, 1, [Define if the target CPU is a x86_64]) + fi + ;; + *) + HAVE_CPU_I386=yes + AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86]) + + dnl FIXME could use some better detection + dnl (ie CPUID) + case "x${target_cpu}" in + xi386 | xi486) ;; + *) + AC_DEFINE(HAVE_RDTSC, 1, [Define if RDTSC is available]) ;; + esac + ;; + esac + ;; + xpowerpc) + HAVE_CPU_PPC=yes + AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PowerPC]) ;; + xpowerpc64) + HAVE_CPU_PPC64=yes + AC_DEFINE(HAVE_CPU_PPC64, 1, [Define if the target CPU is a 64 bit PowerPC]) ;; + xalpha*) + HAVE_CPU_ALPHA=yes + AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;; + xarm*) + HAVE_CPU_ARM=yes + AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;; + xsparc*) + HAVE_CPU_SPARC=yes + AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a SPARC]) ;; + xmips*) + HAVE_CPU_MIPS=yes + AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;; + xhppa*) + HAVE_CPU_HPPA=yes + AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;; + xs390*) + HAVE_CPU_S390=yes + AC_DEFINE(HAVE_CPU_S390, 1, [Define if the target CPU is a S390]) ;; + xia64*) + HAVE_CPU_IA64=yes + AC_DEFINE(HAVE_CPU_IA64, 1, [Define if the target CPU is a IA64]) ;; + xm68k*) + HAVE_CPU_M68K=yes + AC_DEFINE(HAVE_CPU_M68K, 1, [Define if the target CPU is a M68K]) ;; + xx86_64) + HAVE_CPU_X86_64=yes + AC_DEFINE(HAVE_CPU_X86_64, 1, [Define if the target CPU is a x86_64]) ;; + xcris) + HAVE_CPU_CRIS=yes + AC_DEFINE(HAVE_CPU_CRIS, 1, [Define if the target CPU is a CRIS]) ;; + xcrisv32) + HAVE_CPU_CRISV32=yes + AC_DEFINE(HAVE_CPU_CRISV32, 1, [Define if the target CPU is a CRISv32]) ;; + esac + + dnl Determine endianness + AC_C_BIGENDIAN + + AM_CONDITIONAL(HAVE_CPU_I386, test "x$HAVE_CPU_I386" = "xyes") + AM_CONDITIONAL(HAVE_CPU_PPC, test "x$HAVE_CPU_PPC" = "xyes") + AM_CONDITIONAL(HAVE_CPU_PPC64, test "x$HAVE_CPU_PPC64" = "xyes") + AM_CONDITIONAL(HAVE_CPU_ALPHA, test "x$HAVE_CPU_ALPHA" = "xyes") + AM_CONDITIONAL(HAVE_CPU_ARM, test "x$HAVE_CPU_ARM" = "xyes") + AM_CONDITIONAL(HAVE_CPU_SPARC, test "x$HAVE_CPU_SPARC" = "xyes") + AM_CONDITIONAL(HAVE_CPU_HPPA, test "x$HAVE_CPU_HPPA" = "xyes") + AM_CONDITIONAL(HAVE_CPU_MIPS, test "x$HAVE_CPU_MIPS" = "xyes") + AM_CONDITIONAL(HAVE_CPU_S390, test "x$HAVE_CPU_S390" = "xyes") + AM_CONDITIONAL(HAVE_CPU_IA64, test "x$HAVE_CPU_IA64" = "xyes") + AM_CONDITIONAL(HAVE_CPU_M68K, test "x$HAVE_CPU_M68K" = "xyes") + AM_CONDITIONAL(HAVE_CPU_X86_64, test "x$HAVE_CPU_X86_64" = "xyes") + AM_CONDITIONAL(HAVE_CPU_CRIS, test "x$HAVE_CPU_CRIS" = "xyes") + AM_CONDITIONAL(HAVE_CPU_CRISV32, test "x$HAVE_CPU_CRISV32" = "xyes") + + AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", [the host CPU]) + AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu", [the target CPU]) +]) + +dnl check if unaligned memory access works correctly +AC_DEFUN([AG_GST_UNALIGNED_ACCESS], [ + AC_MSG_CHECKING([if unaligned memory access works correctly]) + if test x"$as_cv_unaligned_access" = x ; then + case $host in + alpha*|arm*|hp*|mips*|sh*|sparc*|ia64*) + _AS_ECHO_N([(blacklisted) ]) + as_cv_unaligned_access=no + ;; + i?86*|x86_64*|amd64*|powerpc*|m68k*|cris*) + _AS_ECHO_N([(whitelisted) ]) + as_cv_unaligned_access=yes + ;; + esac + else + _AS_ECHO_N([(cached) ]) + fi + if test x"$as_cv_unaligned_access" = x ; then + AC_TRY_RUN([ +int main(int argc, char **argv) +{ + char array[] = "ABCDEFGH"; + unsigned int iarray[2]; + memcpy(iarray,array,8); +#define GET(x) (*(unsigned int *)((char *)iarray + (x))) + if(GET(0) != 0x41424344 && GET(0) != 0x44434241) return 1; + if(GET(1) != 0x42434445 && GET(1) != 0x45444342) return 1; + if(GET(2) != 0x43444546 && GET(2) != 0x46454443) return 1; + if(GET(3) != 0x44454647 && GET(3) != 0x47464544) return 1; + return 0; +} + ], as_cv_unaligned_access="yes", as_cv_unaligned_access="no") + fi + AC_MSG_RESULT($as_cv_unaligned_access) + if test "$as_cv_unaligned_access" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_UNALIGNED_ACCESS, 1, + [defined if unaligned memory access works correctly]) + fi +]) diff --git a/common/m4/gst-args.m4 b/common/m4/gst-args.m4 new file mode 100644 index 0000000..b478c82 --- /dev/null +++ b/common/m4/gst-args.m4 @@ -0,0 +1,360 @@ +dnl configure-time options shared among gstreamer modules + +dnl AG_GST_ARG_DEBUG +dnl AG_GST_ARG_PROFILING +dnl AG_GST_ARG_VALGRIND +dnl AG_GST_ARG_GCOV + +dnl AG_GST_ARG_EXAMPLES + +dnl AG_GST_ARG_WITH_PKG_CONFIG_PATH +dnl AG_GST_ARG_WITH_PACKAGE_NAME +dnl AG_GST_ARG_WITH_PACKAGE_ORIGIN + +dnl AG_GST_ARG_WITH_PLUGINS +dnl AG_GST_CHECK_PLUGIN +dnl AG_GST_DISABLE_PLUGIN + +dnl AG_GST_ARG_ENABLE_EXTERNAL +dnl AG_GST_ARG_ENABLE_EXPERIMENTAL +dnl AG_GST_ARG_ENABLE_BROKEN + +dnl AG_GST_ARG_DISABLE_FATAL_WARNINGS +AC_DEFUN([AG_GST_ARG_DEBUG], +[ + dnl debugging stuff + AC_ARG_ENABLE(debug, + AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]), + [ + case "${enableval}" in + yes) USE_DEBUG=yes ;; + no) USE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; + esac + ], + [USE_DEBUG=yes]) dnl Default value +]) + +AC_DEFUN([AG_GST_ARG_PROFILING], +[ + AC_ARG_ENABLE(profiling, + AC_HELP_STRING([--enable-profiling], + [adds -pg to compiler commandline, for profiling]), + [ + case "${enableval}" in + yes) USE_PROFILING=yes ;; + no) USE_PROFILING=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;; + esac + ], + [USE_PROFILING=no]) dnl Default value +]) + +AC_DEFUN([AG_GST_ARG_VALGRIND], +[ + dnl valgrind inclusion + AC_ARG_ENABLE(valgrind, + AC_HELP_STRING([--disable-valgrind],[disable run-time valgrind detection]), + [ + case "${enableval}" in + yes) USE_VALGRIND="$USE_DEBUG" ;; + no) USE_VALGRIND=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;; + esac + ], + [USE_VALGRIND="$USE_DEBUG"]) dnl Default value + VALGRIND_REQ="3.0" + if test "x$USE_VALGRIND" = xyes; then + PKG_CHECK_MODULES(VALGRIND, valgrind >= $VALGRIND_REQ, + USE_VALGRIND="yes", + USE_VALGRIND="no") + fi + if test "x$USE_VALGRIND" = xyes; then + AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used]) + AC_MSG_NOTICE(Using extra code paths for valgrind) + fi +]) + +AC_DEFUN([AG_GST_ARG_GCOV], +[ + AC_ARG_ENABLE(gcov, + AC_HELP_STRING([--enable-gcov], + [compile with coverage profiling instrumentation (gcc only)]), + enable_gcov=$enableval, + enable_gcov=no) + if test x$enable_gcov = xyes ; then + if test "x$GCC" != "xyes" + then + AC_MSG_ERROR([gcov only works if gcc is used]) + fi + + AS_COMPILER_FLAG(["-fprofile-arcs"], + [GCOV_CFLAGS="$GCOV_CFLAGS -fprofile-arcs"], + true) + AS_COMPILER_FLAG(["-ftest-coverage"], + [GCOV_CFLAGS="$GCOV_CFLAGS -ftest-coverage"], + true) + dnl remove any -O flags - FIXME: is this needed ? + GCOV_CFLAGS=`echo "$GCOV_CFLAGS" | sed -e 's/-O[[0-9]]*//g'` + dnl libtool 1.5.22 and lower strip -fprofile-arcs from the flags + dnl passed to the linker, which is a bug; -fprofile-arcs implicitly + dnl links in -lgcov, so we do it explicitly here for the same effect + GCOV_LIBS=-lgcov + AC_SUBST(GCOV_CFLAGS) + AC_SUBST(GCOV_LIBS) + GCOV=`echo $CC | sed s/gcc/gcov/g` + AC_SUBST(GCOV) + + GST_GCOV_ENABLED=yes + AC_DEFINE_UNQUOTED(GST_GCOV_ENABLED, 1, + [Defined if gcov is enabled to force a rebuild due to config.h changing]) + dnl if gcov is used, we do not want default -O2 CFLAGS + if test "x$GST_GCOV_ENABLED" = "xyes" + then + CFLAGS="$CFLAGS -O0" + AC_SUBST(CFLAGS) + CXXFLAGS="$CXXFLAGS -O0" + AC_SUBST(CXXFLAGS) + FFLAGS="$FFLAGS -O0" + AC_SUBST(FFLAGS) + CCASFLAGS="$CCASFLAGS -O0" + AC_SUBST(CCASFLAGS) + AC_MSG_NOTICE([gcov enabled, setting CFLAGS and friends to $CFLAGS]) + fi + fi + AM_CONDITIONAL(GST_GCOV_ENABLED, test x$enable_gcov = xyes) +]) + +AC_DEFUN([AG_GST_ARG_EXAMPLES], +[ + AC_ARG_ENABLE(examples, + AC_HELP_STRING([--disable-examples], [disable building examples]), + [ + case "${enableval}" in + yes) BUILD_EXAMPLES=yes ;; + no) BUILD_EXAMPLES=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;; + esac + ], + [BUILD_EXAMPLES=yes]) dnl Default value + AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes") +]) + +AC_DEFUN([AG_GST_ARG_WITH_PKG_CONFIG_PATH], +[ + dnl possibly modify pkg-config path + AC_ARG_WITH(pkg-config-path, + AC_HELP_STRING([--with-pkg-config-path], + [colon-separated list of pkg-config(1) dirs]), + [ + export PKG_CONFIG_PATH=${withval} + AC_MSG_NOTICE(Set PKG_CONFIG_PATH to $PKG_CONFIG_PATH) + ]) +]) + + +dnl This macro requires that GST_GIT or GST_CVS is set to yes or no (release) +AC_DEFUN([AG_GST_ARG_WITH_PACKAGE_NAME], +[ + dnl package name in plugins + AC_ARG_WITH(package-name, + AC_HELP_STRING([--with-package-name], + [specify package name to use in plugins]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;; + *) GST_PACKAGE_NAME="${withval}" ;; + esac + ], + [ + P=$1 + if test "x$P" = "x" + then + P=$PACKAGE_NAME + fi + + if test "x$PACKAGE_VERSION_NANO" = "x0" + then + GST_PACKAGE_NAME="$P source release" + else + if test "x$PACKAGE_VERSION_NANO" = "x1" + then + GST_PACKAGE_NAME="$P git" + else + GST_PACKAGE_NAME="$P prerelease" + fi + fi + ] + ) + AC_MSG_NOTICE(Using $GST_PACKAGE_NAME as package name) + AC_DEFINE_UNQUOTED(GST_PACKAGE_NAME, "$GST_PACKAGE_NAME", + [package name in plugins]) + AC_SUBST(GST_PACKAGE_NAME) +]) + +AC_DEFUN([AG_GST_ARG_WITH_PACKAGE_ORIGIN], +[ + dnl package origin URL + AC_ARG_WITH(package-origin, + AC_HELP_STRING([--with-package-origin], + [specify package origin URL to use in plugins]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;; + *) GST_PACKAGE_ORIGIN="${withval}" ;; + esac + ], + [GST_PACKAGE_ORIGIN="[Unknown package origin]"] dnl Default value + ) + AC_MSG_NOTICE(Using $GST_PACKAGE_ORIGIN as package origin) + AC_DEFINE_UNQUOTED(GST_PACKAGE_ORIGIN, "$GST_PACKAGE_ORIGIN", + [package origin]) + AC_SUBST(GST_PACKAGE_ORIGIN) +]) + +dnl sets WITH_PLUGINS to the list of plug-ins given as an argument +dnl also clears GST_PLUGINS_ALL and GST_PLUGINS_SELECTED +AC_DEFUN([AG_GST_ARG_WITH_PLUGINS], +[ + AC_ARG_WITH(plugins, + AC_HELP_STRING([--with-plugins], + [comma-separated list of dependencyless plug-ins to compile]), + [WITH_PLUGINS=$withval], + [WITH_PLUGINS=]) + + GST_PLUGINS_ALL="" + GST_PLUGINS_SELECTED="" + GST_PLUGINS_NONPORTED="" + + AC_SUBST(GST_PLUGINS_ALL) + AC_SUBST(GST_PLUGINS_SELECTED) + AC_SUBST(GST_PLUGINS_NONPORTED) +]) + +dnl AG_GST_CHECK_PLUGIN(PLUGIN-NAME) +dnl +dnl This macro adds the plug-in to GST_PLUGINS_ALL. Then it +dnl checks if WITH_PLUGINS is empty or the plugin is present in WITH_PLUGINS, +dnl and if so adds it to GST_PLUGINS_SELECTED. Then it checks if the plugin +dnl is present in WITHOUT_PLUGINS (ie. was disabled specifically) and if so +dnl removes it from GST_PLUGINS_SELECTED. +dnl +dnl The macro will call AM_CONDITIONAL(USE_PLUGIN_, ...) to allow +dnl control of what is built in Makefile.ams. +AC_DEFUN([AG_GST_CHECK_PLUGIN], +[ + GST_PLUGINS_ALL="$GST_PLUGINS_ALL [$1]" + + define([pname_def],translit([$1], -a-z, _a-z)) + + AC_ARG_ENABLE([$1], + AC_HELP_STRING([--disable-[$1]], [disable dependency-less $1 plugin]), + [ + case "${enableval}" in + yes) [gst_use_]pname_def=yes ;; + no) [gst_use_]pname_def=no ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-$1]) ;; + esac + ], + [[gst_use_]pname_def=yes]) dnl Default value + + if test x$[gst_use_]pname_def = xno; then + AC_MSG_NOTICE(disabling dependency-less plugin $1) + WITHOUT_PLUGINS="$WITHOUT_PLUGINS [$1]" + fi + undefine([pname_def]) + + dnl First check inclusion + if [[ -z "$WITH_PLUGINS" ]] || echo " [$WITH_PLUGINS] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED [$1]" + fi + dnl Then check exclusion + if echo " [$WITHOUT_PLUGINS] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + GST_PLUGINS_SELECTED=`echo " $GST_PLUGINS_SELECTED " | $SED -e 's/ [$1] / /'` + fi + dnl Finally check if the plugin is ported or not + if echo " [$GST_PLUGINS_NONPORTED] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + GST_PLUGINS_SELECTED=`echo " $GST_PLUGINS_SELECTED " | $SED -e 's/ [$1] / /'` + fi + AM_CONDITIONAL([USE_PLUGIN_]translit([$1], a-z, A-Z), echo " $GST_PLUGINS_SELECTED " | grep -i " [$1] " > /dev/null) +]) + +dnl AG_GST_DISABLE_PLUGIN(PLUGIN-NAME) +dnl +dnl This macro disables the plug-in by removing it from +dnl GST_PLUGINS_SELECTED. +AC_DEFUN([AG_GST_DISABLE_PLUGIN], +[ + GST_PLUGINS_SELECTED=`echo " $GST_PLUGINS_SELECTED " | $SED -e 's/ [$1] / /'` + AM_CONDITIONAL([USE_PLUGIN_]translit([$1], a-z, A-Z), false) +]) + +AC_DEFUN([AG_GST_ARG_ENABLE_EXTERNAL], +[ + AG_GST_CHECK_FEATURE(EXTERNAL, [building of plug-ins with external deps],, + HAVE_EXTERNAL=yes, enabled, + [ + AC_MSG_NOTICE(building external plug-ins) + BUILD_EXTERNAL="yes" + ],[ + AC_MSG_WARN(all plug-ins with external dependencies will not be built) + BUILD_EXTERNAL="no" + ]) + # make BUILD_EXTERNAL available to Makefile.am + AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes") +]) + +dnl experimental plug-ins; stuff that hasn't had the dust settle yet +dnl read 'builds, but might not work' +AC_DEFUN([AG_GST_ARG_ENABLE_EXPERIMENTAL], +[ + AG_GST_CHECK_FEATURE(EXPERIMENTAL, [building of experimental plug-ins],, + HAVE_EXPERIMENTAL=yes, disabled, + [ + AC_MSG_WARN(building experimental plug-ins) + BUILD_EXPERIMENTAL="yes" + ],[ + AC_MSG_NOTICE(not building experimental plug-ins) + BUILD_EXPERIMENTAL="no" + ]) + # make BUILD_EXPERIMENTAL available to Makefile.am + AM_CONDITIONAL(BUILD_EXPERIMENTAL, test "x$BUILD_EXPERIMENTAL" = "xyes") +]) + +dnl broken plug-ins; stuff that doesn't seem to build at the moment +AC_DEFUN([AG_GST_ARG_ENABLE_BROKEN], +[ + AG_GST_CHECK_FEATURE(BROKEN, [building of broken plug-ins],, + HAVE_BROKEN=yes, disabled, + [ + AC_MSG_WARN([building broken plug-ins -- no bug reports on these, only patches ...]) + ],[ + AC_MSG_NOTICE([not building broken plug-ins]) + ]) +]) + +dnl allow people (or build tools) to override default behaviour +dnl for fatal compiler warnings +dnl Enable fatal warnings by default only for development versions +AC_DEFUN([AG_GST_ARG_DISABLE_FATAL_WARNINGS], +[ + AC_ARG_ENABLE(fatal-warnings, + AC_HELP_STRING([--disable-fatal-warnings], + [Don't turn compiler warnings into fatal errors]), + [ + case "${enableval}" in + yes) FATAL_WARNINGS=yes ;; + no) FATAL_WARNINGS=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-fatal-warnings) ;; + esac + ], + [ + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + FATAL_WARNINGS=yes + else + FATAL_WARNINGS=no + fi + ]) +]) diff --git a/common/m4/gst-check.m4 b/common/m4/gst-check.m4 new file mode 100644 index 0000000..4277053 --- /dev/null +++ b/common/m4/gst-check.m4 @@ -0,0 +1,294 @@ +dnl pkg-config-based checks for GStreamer modules and dependency modules + +dnl generic: +dnl AG_GST_PKG_CHECK_MODULES([PREFIX], [WHICH], [REQUIRED]) +dnl sets HAVE_[$PREFIX], [$PREFIX]_* +dnl AG_GST_CHECK_MODULES([PREFIX], [MODULE], [MINVER], [NAME], [REQUIRED]) +dnl sets HAVE_[$PREFIX], [$PREFIX]_* + +dnl specific: +dnl AG_GST_CHECK_GST([MAJMIN], [MINVER], [REQUIRED]) +dnl also sets/ACSUBSTs GST_TOOLS_DIR and GST_PLUGINS_DIR +dnl AG_GST_CHECK_GST_BASE([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_CONTROLLER([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_NET([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_CHECK([MAJMIN], [MINVER], [REQUIRED]) +dnl AG_GST_CHECK_GST_PLUGINS_BASE([MAJMIN], [MINVER], [REQUIRED]) +dnl also sets/ACSUBSTs GSTPB_PLUGINS_DIR + +AC_DEFUN([AG_GST_PKG_CHECK_MODULES], +[ + which="[$2]" + dnl not required by default, since we use this mostly for plugin deps + required=ifelse([$3], , "no", [$3]) + + PKG_CHECK_MODULES([$1], $which, + [ + HAVE_[$1]="yes" + ], + [ + HAVE_[$1]="no" + if test "x$required" = "xyes"; then + AC_MSG_ERROR($[$1]_PKG_ERRORS) + else + AC_MSG_NOTICE($[$1]_PKG_ERRORS) + fi + ]) + + dnl AC_SUBST of CFLAGS and LIBS was not done before automake 1.7 + dnl It gets done automatically in automake >= 1.7, which we now require +])) + +AC_DEFUN([AG_GST_CHECK_MODULES], +[ + module=[$2] + minver=[$3] + name="[$4]" + required=ifelse([$5], , "yes", [$5]) dnl required by default + + PKG_CHECK_MODULES([$1], $module >= $minver, + [ + HAVE_[$1]="yes" + ], + [ + HAVE_[$1]="no" + AC_MSG_NOTICE($[$1]_PKG_ERRORS) + if test "x$required" = "xyes"; then + AC_MSG_ERROR([no $module >= $minver ($name) found]) + else + AC_MSG_NOTICE([no $module >= $minver ($name) found]) + fi + ]) + + dnl AC_SUBST of CFLAGS and LIBS was not done before automake 1.7 + dnl It gets done automatically in automake >= 1.7, which we now require +])) + +AC_DEFUN([AG_GST_CHECK_GST], +[ + AG_GST_CHECK_MODULES(GST, gstreamer-[$1], [$2], [GStreamer], [$3]) + dnl allow setting before calling this macro to override + if test -z $GST_TOOLS_DIR; then + GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-[$1]` + if test -z $GST_TOOLS_DIR; then + AC_MSG_ERROR( + [no tools dir set in GStreamer pkg-config file, core upgrade needed.]) + fi + fi + AC_MSG_NOTICE([using GStreamer tools in $GST_TOOLS_DIR]) + AC_SUBST(GST_TOOLS_DIR) + + dnl check for where core plug-ins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_DIR; then + GST_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-[$1]` + if test -z $GST_PLUGINS_DIR; then + AC_MSG_ERROR( + [no pluginsdir set in GStreamer pkg-config file, core upgrade needed.]) + fi + fi + AC_MSG_NOTICE([using GStreamer plug-ins in $GST_PLUGINS_DIR]) + AC_SUBST(GST_PLUGINS_DIR) +]) + +AC_DEFUN([AG_GST_CHECK_GST_BASE], +[ + AG_GST_CHECK_MODULES(GST_BASE, gstreamer-base-[$1], [$2], + [GStreamer Base Libraries], [$3]) +]) + +AC_DEFUN([AG_GST_CHECK_GST_CONTROLLER], +[ + AG_GST_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-[$1], [$2], + [GStreamer Controller Library], [$3]) +]) + +AC_DEFUN([AG_GST_CHECK_GST_NET], +[ + AG_GST_CHECK_MODULES(GST_NET, gstreamer-net-[$1], [$2], + [GStreamer Network Library], [$3]) +]) + +AC_DEFUN([AG_GST_CHECK_GST_CHECK], +[ + AG_GST_CHECK_MODULES(GST_CHECK, gstreamer-check-[$1], [$2], + [GStreamer Check unittest Library], [$3]) +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_UNINSTALLED_SETUP([ACTION-IF-UNINSTALLED], [ACTION-IF-NOT]) +dnl +dnl ACTION-IF-UNINSTALLED (optional) extra actions to perform if the setup +dnl is an uninstalled setup +dnl ACTION-IF-NOT (optional) extra actions to perform if the setup +dnl is not an uninstalled setup +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_UNINSTALLED_SETUP], +[ + AC_MSG_CHECKING([whether this is an uninstalled GStreamer setup]) + AC_CACHE_VAL(gst_cv_is_uninstalled_setup,[ + gst_cv_is_uninstalled_setup=no + if (set -u; : $GST_PLUGIN_SYSTEM_PATH) 2>/dev/null ; then + if test -z "$GST_PLUGIN_SYSTEM_PATH" \ + -a -n "$GST_PLUGIN_SCANNER" \ + -a -n "$GST_PLUGIN_PATH" \ + -a -n "$GST_REGISTRY" \ + -a -n "$DYLD_LIBRARY_PATH" \ + -a -n "$LD_LIBRARY_PATH"; then + gst_cv_is_uninstalled_setup=yes; + fi + fi + ]) + AC_MSG_RESULT($gst_cv_is_uninstalled_setup) + if test "x$gst_cv_is_uninstalled_setup" = "xyes"; then + ifelse([$1], , :, [$1]) + else + ifelse([$2], , :, [$2]) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_BASE([GST-API_VERSION], [MIN-VERSION], [REQUIRED]) +dnl +dnl Sets GST_PLUGINS_BASE_CFLAGS and GST_PLUGINS_BASE_LIBS. +dnl +dnl Also sets GSTPB_PLUGINS_DIR (and for consistency also GST_PLUGINS_BASE_DIR) +dnl for use in Makefile.am. This is only really needed/useful in uninstalled +dnl setups, since in an installed setup all plugins will be found in +dnl GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BASE], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_BASE, gstreamer-plugins-base-[$1], [$2], + [GStreamer Base Plugins], [$3]) + + if test "x$HAVE_GST_PLUGINS_BASE" = "xyes"; then + dnl check for where base plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GSTPB_PLUGINS_DIR; then + GSTPB_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-base-[$1]` + if test -z $GSTPB_PLUGINS_DIR; then + AC_MSG_ERROR( + [no pluginsdir set in GStreamer Base Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR]) + GST_PLUGINS_BASE_DIR="$GSTPB_PLUGINS_DIR/gst:$GSTPB_PLUGINS_DIR/sys:$GSTPB_PLUGINS_DIR/ext" + AC_SUBST(GST_PLUGINS_BASE_DIR) + AC_SUBST(GSTPB_PLUGINS_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_GOOD([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_GOOD_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -good ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_GOOD], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_GOOD, gstreamer-plugins-good-[$1], [$2], + [GStreamer Good Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_GOOD" = "xyes"; then + dnl check for where good plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_GOOD_DIR; then + GST_PLUGINS_GOOD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-good-[$1]` + if test -z $GST_PLUGINS_GOOD_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Good Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Good Plugins in $GST_PLUGINS_GOOD_DIR]) + GST_PLUGINS_GOOD_DIR="$GST_PLUGINS_GOOD_DIR/gst:$GST_PLUGINS_GOOD_DIR/sys:$GST_PLUGINS_GOOD_DIR/ext" + AC_SUBST(GST_PLUGINS_GOOD_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_UGLY([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_UGLY_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -bad ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_UGLY], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_UGLY, gstreamer-plugins-ugly-[$1], [$2], + [GStreamer Ugly Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_UGLY" = "xyes"; then + dnl check for where ugly plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_UGLY_DIR; then + GST_PLUGINS_UGLY_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-ugly-[$1]` + if test -z $GST_PLUGINS_UGLY_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Ugly Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Ugly Plugins in $GST_PLUGINS_UGLY_DIR]) + GST_PLUGINS_UGLY_DIR="$GST_PLUGINS_UGLY_DIR/gst:$GST_PLUGINS_UGLY_DIR/sys:$GST_PLUGINS_UGLY_DIR/ext" + AC_SUBST(GST_PLUGINS_UGLY_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_BAD([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_BAD_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -ugly ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BAD], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_BAD, gstreamer-plugins-bad-[$1], [$2], + [GStreamer Bad Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_BAD" = "xyes"; then + dnl check for where bad plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_BAD_DIR; then + GST_PLUGINS_BAD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-bad-[$1]` + if test -z $GST_PLUGINS_BAD_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Bad Plugins pkg-config file]) + fi + fi + AC_MSG_NOTICE([using GStreamer Bad Plugins in $GST_PLUGINS_BAD_DIR]) + GST_PLUGINS_BAD_DIR="$GST_PLUGINS_BAD_DIR/gst:$GST_PLUGINS_BAD_DIR/sys:$GST_PLUGINS_BAD_DIR/ext" + AC_SUBST(GST_PLUGINS_BAD_DIR) + fi +]) + +dnl =========================================================================== +dnl AG_GST_CHECK_GST_PLUGINS_LIBAV([GST-API_VERSION], [MIN-VERSION]) +dnl +dnl Will set GST_PLUGINS_LIBAV_DIR for use in Makefile.am. Note that this will +dnl only be set in an uninstalled setup, since -libav ships no .pc file and in +dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. +dnl =========================================================================== +AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_LIBAV], +[ + AG_GST_CHECK_MODULES(GST_PLUGINS_LIBAV, gstreamer-plugins-libav-[$1], [$2], + [GStreamer Libav Plugins], [no]) + + if test "x$HAVE_GST_PLUGINS_LIBAV" = "xyes"; then + dnl check for where libav plugins got installed + dnl this is used for unit tests + dnl allow setting before calling this macro to override + if test -z $GST_PLUGINS_LIBAV_DIR; then + GST_PLUGINS_LIBAV_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-libav-[$1]` + if test -z $GST_PLUGINS_LIBAV_DIR; then + AC_MSG_ERROR([no pluginsdir set in GStreamer Libav Plugins pkg-config file]) + fi + fi + GST_PLUGINS_LIBAV_DIR="$GST_PLUGINS_LIBAV_DIR/ext/libav" + AC_MSG_NOTICE([using GStreamer Libav Plugins in $GST_PLUGINS_LIBAV_DIR]) + AC_SUBST(GST_PLUGINS_LIBAV_DIR) + fi +]) diff --git a/common/m4/gst-debuginfo.m4 b/common/m4/gst-debuginfo.m4 new file mode 100644 index 0000000..b48854d --- /dev/null +++ b/common/m4/gst-debuginfo.m4 @@ -0,0 +1,46 @@ +AC_DEFUN([AG_GST_DEBUGINFO], [ +AC_ARG_ENABLE(debug, +AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]), +[case "${enableval}" in + yes) USE_DEBUG=yes ;; + no) USE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; +esac], +[USE_DEBUG=yes]) dnl Default value + +AC_ARG_ENABLE(DEBUG, +AC_HELP_STRING([--disable-DEBUG],[disables compilation of debugging messages]), +[case "${enableval}" in + yes) ENABLE_DEBUG=yes ;; + no) ENABLE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;; +esac], +[ENABLE_DEBUG=yes]) dnl Default value +if test x$ENABLE_DEBUG = xyes; then + AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in]) +fi + +AC_ARG_ENABLE(INFO, +AC_HELP_STRING([--disable-INFO],[disables compilation of informational messages]), +[case "${enableval}" in + yes) ENABLE_INFO=yes ;; + no) ENABLE_INFO=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;; +esac], +[ENABLE_INFO=yes]) dnl Default value +if test x$ENABLE_INFO = xyes; then + AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in]) +fi + +AC_ARG_ENABLE(debug-color, +AC_HELP_STRING([--disable-debug-color],[disables color output of DEBUG and INFO output]), +[case "${enableval}" in + yes) ENABLE_DEBUG_COLOR=yes ;; + no) ENABLE_DEBUG_COLOR=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;; +esac], +[ENABLE_DEBUG_COLOR=yes]) dnl Default value +if test "x$ENABLE_DEBUG_COLOR" = xyes; then + AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized]) +fi +]) diff --git a/common/m4/gst-default.m4 b/common/m4/gst-default.m4 new file mode 100644 index 0000000..8de9756 --- /dev/null +++ b/common/m4/gst-default.m4 @@ -0,0 +1,120 @@ +dnl default elements used for tests and such + +dnl AG_GST_DEFAULT_ELEMENTS + +AC_DEFUN([AG_GST_DEFAULT_ELEMENTS], +[ + dnl decide on default elements + dnl FIXME: describe where exactly this gets used + dnl FIXME: decide if it's a problem that this could point to sinks from + dnl depending plugin modules + dnl FIXME: when can we just use autoaudiosrc and autovideosrc? + DEFAULT_AUDIOSINK="autoaudiosink" + DEFAULT_VIDEOSINK="autovideosink" + DEFAULT_AUDIOSRC="alsasrc" + DEFAULT_VIDEOSRC="v4l2src" + DEFAULT_VISUALIZER="goom" + case "$host" in + *-sun-* | *pc-solaris* ) + DEFAULT_AUDIOSRC="sunaudiosrc" + ;; + *-darwin* ) + DEFAULT_AUDIOSRC="osxaudiosrc" + ;; + esac + + dnl Default audio sink + AC_ARG_WITH(default-audiosink, + AC_HELP_STRING([--with-default-audiosink], [specify default audio sink]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosink) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosink) ;; + *) DEFAULT_AUDIOSINK="${withval}" ;; + esac + ], + [ + DEFAULT_AUDIOSINK="$DEFAULT_AUDIOSINK" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_AUDIOSINK as default audio sink) + AC_SUBST(DEFAULT_AUDIOSINK) + AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSINK, "$DEFAULT_AUDIOSINK", + [Default audio sink]) + + dnl Default audio source + AC_ARG_WITH(default-audiosrc, + AC_HELP_STRING([--with-default-audiosrc], [specify default audio source]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosrc) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-audiosrc) ;; + *) DEFAULT_AUDIOSRC="${withval}" ;; + esac + ], + [ + DEFAULT_AUDIOSRC="$DEFAULT_AUDIOSRC" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_AUDIOSRC as default audio source) + AC_SUBST(DEFAULT_AUDIOSRC) + AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSRC, "$DEFAULT_AUDIOSRC", + [Default audio source]) + + dnl Default video sink + AC_ARG_WITH(default-videosink, + AC_HELP_STRING([--with-default-videosink], [specify default video sink]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-videosink) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-videosink) ;; + *) DEFAULT_VIDEOSINK="${withval}" ;; + esac + ], + [ + DEFAULT_VIDEOSINK="$DEFAULT_VIDEOSINK" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_VIDEOSINK as default video sink) + AC_SUBST(DEFAULT_VIDEOSINK) + AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSINK, "$DEFAULT_VIDEOSINK", + [Default video sink]) + + dnl Default video source + AC_ARG_WITH(default-videosrc, + AC_HELP_STRING([--with-default-videosrc], [specify default video source]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-videosrc) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-videosrc) ;; + *) DEFAULT_VIDEOSRC="${withval}" ;; + esac + ], + [ + DEFAULT_VIDEOSRC="$DEFAULT_VIDEOSRC" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_VIDEOSRC as default video source) + AC_SUBST(DEFAULT_VIDEOSRC) + AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSRC, "$DEFAULT_VIDEOSRC", + [Default video source]) + + dnl Default visualizer + AC_ARG_WITH(default-visualizer, + AC_HELP_STRING([--with-default-visualizer], [specify default visualizer]), + [ + case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-default-visualizer) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-default-visualizer) ;; + *) DEFAULT_VISUALIZER="${withval}" ;; + esac + ], + [ + DEFAULT_VISUALIZER="$DEFAULT_VISUALIZER" + ] dnl Default value as determined above + ) + AC_MSG_NOTICE(Using $DEFAULT_VISUALIZER as default visualizer) + AC_SUBST(DEFAULT_VISUALIZER) + AC_DEFINE_UNQUOTED(DEFAULT_VISUALIZER, "$DEFAULT_VISUALIZER", + [Default visualizer]) +]) diff --git a/common/m4/gst-doc.m4 b/common/m4/gst-doc.m4 new file mode 100644 index 0000000..5d3f0fd --- /dev/null +++ b/common/m4/gst-doc.m4 @@ -0,0 +1,92 @@ +AC_DEFUN([AG_GST_DOCBOOK_CHECK], +[ + dnl choose a location to install docbook docs in + if test "x$PACKAGE_TARNAME" = "x" + then + AC_MSG_ERROR([Internal error - PACKAGE_TARNAME not set]) + fi + docdir="\$(datadir)/doc/$PACKAGE_TARNAME-$GST_API_VERSION" + + dnl enable/disable docbook documentation building + AC_ARG_ENABLE(docbook, + AC_HELP_STRING([--enable-docbook], + [use docbook to build documentation [default=no]]),, + enable_docbook=no) + + have_docbook=no + + if test x$enable_docbook = xyes; then + dnl check if we actually have everything we need + + dnl check for docbook tools + AC_CHECK_PROG(HAVE_DOCBOOK2PS, docbook2ps, yes, no) + AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, yes, no) + AC_CHECK_PROG(HAVE_JADETEX, jadetex, yes, no) + AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, yes, no) + + dnl check if we can process docbook stuff + AS_DOCBOOK(have_docbook=yes, have_docbook=no) + + dnl check for extra tools + AC_CHECK_PROG(HAVE_DVIPS, dvips, yes, no) + AC_CHECK_PROG(HAVE_XMLLINT, xmllint, yes, no) + + AC_CHECK_PROG(HAVE_PNGTOPNM, pngtopnm, yes, no) + AC_CHECK_PROG(HAVE_PNMTOPS, pnmtops, yes, no) + AC_CHECK_PROG(HAVE_EPSTOPDF, epstopdf, yes, no) + + dnl check if we can generate HTML + if test "x$HAVE_XSLTPROC" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes"; then + DOC_HTML=yes + AC_MSG_NOTICE(Will output HTML documentation) + else + DOC_HTML=no + AC_MSG_NOTICE(Will not output HTML documentation) + fi + + dnl check if we can generate PS + if test "x$HAVE_DOCBOOK2PS" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes" && \ + test "x$HAVE_JADETEX" = "xyes" && \ + test "x$HAVE_DVIPS" = "xyes" && \ + test "x$HAVE_PNGTOPNM" = "xyes" && \ + test "x$HAVE_PNMTOPS" = "xyes"; then + DOC_PS=yes + AC_MSG_NOTICE(Will output PS documentation) + else + DOC_PS=no + AC_MSG_NOTICE(Will not output PS documentation) + fi + + dnl check if we can generate PDF - using only ps2pdf + if test "x$DOC_PS" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes" && \ + test "x$HAVE_PS2PDF" = "xyes"; then + DOC_PDF=yes + AC_MSG_NOTICE(Will output PDF documentation) + else + DOC_PDF=no + AC_MSG_NOTICE(Will not output PDF documentation) + fi + + dnl if we don't have everything, we should disable + if test "x$have_docbook" != "xyes"; then + enable_docbook=no + fi + fi + + dnl if we're going to install documentation, tell us where + if test "x$have_docbook" = "xyes"; then + AC_MSG_NOTICE(Installing documentation in $docdir) + AC_SUBST(docdir) + fi + + AM_CONDITIONAL(ENABLE_DOCBOOK, test x$enable_docbook = xyes) + AM_CONDITIONAL(DOC_HTML, test x$DOC_HTML = xyes) + AM_CONDITIONAL(DOC_PDF, test x$DOC_PDF = xyes) + AM_CONDITIONAL(DOC_PS, test x$DOC_PS = xyes) +]) diff --git a/common/m4/gst-dowhile.m4 b/common/m4/gst-dowhile.m4 new file mode 100644 index 0000000..069808d --- /dev/null +++ b/common/m4/gst-dowhile.m4 @@ -0,0 +1,24 @@ +dnl +dnl Check for working do while(0) macros. This is used by G_STMT_START +dnl and G_STMT_END in glib/gmacros.h. Without having this defined we +dnl get "ambigious if-else" compiler warnings when compling C++ code. +dnl +dnl Copied from GLib's configure.in +dnl +AC_DEFUN([AG_GST_CHECK_DOWHILE_MACROS],[ + +dnl *** check for working do while(0) macros *** +AC_CACHE_CHECK([for working do while(0) macros], _cv_g_support_dowhile_macros, [ + AC_TRY_COMPILE([],[ + #define STMT_START do + #define STMT_END while(0) + #define STMT_TEST STMT_START { i = 0; } STMT_END + int main(void) { int i = 1; STMT_TEST; return i; }], + [_cv_g_support_dowhile_macros=yes], + [_cv_g_support_dowhile_macros=no], + [_cv_g_support_dowhile_macros=yes]) +]) +if test x$_cv_g_support_dowhile_macros = xyes; then + AC_DEFINE(HAVE_DOWHILE_MACROS, 1, [define for working do while(0) macros]) +fi +]) diff --git a/common/m4/gst-error.m4 b/common/m4/gst-error.m4 new file mode 100644 index 0000000..bce80d2 --- /dev/null +++ b/common/m4/gst-error.m4 @@ -0,0 +1,298 @@ +dnl handle various error-related things + +dnl Thomas Vander Stichele +dnl Tim-Philipp Müller + +dnl Last modification: 2008-02-18 + +dnl AG_GST_SET_ERROR_CFLAGS([ADD-WERROR], [MORE_FLAGS]) +dnl AG_GST_SET_ERROR_CXXFLAGS([ADD-WERROR], [MORE_FLAGS]) +dnl AG_GST_SET_LEVEL_DEFAULT([IS-GIT-VERSION]) + + +dnl Sets WARNING_CFLAGS and ERROR_CFLAGS to something the compiler +dnl will accept and AC_SUBST them so they are available in Makefile +dnl +dnl WARNING_CFLAGS will contain flags to make the compiler emit more +dnl warnings. +dnl ERROR_CFLAGS will contain flags to make those warnings fatal, +dnl unless ADD-WERROR is set to "no" +dnl +dnl If MORE_FLAGS is set, tries to add each of the given flags +dnl to WARNING_CFLAGS if the compiler supports them. Each flag is +dnl tested separately. +dnl +dnl These flags can be overridden at make time: +dnl make ERROR_CFLAGS= +AC_DEFUN([AG_GST_SET_ERROR_CFLAGS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AS_COMPILER_FLAG]) + + WARNING_CFLAGS="" + ERROR_CFLAGS="" + + dnl if we support -Wall, set it unconditionally + AS_COMPILER_FLAG(-Wall, + WARNING_CFLAGS="$WARNING_CFLAGS -Wall") + + dnl Warn if declarations after statements are used (C99 extension) + AS_COMPILER_FLAG(-Wdeclaration-after-statement, + WARNING_CFLAGS="$WARNING_CFLAGS -Wdeclaration-after-statement") + + dnl Warn if variable length arrays are used (C99 extension) + AS_COMPILER_FLAG(-Wvla, + WARNING_CFLAGS="$WARNING_CFLAGS -Wvla") + + dnl Warn for invalid pointer arithmetic + AS_COMPILER_FLAG(-Wpointer-arith, + WARNING_CFLAGS="$WARNING_CFLAGS -Wpointer-arith") + + dnl if asked for, add -Werror if supported + if test "x$1" != "xno" + then + AS_COMPILER_FLAG(-Werror, ERROR_CFLAGS="$ERROR_CFLAGS -Werror") + + dnl if -Werror isn't suported, try -errwarn=%all (Sun Forte case) + if test "x$ERROR_CFLAGS" = "x" + then + AS_COMPILER_FLAG([-errwarn=%all], [ + ERROR_CFLAGS="-errwarn=%all" + dnl try -errwarn=%all,no%E_EMPTY_DECLARATION, + dnl no%E_STATEMENT_NOT_REACHED,no%E_ARGUEMENT_MISMATCH, + dnl no%E_MACRO_REDEFINED (Sun Forte case) + dnl For Forte we need disable "empty declaration" warning produced by un-needed semicolon + dnl "statement not reached" disabled because there is g_assert_not_reached () in some places + dnl "macro redefined" because of gst/gettext.h + dnl FIXME: is it really supposed to be 'ARGUEMENT' and not 'ARGUMENT'? + for f in 'no%E_EMPTY_DECLARATION' \ + 'no%E_STATEMENT_NOT_REACHED' \ + 'no%E_ARGUEMENT_MISMATCH' \ + 'no%E_MACRO_REDEFINED' \ + 'no%E_LOOP_NOT_ENTERED_AT_TOP' + do + AS_COMPILER_FLAG([-errwarn=%all,$f], [ + ERROR_CFLAGS="$ERROR_CFLAGS,$f" + ]) + done + ]) + else + dnl Add -fno-strict-aliasing for GLib versions before 2.19.8 + dnl as before G_LOCK and friends caused strict aliasing compiler + dnl warnings. + PKG_CHECK_EXISTS([glib-2.0 < 2.19.8], [ + AS_COMPILER_FLAG(-fno-strict-aliasing, + ERROR_CFLAGS="$ERROR_CFLAGS -fno-strict-aliasing") + ]) + fi + fi + + if test "x$2" != "x" + then + UNSUPPORTED="" + list="$2" + for each in $list + do + AS_COMPILER_FLAG($each, + WARNING_CFLAGS="$WARNING_CFLAGS $each", + UNSUPPORTED="$UNSUPPORTED $each") + done + if test "X$UNSUPPORTED" != X ; then + AC_MSG_NOTICE([unsupported compiler flags: $UNSUPPORTED]) + fi + fi + + AC_SUBST(WARNING_CFLAGS) + AC_SUBST(ERROR_CFLAGS) + AC_MSG_NOTICE([set WARNING_CFLAGS to $WARNING_CFLAGS]) + AC_MSG_NOTICE([set ERROR_CFLAGS to $ERROR_CFLAGS]) +]) + +dnl Sets WARNING_CXXFLAGS and ERROR_CXXFLAGS to something the compiler +dnl will accept and AC_SUBST them so they are available in Makefile +dnl +dnl WARNING_CXXFLAGS will contain flags to make the compiler emit more +dnl warnings. +dnl ERROR_CXXFLAGS will contain flags to make those warnings fatal, +dnl unless ADD-WERROR is set to "no" +dnl +dnl If MORE_FLAGS is set, tries to add each of the given flags +dnl to WARNING_CFLAGS if the compiler supports them. Each flag is +dnl tested separately. +dnl +dnl These flags can be overridden at make time: +dnl make ERROR_CXXFLAGS= +AC_DEFUN([AG_GST_SET_ERROR_CXXFLAGS], +[ + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AS_CXX_COMPILER_FLAG]) + + ERROR_CXXFLAGS="" + WARNING_CXXFLAGS="" + + dnl if we support -Wall, set it unconditionally + AS_CXX_COMPILER_FLAG(-Wall, WARNING_CXXFLAGS="$WARNING_CXXFLAGS -Wall") + + dnl if asked for, add -Werror if supported + if test "x$1" != "xno" + then + AS_CXX_COMPILER_FLAG(-Werror, ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror") + + if test "x$ERROR_CXXFLAGS" != "x" + then + dnl add exceptions + AS_CXX_COMPILER_FLAG([-Wno-non-virtual-dtor], ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Wno-non-virtual-dtor") + + dnl Add -fno-strict-aliasing for GLib versions before 2.19.8 + dnl as before G_LOCK and friends caused strict aliasing compiler + dnl warnings. + PKG_CHECK_EXISTS([glib-2.0 < 2.19.8], [ + AS_CXX_COMPILER_FLAG([-fno-strict-aliasing], + ERROR_CXXFLAGS="$ERROR_CXXFLAGS -fno-strict-aliasing") + ]) + else + dnl if -Werror isn't suported, try -errwarn=%all + AS_CXX_COMPILER_FLAG([-errwarn=%all], ERROR_CXXFLAGS="$ERROR_CXXFLAGS -errwarn=%all") + if test "x$ERROR_CXXFLAGS" != "x"; then + dnl try -errwarn=%all,no%E_EMPTY_DECLARATION, + dnl no%E_STATEMENT_NOT_REACHED,no%E_ARGUEMENT_MISMATCH, + dnl no%E_MACRO_REDEFINED (Sun Forte case) + dnl For Forte we need disable "empty declaration" warning produced by un-needed semicolon + dnl "statement not reached" disabled because there is g_assert_not_reached () in some places + dnl "macro redefined" because of gst/gettext.h + dnl FIXME: is it really supposed to be 'ARGUEMENT' and not 'ARGUMENT'? + dnl FIXME: do any of these work with the c++ compiler? if not, why + dnl do we check at all? + for f in 'no%E_EMPTY_DECLARATION' \ + 'no%E_STATEMENT_NOT_REACHED' \ + 'no%E_ARGUEMENT_MISMATCH' \ + 'no%E_MACRO_REDEFINED' \ + 'no%E_LOOP_NOT_ENTERED_AT_TOP' + do + AS_CXX_COMPILER_FLAG([-errwarn=%all,$f], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS,$f"]) + done + fi + fi + fi + + if test "x$2" != "x" + then + UNSUPPORTED="" + list="$2" + for each in $list + do + AS_CXX_COMPILER_FLAG($each, + WARNING_CXXFLAGS="$WARNING_CXXFLAGS $each", + UNSUPPORTED="$UNSUPPORTED $each") + done + if test "X$UNSUPPORTED" != X ; then + AC_MSG_NOTICE([unsupported compiler flags: $UNSUPPORTED]) + fi + fi + + AC_SUBST(WARNING_CXXFLAGS) + AC_SUBST(ERROR_CXXFLAGS) + AC_MSG_NOTICE([set WARNING_CXXFLAGS to $WARNING_CXXFLAGS]) + AC_MSG_NOTICE([set ERROR_CXXFLAGS to $ERROR_CXXFLAGS]) +]) + +dnl Sets WARNING_OBJCFLAGS and ERROR_OBJCFLAGS to something the compiler +dnl will accept and AC_SUBST them so they are available in Makefile +dnl +dnl WARNING_OBJCFLAGS will contain flags to make the compiler emit more +dnl warnings. +dnl ERROR_OBJCFLAGS will contain flags to make those warnings fatal, +dnl unless ADD-WERROR is set to "no" +dnl +dnl If MORE_FLAGS is set, tries to add each of the given flags +dnl to WARNING_CFLAGS if the compiler supports them. Each flag is +dnl tested separately. +dnl +dnl These flags can be overridden at make time: +dnl make ERROR_OBJCFLAGS= +AC_DEFUN([AG_GST_SET_ERROR_OBJCFLAGS], +[ + AC_REQUIRE([AC_PROG_OBJC]) + AC_REQUIRE([AS_OBJC_COMPILER_FLAG]) + + ERROR_OBJCFLAGS="" + WARNING_OBJCFLAGS="" + + dnl if we support -Wall, set it unconditionally + AS_OBJC_COMPILER_FLAG(-Wall, WARNING_OBJCFLAGS="$WARNING_OBJCFLAGS -Wall") + + dnl if asked for, add -Werror if supported + if test "x$1" != "xno" + then + AS_OBJC_COMPILER_FLAG(-Werror, ERROR_OBJCFLAGS="$ERROR_OBJCFLAGS -Werror") + + if test "x$ERROR_OBJCFLAGS" != "x" + then + dnl Add -fno-strict-aliasing for GLib versions before 2.19.8 + dnl as before G_LOCK and friends caused strict aliasing compiler + dnl warnings. + PKG_CHECK_EXISTS([glib-2.0 < 2.19.8], [ + AS_OBJC_COMPILER_FLAG([-fno-strict-aliasing], + ERROR_OBJCFLAGS="$ERROR_OBJCFLAGS -fno-strict-aliasing") + ]) + else + dnl if -Werror isn't suported, try -errwarn=%all + AS_OBJC_COMPILER_FLAG([-errwarn=%all], ERROR_OBJCFLAGS="$ERROR_OBJCFLAGS -errwarn=%all") + if test "x$ERROR_OBJCFLAGS" != "x"; then + dnl try -errwarn=%all,no%E_EMPTY_DECLARATION, + dnl no%E_STATEMENT_NOT_REACHED,no%E_ARGUEMENT_MISMATCH, + dnl no%E_MACRO_REDEFINED (Sun Forte case) + dnl For Forte we need disable "empty declaration" warning produced by un-needed semicolon + dnl "statement not reached" disabled because there is g_assert_not_reached () in some places + dnl "macro redefined" because of gst/gettext.h + dnl FIXME: is it really supposed to be 'ARGUEMENT' and not 'ARGUMENT'? + dnl FIXME: do any of these work with the c++ compiler? if not, why + dnl do we check at all? + for f in 'no%E_EMPTY_DECLARATION' \ + 'no%E_STATEMENT_NOT_REACHED' \ + 'no%E_ARGUEMENT_MISMATCH' \ + 'no%E_MACRO_REDEFINED' \ + 'no%E_LOOP_NOT_ENTERED_AT_TOP' + do + AS_OBJC_COMPILER_FLAG([-errwarn=%all,$f], [ERROR_OBJCFLAGS="$ERROR_OBJCFLAGS,$f"]) + done + fi + fi + fi + + if test "x$2" != "x" + then + UNSUPPORTED="" + list="$2" + for each in $list + do + AS_OBJC_COMPILER_FLAG($each, + WARNING_OBJCFLAGS="$WARNING_OBJCFLAGS $each", + UNSUPPORTED="$UNSUPPORTED $each") + done + if test "X$UNSUPPORTED" != X ; then + AC_MSG_NOTICE([unsupported compiler flags: $UNSUPPORTED]) + fi + fi + + AC_SUBST(WARNING_OBJCFLAGS) + AC_SUBST(ERROR_OBJCFLAGS) + AC_MSG_NOTICE([set WARNING_OBJCFLAGS to $WARNING_OBJCFLAGS]) + AC_MSG_NOTICE([set ERROR_OBJCFLAGS to $ERROR_OBJCFLAGS]) +]) + +dnl Sets the default error level for debugging messages +AC_DEFUN([AG_GST_SET_LEVEL_DEFAULT], +[ + dnl define correct errorlevel for debugging messages. We want to have + dnl GST_ERROR messages printed when running cvs builds + if test "x[$1]" = "xyes"; then + GST_LEVEL_DEFAULT=GST_LEVEL_ERROR + else + GST_LEVEL_DEFAULT=GST_LEVEL_NONE + fi + AC_DEFINE_UNQUOTED(GST_LEVEL_DEFAULT, $GST_LEVEL_DEFAULT, + [Default errorlevel to use]) + dnl AC_SUBST so we can use it for win32/common/config.h + AC_SUBST(GST_LEVEL_DEFAULT) +]) diff --git a/common/m4/gst-feature.m4 b/common/m4/gst-feature.m4 new file mode 100644 index 0000000..876215e --- /dev/null +++ b/common/m4/gst-feature.m4 @@ -0,0 +1,297 @@ +dnl Perform a check for a feature for GStreamer +dnl Richard Boulton +dnl Thomas Vander Stichele added useful stuff +dnl Last modification: 25/06/2001 +dnl +dnl AG_GST_CHECK_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION, +dnl DEPENDENT-PLUGINS, TEST-FOR-FEATURE, +dnl DISABLE-BY-DEFAULT, ACTION-IF-USE, ACTION-IF-NOTUSE) +dnl +dnl This macro adds a command line argument to allow the user to enable +dnl or disable a feature, and if the feature is enabled, performs a supplied +dnl test to check if the feature is available. +dnl +dnl The test should define HAVE_ to "yes" or "no" depending +dnl on whether the feature is available. +dnl +dnl The macro will set USE_ to "yes" or "no" depending on +dnl whether the feature is to be used. +dnl Thomas changed this, so that when USE_ was already set +dnl to no, then it stays that way. +dnl +dnl The macro will call AM_CONDITIONAL(USE_, ...) to allow +dnl the feature to control what is built in Makefile.ams. If you want +dnl additional actions resulting from the test, you can add them with the +dnl ACTION-IF-USE and ACTION-IF-NOTUSE parameters. +dnl +dnl FEATURE-NAME is the name of the feature, and should be in +dnl purely upper case characters. +dnl FEATURE-DESCRIPTION is used to describe the feature in help text for +dnl the command line argument. +dnl DEPENDENT-PLUGINS lists any plug-ins which depend on this feature. +dnl TEST-FOR-FEATURE is a test which sets HAVE_ to "yes" +dnl or "no" depending on whether the feature is +dnl available. +dnl DISABLE-BY-DEFAULT if "disabled", the feature is disabled by default, +dnl if any other value, the feature is enabled by default. +dnl ACTION-IF-USE any extra actions to perform if the feature is to be +dnl used. +dnl ACTION-IF-NOTUSE any extra actions to perform if the feature is not to +dnl be used. +dnl +dnl +dnl thomas : +dnl we also added a history. +dnl GST_PLUGINS_YES will contain all plugins to be built +dnl that were checked through AG_GST_CHECK_FEATURE +dnl GST_PLUGINS_NO will contain those that won't be built + +AC_DEFUN([AG_GST_CHECK_FEATURE], +[echo +AC_MSG_NOTICE(*** checking feature: [$2] ***) +if test "x[$3]" != "x" +then + AC_MSG_NOTICE(*** for plug-ins: [$3] ***) +fi +dnl +builtin(define, [gst_endisable], ifelse($5, [disabled], [enable], [disable]))dnl +dnl if it is set to NO, then don't even consider it for building +NOUSE= +if test "x$USE_[$1]" = "xno"; then + NOUSE="yes" +fi +AC_ARG_ENABLE(translit([$1], A-Z, a-z), + [ ]builtin(format, --%-26s gst_endisable %s, gst_endisable-translit([$1], A-Z, a-z), [$2]ifelse([$3],,,: [$3])), + [ case "${enableval}" in + yes) USE_[$1]=yes;; + no) USE_[$1]=no;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;; + esac], + [ USE_$1=]ifelse($5, [disabled], [no], [yes])) dnl DEFAULT + +dnl *** set it back to no if it was preset to no +if test "x$NOUSE" = "xyes"; then + USE_[$1]="no" + AC_MSG_WARN(*** $3 pre-configured not to be built) +fi +NOUSE= + +dnl *** Check if it is ported or not +if echo " [$GST_PLUGINS_NONPORTED] " | tr , ' ' | grep -i " [$1] " > /dev/null; then + USE_[$1]="no" + AC_MSG_WARN(*** $3 not ported) +fi + +dnl *** If it's enabled + +if test x$USE_[$1] = xyes; then + dnl save compile variables before the test + + gst_check_save_LIBS=$LIBS + gst_check_save_LDFLAGS=$LDFLAGS + gst_check_save_CFLAGS=$CFLAGS + gst_check_save_CPPFLAGS=$CPPFLAGS + gst_check_save_CXXFLAGS=$CXXFLAGS + + HAVE_[$1]=no + dnl TEST_FOR_FEATURE + $4 + + LIBS=$gst_check_save_LIBS + LDFLAGS=$gst_check_save_LDFLAGS + CFLAGS=$gst_check_save_CFLAGS + CPPFLAGS=$gst_check_save_CPPFLAGS + CXXFLAGS=$gst_check_save_CXXFLAGS + + dnl If it isn't found, unset USE_[$1] + if test x$HAVE_[$1] = xno; then + USE_[$1]=no + else + ifelse([$3], , :, [AC_MSG_NOTICE(*** These plugins will be built: [$3])]) + fi +fi +dnl *** Warn if it's disabled or not found +if test x$USE_[$1] = xyes; then + ifelse([$6], , :, [$6]) + if test "x$3" != "x"; then + GST_PLUGINS_YES="\t[$3]\n$GST_PLUGINS_YES" + fi + AC_DEFINE(HAVE_[$1], , [Define to enable $2]ifelse($3,,, [ (used by $3)]).) +else + ifelse([$3], , :, [AC_MSG_NOTICE(*** These plugins will not be built: [$3])]) + if test "x$3" != "x"; then + GST_PLUGINS_NO="\t[$3]\n$GST_PLUGINS_NO" + fi + ifelse([$7], , :, [$7]) +fi +dnl *** Define the conditional as appropriate +AM_CONDITIONAL(USE_[$1], test x$USE_[$1] = xyes) +]) + +dnl Use AC_CHECK_LIB and AC_CHECK_HEADER to do both tests at once +dnl sets HAVE_module if we have it +dnl Richard Boulton +dnl Last modification: 26/06/2001 +dnl AG_GST_CHECK_LIBHEADER(FEATURE-NAME, LIB NAME, LIB FUNCTION, EXTRA LD FLAGS, +dnl HEADER NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +dnl +dnl This check was written for GStreamer: it should be renamed and checked +dnl for portability if you decide to use it elsewhere. +dnl +AC_DEFUN([AG_GST_CHECK_LIBHEADER], +[ + AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no,[$4]) + if test "x$HAVE_[$1]" = "xyes"; then + AC_CHECK_HEADER([$5], :, HAVE_[$1]=no) + if test "x$HAVE_[$1]" = "xyes"; then + dnl execute what needs to be + ifelse([$6], , :, [$6]) + else + ifelse([$7], , :, [$7]) + fi + else + ifelse([$7], , :, [$7]) + fi + AC_SUBST(HAVE_[$1]) +] +) + +dnl 2004-02-14 Thomas - changed to get set properly and use proper output +dnl 2003-06-27 Benjamin Otte - changed to make this work with gstconfig.h +dnl +dnl Add a subsystem --disable flag and all the necessary symbols and substitions +dnl +dnl AG_GST_CHECK_SUBSYSTEM_DISABLE(SYSNAME, [subsystem name]) +dnl +AC_DEFUN([AG_GST_CHECK_SUBSYSTEM_DISABLE], +[ + dnl this define will replace each literal subsys_def occurrence with + dnl the lowercase hyphen-separated subsystem + dnl e.g. if $1 is GST_DEBUG then subsys_def will be a macro with gst-debug + define([subsys_def],translit([$1], _A-Z, -a-z)) + + AC_ARG_ENABLE(subsys_def, + AC_HELP_STRING(--disable-subsys_def, [disable $2]), + [ + case "${enableval}" in + yes) GST_DISABLE_[$1]=no ;; + no) GST_DISABLE_[$1]=yes ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-subsys_def]) ;; + esac + ], + [GST_DISABLE_[$1]=no]) dnl Default value + + if test x$GST_DISABLE_[$1] = xyes; then + AC_MSG_NOTICE([disabled subsystem [$2]]) + GST_DISABLE_[$1]_DEFINE="#define GST_DISABLE_$1 1" + else + GST_DISABLE_[$1]_DEFINE="/* #undef GST_DISABLE_$1 */" + fi + AC_SUBST(GST_DISABLE_[$1]_DEFINE) + undefine([subsys_def]) +]) + + +dnl Parse gstconfig.h for feature and defines add the symbols and substitions +dnl +dnl AG_GST_PARSE_SUBSYSTEM_DISABLE(GST_CONFIGPATH, FEATURE) +dnl +AC_DEFUN([AG_GST_PARSE_SUBSYSTEM_DISABLE], +[ + grep >/dev/null "#undef GST_DISABLE_$2" $1 + if test $? = 0; then + GST_DISABLE_[$2]=0 + else + GST_DISABLE_[$2]=1 + fi + AC_SUBST(GST_DISABLE_[$2]) +]) + +dnl Parse gstconfig.h and defines add the symbols and substitions +dnl +dnl GST_CONFIGPATH=`$PKG_CONFIG --variable=includedir gstreamer-1.0`"/gst/gstconfig.h" +dnl AG_GST_PARSE_SUBSYSTEM_DISABLES(GST_CONFIGPATH) +dnl +AC_DEFUN([AG_GST_PARSE_SUBSYSTEM_DISABLES], +[ + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,GST_DEBUG) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,LOADSAVE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,PARSE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,TRACE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,ALLOC_TRACE) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,REGISTRY) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,PLUGIN) + AG_GST_PARSE_SUBSYSTEM_DISABLE($1,XML) +]) + +dnl AG_GST_CHECK_GST_DEBUG_DISABLED(ACTION-IF-DISABLED, ACTION-IF-NOT-DISABLED) +dnl +dnl Checks if the GStreamer debugging system is disabled in the core version +dnl we are compiling against (by checking gstconfig.h) +dnl +AC_DEFUN([AG_GST_CHECK_GST_DEBUG_DISABLED], +[ + AC_REQUIRE([AG_GST_CHECK_GST]) + + AC_MSG_CHECKING([whether the GStreamer debugging system is enabled]) + AC_LANG_PUSH([C]) + save_CFLAGS="$CFLAGS" + CFLAGS="$GST_CFLAGS $CFLAGS" + AC_COMPILE_IFELSE([ + AC_LANG_SOURCE([[ + #include + #ifdef GST_DISABLE_GST_DEBUG + #error "debugging disabled, make compiler fail" + #endif]])], [ debug_system_enabled=yes], [debug_system_enabled=no]) + CFLAGS="$save_CFLAGS" + AC_LANG_POP([C]) + + AC_MSG_RESULT([$debug_system_enabled]) + + if test "x$debug_system_enabled" = "xyes" ; then + $2 + true + else + $1 + true + fi +]) + +dnl relies on GST_PLUGINS_ALL, GST_PLUGINS_SELECTED, GST_PLUGINS_YES, +dnl GST_PLUGINS_NO, and BUILD_EXTERNAL +AC_DEFUN([AG_GST_OUTPUT_PLUGINS], [ + +printf "configure: *** Plug-ins without external dependencies that will be built:\n" +( for i in $GST_PLUGINS_SELECTED; do printf '\t'$i'\n'; done ) | sort +printf "\n" + +printf "configure: *** Plug-ins without external dependencies that will NOT be built:\n" +( for i in $GST_PLUGINS_ALL; do + case " $GST_PLUGINS_SELECTED " in + *\ $i\ *) + ;; + *) + printf '\t'$i'\n' + ;; + esac + done ) | sort +printf "\n" + +printf "configure: *** Plug-ins that have NOT been ported:\n" +( for i in $GST_PLUGINS_NONPORTED; do + printf '\t'$i'\n' + done ) | sort +printf "\n" + +if test "x$BUILD_EXTERNAL" = "xno"; then + printf "configure: *** No plug-ins with external dependencies will be built\n" +else + printf "configure: *** Plug-ins with dependencies that will be built:" + printf "$GST_PLUGINS_YES\n" | sort + printf "\n" + printf "configure: *** Plug-ins with dependencies that will NOT be built:" + printf "$GST_PLUGINS_NO\n" | sort + printf "\n" +fi +]) + diff --git a/common/m4/gst-function.m4 b/common/m4/gst-function.m4 new file mode 100644 index 0000000..61adfd3 --- /dev/null +++ b/common/m4/gst-function.m4 @@ -0,0 +1,63 @@ +dnl +dnl Check for compiler mechanism to show functions in debugging +dnl copied from an Ali patch floating on the internet +dnl +AC_DEFUN([AG_GST_CHECK_FUNCTION],[ + dnl #1: __PRETTY_FUNCTION__ + AC_MSG_CHECKING(whether $CC implements __PRETTY_FUNCTION__) + AC_CACHE_VAL(gst_cv_have_pretty_function,[ + AC_TRY_LINK([#include ], + [printf("%s", __PRETTY_FUNCTION__);], + gst_cv_have_pretty_function=yes, + gst_cv_have_pretty_function=no) + ]) + AC_MSG_RESULT($gst_cv_have_pretty_function) + if test "$gst_cv_have_pretty_function" = yes; then + AC_DEFINE(HAVE_PRETTY_FUNCTION, 1, + [defined if the compiler implements __PRETTY_FUNCTION__]) + fi + +dnl #2: __FUNCTION__ + AC_MSG_CHECKING(whether $CC implements __FUNCTION__) + AC_CACHE_VAL(gst_cv_have_function,[ + AC_TRY_LINK([#include ], + [printf("%s", __FUNCTION__);], + gst_cv_have_function=yes, + gst_cv_have_function=no) + ]) + AC_MSG_RESULT($gst_cv_have_function) + if test "$gst_cv_have_function" = yes; then + AC_DEFINE(HAVE_FUNCTION, 1, + [defined if the compiler implements __FUNCTION__]) + fi + +dnl #3: __func__ + AC_MSG_CHECKING(whether $CC implements __func__) + AC_CACHE_VAL(gst_cv_have_func,[ + AC_TRY_LINK([#include ], + [printf("%s", __func__);], + gst_cv_have_func=yes, + gst_cv_have_func=no) + ]) + AC_MSG_RESULT($gst_cv_have_func) + if test "$gst_cv_have_func" = yes; then + AC_DEFINE(HAVE_FUNC, 1, + [defined if the compiler implements __func__]) + fi + +dnl now define FUNCTION to whatever works, and fallback to "" + if test "$gst_cv_have_pretty_function" = yes; then + function=__PRETTY_FUNCTION__ + else + if test "$gst_cv_have_function" = yes; then + function=__FUNCTION__ + else + if test "$gst_cv_have_func" = yes; then + function=__func__ + else + function=\"\" + fi + fi + fi + AC_DEFINE_UNQUOTED(GST_FUNCTION, $function, [macro to use to show function name]) +]) diff --git a/common/m4/gst-gettext.m4 b/common/m4/gst-gettext.m4 new file mode 100644 index 0000000..df817eb --- /dev/null +++ b/common/m4/gst-gettext.m4 @@ -0,0 +1,28 @@ +dnl gettext setup + +dnl AG_GST_GETTEXT([gettext-package]) +dnl defines GETTEXT_PACKAGE and LOCALEDIR + +AC_DEFUN([AG_GST_GETTEXT], +[ + if test "$USE_NLS" = "yes"; then + GETTEXT_PACKAGE=[$1] + else + GETTEXT_PACKAGE=[NULL] + fi + AC_SUBST(GETTEXT_PACKAGE) + AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", + [gettext package name]) + + dnl make sure po/Makevars is kept in sync with GETTEXT_PACKAGE + if test -e "${srcdir}/po/Makevars"; then + if ! grep -e "$1" "${srcdir}/po/Makevars"; then + AC_MSG_ERROR([DOMAIN in po/Makevars does not match GETTEXT_PACKAGE $1]) + fi + fi + + dnl define LOCALEDIR in config.h + AS_AC_EXPAND(LOCALEDIR, $datadir/locale) + AC_DEFINE_UNQUOTED([LOCALEDIR], "$LOCALEDIR", + [gettext locale dir]) +]) diff --git a/common/m4/gst-glib2.m4 b/common/m4/gst-glib2.m4 new file mode 100644 index 0000000..63f0f46 --- /dev/null +++ b/common/m4/gst-glib2.m4 @@ -0,0 +1,126 @@ +dnl check for a minimum version of GLib + +dnl AG_GST_GLIB_CHECK([minimum-version-required]) + +AC_DEFUN([AG_GST_GLIB_CHECK], +[ + AC_REQUIRE([AS_NANO]) + + dnl Minimum required version of GLib + GLIB_REQ=[$1] + if test "x$GLIB_REQ" = "x" + then + AC_MSG_ERROR([Please specify a required version for GLib 2.0]) + fi + AC_SUBST(GLIB_REQ) + + dnl Check for glib with everything + AG_GST_PKG_CHECK_MODULES(GLIB, + glib-2.0 >= $GLIB_REQ gobject-2.0 gmodule-no-export-2.0) + + if test "x$HAVE_GLIB" = "xno"; then + AC_MSG_ERROR([This package requires GLib >= $GLIB_REQ to compile.]) + fi + + dnl Add define to tell GLib that threading is always enabled within GStreamer + dnl code (optimisation, bypasses checks if the threading system is enabled + dnl when using threading primitives) + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_THREADS_MANDATORY" + + dnl Define G_DISABLE_DEPRECATED for development versions + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_DEPRECATED" + fi + + AC_ARG_ENABLE(gobject-cast-checks, + AS_HELP_STRING([--enable-gobject-cast-checks[=@<:@no/auto/yes@:>@]], + [Enable GObject cast checks]),[enable_gobject_cast_checks=$enableval], + [enable_gobject_cast_checks=auto]) + + if test "x$enable_gobject_cast_checks" = "xauto"; then + dnl Turn on cast checks only for development versions + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + enable_gobject_cast_checks=yes + else + enable_gobject_cast_checks=no + fi + fi + + if test "x$enable_gobject_cast_checks" = "xno"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_CAST_CHECKS" + fi + + AC_ARG_ENABLE(glib-asserts, + AS_HELP_STRING([--enable-glib-asserts[=@<:@no/auto/yes@:>@]], + [Enable GLib assertion]),[enable_glib_assertions=$enableval], + [enable_glib_assertions=auto]) + + if test "x$enable_glib_assertions" = "xauto"; then + dnl Enable assertions only for development versions + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + enable_glib_assertions=yes + else + enable_glib_assertions=no + fi + fi + + if test "x$enable_glib_assertions" = "xno"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_ASSERT" + fi + + dnl Find location of glib utils. People may want to or have to override these, + dnl e.g. in a cross-compile situation where PATH is a bit messed up. We need + dnl for these tools to work on the host, so can't just use the one from the + dnl GLib installation that pkg-config picks up, as that might be for a + dnl different target architecture. + dnl + dnl glib-genmarshal: + AC_MSG_CHECKING(for glib-genmarshal) + if test "x$GLIB_GENMARSHAL" != "x"; then + AC_MSG_RESULT([$GLIB_GENMARSHAL (from environment)]) + else + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + if $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then + AC_MSG_RESULT([$GLIB_GENMARSHAL (from pkg-config path)]) + else + AC_PATH_PROG(GLIB_GENMARSHAL, [glib-genmarshal], [glib-genmarshal]) + AC_MSG_RESULT([$GLIB_GENMARSHAL]) + fi + fi + if ! $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then + AC_MSG_WARN([$GLIB_GENMARSHAL does not seem to work!]) + fi + AC_SUBST(GLIB_GENMARSHAL) + + dnl glib-mkenums: + AC_MSG_CHECKING(for glib-mkenums) + if test "x$GLIB_MKENUMS" != "x"; then + AC_MSG_RESULT([$GLIB_MKENUMS (from environment)]) + else + dnl glib-mkenums is written in perl so should always work really + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + AC_MSG_RESULT([$GLIB_MKENUMS]) + fi + if ! $GLIB_MKENUMS --version 2>/dev/null >/dev/null; then + AC_MSG_WARN([$GLIB_MKENUMS does not seem to work!]) + fi + AC_SUBST(GLIB_MKENUMS) + + AC_SUBST(GLIB_EXTRA_CFLAGS) + + dnl Now check for GIO + PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQ) + if test "x$HAVE_GIO" = "xno"; then + AC_MSG_ERROR([This package requires GIO >= $GLIB_REQ to compile.]) + fi + + GIO_MODULE_DIR="`$PKG_CONFIG --variable=giomoduledir gio-2.0`" + AC_DEFINE_UNQUOTED(GIO_MODULE_DIR, "$GIO_MODULE_DIR", + [The GIO modules directory.]) + GIO_LIBDIR="`$PKG_CONFIG --variable=libdir gio-2.0`" + AC_DEFINE_UNQUOTED(GIO_LIBDIR, "$GIO_LIBDIR", + [The GIO library directory.]) + AC_SUBST(GIO_CFLAGS) + AC_SUBST(GIO_LIBS) + AC_SUBST(GIO_LDFLAGS) +]) diff --git a/common/m4/gst-libxml2.m4 b/common/m4/gst-libxml2.m4 new file mode 100644 index 0000000..4a843f0 --- /dev/null +++ b/common/m4/gst-libxml2.m4 @@ -0,0 +1,52 @@ +dnl call this macro with the minimum required version as an argument +dnl this macro sets and AC_SUBSTs XML_CFLAGS and XML_LIBS +dnl it also sets LIBXML_PKG, used for the pkg-config file + +AC_DEFUN([AG_GST_LIBXML2_CHECK], +[ + dnl Minimum required version of libxml2 + dnl default to 2.4.9 if not specified + LIBXML2_REQ=ifelse([$1],,2.4.9,[$1]) + AC_SUBST(LIBXML2_REQ) + + dnl check for libxml2 + PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, + HAVE_LIBXML2=yes, [ + AC_MSG_RESULT(no) + HAVE_LIBXML2=no + ]) + if test "x$HAVE_LIBXML2" = "xyes"; then + AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available]) + else + AC_MSG_ERROR([ + Need libxml2 and development headers/files to build GStreamer. + + You can do without libxml2 if you pass --disable-loadsave to + configure, but that breaks ABI, so don't do that unless you + are building for an embedded setup and know what you are doing. + ]) + fi + dnl this is for the .pc file + LIBXML_PKG=', libxml-2.0' + AC_SUBST(LIBXML_PKG) + AC_SUBST(XML_LIBS) + AC_SUBST(XML_CFLAGS) + + dnl XML_LIBS might pull in -lz without zlib actually being on the system, so + dnl try linking with these LIBS and CFLAGS + ac_save_CFLAGS=$CFLAGS + ac_save_LIBS=$LIBS + CFLAGS="$CFLAGS $XML_CFLAGS" + LIBS="$LIBS $XML_LIBS" + AC_TRY_LINK([ +#include +#include +],[ +/* function body */ +], + AC_MSG_NOTICE([Test xml2 program linked]), + AC_MSG_ERROR([Could not link libxml2 test program. Check if you have the necessary dependencies.]) + ) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" +]) diff --git a/common/m4/gst-package-release-datetime.m4 b/common/m4/gst-package-release-datetime.m4 new file mode 100644 index 0000000..bc885e3 --- /dev/null +++ b/common/m4/gst-package-release-datetime.m4 @@ -0,0 +1,89 @@ +dnl macros to set GST_PACKAGE_RELEASE_DATETIME + +dnl =========================================================================== +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME +dnl +dnl Usage: +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME() +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no]...) +dnl sets the release datetime to the current date +dnl (no = this is not a release, but git or prerelease) +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([YYYY-MM-DD]) +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [YYYY-MM-DD]) +dnl sets the release datetime to the specified date (and time, if given) +dnl (yes = this is a release, not git or prerelease) +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [DOAP-FILE], [RELEASE-VERSION]) +dnl sets the release date to the release date associated with version +dnl RELEASE-VERSION in the .doap file DOAP-FILE +dnl (yes = this is a release, not git or prerelease) +dnl +dnl We need to treat pre-releases like git because there won't be an entry +dnl in the .doap file for pre-releases yet, and we don't want to use the +dnl date of the last release either. +dnl =========================================================================== +AC_DEFUN([AG_GST_SET_PACKAGE_RELEASE_DATETIME], +[ + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME() + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes]...) + if test "x$1" = "xno" -o "x$1" = "x"; then + GST_PACKAGE_RELEASE_DATETIME=`date -u "+%Y-%m-%dT%H:%MZ"` + elif test "x$1" = "xyes"; then + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no], ["YYYY-MM-DD"]) + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no], [DOAP-FILE], [RELEASE-VERSION]) + if ( echo $1 | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=$1 + else + dnl we assume the .doap file contains the date as YYYY-MM-DD + YYYY_MM_DD=`sh "${srcdir}/common/extract-release-date-from-doap-file" $3 $2`; + if test "x$YYYY_MM_DD" != "x"; then + GST_PACKAGE_RELEASE_DATETIME=$YYYY_MM_DD + else + AC_MSG_ERROR([SET_PACKAGE_RELEASE_DATETIME: could not extract + release date for release version $3 from $2]) + GST_PACKAGE_RELEASE_DATETIME="" + fi + fi + dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([YYYY-MM-DD]) + elif ( echo $1 | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=$1 + else + AC_MSG_WARN([SET_PACKAGE_RELEASE_DATETIME: invalid first argument]) + GST_PACKAGE_RELEASE_DATETIME="" + fi + + if test "x$GST_PACKAGE_RELEASE_DATETIME" = "x"; then + AC_MSG_WARN([Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME]) + else + AC_MSG_NOTICE([Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME]) + + AC_DEFINE_UNQUOTED([GST_PACKAGE_RELEASE_DATETIME], + ["$GST_PACKAGE_RELEASE_DATETIME"], + [GStreamer package release date/time for plugins as YYYY-MM-DD]) + fi +]) + +dnl =========================================================================== +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO +dnl +dnl Usage: +dnl +dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([NANO-VERSION], [DOAP-FILE], [RELEASE-VERSION]) +dnl if NANO-VERSION is 0, sets the release date to the release date associated +dnl with version RELEASE-VERSION in the .doap file DOAP-FILE, otherwise sets +dnl the release date and time to the current date/time. +dnl +dnl We need to treat pre-releases like git because there won't be an entry +dnl in the .doap file for pre-releases yet, and we don't want to use the +dnl date of the last release either. +dnl =========================================================================== +AC_DEFUN([AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO], +[ + if test "x$1" = "x0"; then + AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [ $2 ], [ $3 ]) + else + AG_GST_SET_PACKAGE_RELEASE_DATETIME([no]) + fi +]) diff --git a/common/m4/gst-parser.m4 b/common/m4/gst-parser.m4 new file mode 100644 index 0000000..b002047 --- /dev/null +++ b/common/m4/gst-parser.m4 @@ -0,0 +1,55 @@ +AC_DEFUN([AG_GST_BISON_CHECK], +[ + dnl FIXME: check if AC_PROG_YACC is suitable here + dnl FIXME: make precious + AC_PATH_PROG(BISON_PATH, bison, no) + if test x$BISON_PATH = xno; then + AC_MSG_ERROR(Could not find bison) + fi + + dnl check bison version + dnl we need version >= 2.4 for the '<>' support + dnl in the parser. + dnl First lines observed: 'bison (GNU Bison) 2.3' or 'GNU Bison version 1.28' + bison_min_version=2.4 + bison_version=`$BISON_PATH --version | head -n 1 | sed 's/^[[^0-9]]*//' | sed 's/[[^0-9]]*$//' | cut -d' ' -f1` + AC_MSG_CHECKING([bison version $bison_version >= $bison_min_version]) + + if perl -we "exit ((v$bison_version ge v$bison_min_version) ? 0 : 1)"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([no]) + fi +]) + +AC_DEFUN([AG_GST_FLEX_CHECK], +[ + dnl we require flex for building the parser + AC_PATH_PROG(FLEX_PATH, flex, no) + if test x$FLEX_PATH = xno; then + AC_MSG_ERROR(Could not find flex) + fi + + dnl check flex version + dnl we need version >= 2.5.31 for the reentrancy support + dnl in the parser. + flex_min_version=2.5.31 + flex_version=`$FLEX_PATH --version | head -n 1 | awk '{print $2}'` + AC_MSG_CHECKING([flex version $flex_version >= $flex_min_version]) + if perl -w < \$min_version_major) || + ((\$flex_version_major == \$min_version_major) && + (\$flex_version_minor > \$min_version_minor)) || + ((\$flex_version_major == \$min_version_major) && + (\$flex_version_minor == \$min_version_minor) && + (\$flex_version_micro >= \$min_version_micro))) + ? 0 : 1); +EOF + then + AC_MSG_RESULT(yes) + else + AC_MSG_ERROR([no]) + fi +]) diff --git a/common/m4/gst-platform.m4 b/common/m4/gst-platform.m4 new file mode 100644 index 0000000..40d6faf --- /dev/null +++ b/common/m4/gst-platform.m4 @@ -0,0 +1,67 @@ +dnl AG_GST_PLATFORM +dnl Check for platform specific features and define some variables +dnl +dnl GST_EXTRA_MODULE_SUFFIX: contains a platform specific +dnl extra module suffix additional to G_MODULE_SUFFIX +dnl +dnl HAVE_OSX: Defined if compiling for OS X +dnl +dnl GST_HAVE_UNSAFE_FORK: Defined if fork is unsafe (Windows) +dnl +dnl HAVE_WIN32: Defined if compiling on Win32 +dnl + +AC_DEFUN([AG_GST_PLATFORM], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + + case $host_os in + rhapsody*) + AC_DEFINE_UNQUOTED(GST_EXTRA_MODULE_SUFFIX, [".dylib"], [Extra platform specific plugin suffix]) + ;; + darwin*) + AC_DEFINE_UNQUOTED(GST_EXTRA_MODULE_SUFFIX, [".dylib"], [Extra platform specific plugin suffix]) + AC_DEFINE_UNQUOTED(HAVE_OSX, 1, [Defined if compiling for OSX]) + ;; + cygwin*) + AC_DEFINE_UNQUOTED(GST_HAVE_UNSAFE_FORK, 1, [Defined when registry scanning through fork is unsafe]) + ;; + mingw* | msvc* | mks*) + dnl HAVE_WIN32 currently means "disable POSIXisms". + AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows]) + + dnl define __MSVCRT_VERSION__ version if not set already by the + dnl compiler (ie. mostly for mingw). This is needed for things like + dnl __stat64 to be available. If set by the compiler, ensure it's + dnl new enough - we need at least WinXP SP2. + AC_TRY_COMPILE([ ], [ return __MSVCRT_VERSION__; ], [ + AC_TRY_COMPILE([ ], [ + #if __MSVCRT_VERSION__ < 0x0601 + #error "MSVCRT too old" + #endif + ], [ + AC_MSG_NOTICE([MSVCRT version looks ok]) + ], [ + AC_MSG_ERROR([MSVCRT version too old, need at least WinXP SP2]) + ]) + ], [ + AC_MSG_NOTICE([Setting MSVCRT version to 0x0601]) + AC_DEFINE_UNQUOTED(__MSVCRT_VERSION__, 0x0601, [We need at least WinXP SP2 for __stat64]) + ]) + ;; + *) + ;; + esac +]) + +AC_DEFUN([AG_GST_LIBTOOL_PREPARE], +[ + dnl Persuade libtool to also link (-l) a 'pure' (DirectX) static lib, + dnl i.e. as opposed to only import lib with dll counterpart. + dnl Needs to be tweaked before libtool's checks. + case $host_os in + cygwin* | mingw*) + lt_cv_deplibs_check_method=pass_all + ;; + esac +]) \ No newline at end of file diff --git a/common/m4/gst-plugin-docs.m4 b/common/m4/gst-plugin-docs.m4 new file mode 100644 index 0000000..0e2ab6e --- /dev/null +++ b/common/m4/gst-plugin-docs.m4 @@ -0,0 +1,25 @@ +dnl AG_GST_PLUGIN_DOCS([MINIMUM-GTK-DOC-VERSION]) +dnl +dnl checks for prerequisites for the common/mangle-tmpl.py script +dnl used when building the plugin documentation + +AC_DEFUN([AG_GST_PLUGIN_DOCS], +[ + AC_BEFORE([GTK_DOC_CHECK],[$0])dnl check for gtk-doc first + AC_REQUIRE([AM_PATH_PYTHON])dnl find python first + + build_plugin_docs=no + AC_MSG_CHECKING([whether to build plugin documentation]) + if test x$enable_gtk_doc = xyes; then + if test x$PYTHON != x; then + build_plugin_docs=yes + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no (python not found)]) + fi + else + AC_MSG_RESULT([no (gtk-doc disabled or not available)]) + fi + + AM_CONDITIONAL(ENABLE_PLUGIN_DOCS, test x$build_plugin_docs = xyes) +]) diff --git a/common/m4/gst-plugindir.m4 b/common/m4/gst-plugindir.m4 new file mode 100644 index 0000000..c9e1301 --- /dev/null +++ b/common/m4/gst-plugindir.m4 @@ -0,0 +1,17 @@ +dnl AG_GST_SET_PLUGINDIR + +dnl AC_DEFINE PLUGINDIR to the full location where plug-ins will be installed +dnl AC_SUBST plugindir, to be used in Makefile.am's + +AC_DEFUN([AG_GST_SET_PLUGINDIR], +[ + dnl define location of plugin directory + AS_AC_EXPAND(PLUGINDIR, ${libdir}/gstreamer-$GST_API_VERSION) + AC_DEFINE_UNQUOTED(PLUGINDIR, "$PLUGINDIR", + [directory where plugins are located]) + AC_MSG_NOTICE([Using $PLUGINDIR as the plugin install location]) + + dnl plugin directory configure-time variable for use in Makefile.am + plugindir="\$(libdir)/gstreamer-$GST_API_VERSION" + AC_SUBST(plugindir) +]) diff --git a/common/m4/gst-valgrind.m4 b/common/m4/gst-valgrind.m4 new file mode 100644 index 0000000..5c0d608 --- /dev/null +++ b/common/m4/gst-valgrind.m4 @@ -0,0 +1,35 @@ +AC_DEFUN([AG_GST_VALGRIND_CHECK], +[ + dnl valgrind inclusion + AC_ARG_ENABLE(valgrind, + AC_HELP_STRING([--disable-valgrind], [disable run-time valgrind detection]), + [ + case "${enableval}" in + yes) USE_VALGRIND="$USE_DEBUG" ;; + no) USE_VALGRIND=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;; + esac], + [ + USE_VALGRIND="$USE_DEBUG" + ]) dnl Default value + + VALGRIND_REQ="3.0" + if test "x$USE_VALGRIND" = xyes; then + PKG_CHECK_MODULES(VALGRIND, valgrind >= $VALGRIND_REQ, + USE_VALGRIND="yes", + [ + USE_VALGRIND="no" + AC_MSG_RESULT([no]) + ]) + fi + + if test "x$USE_VALGRIND" = xyes; then + AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used]) + AC_MSG_NOTICE(Using extra code paths for valgrind) + fi + AC_SUBST(VALGRIND_CFLAGS) + AC_SUBST(VALGRIND_LIBS) + + AC_PATH_PROG(VALGRIND_PATH, valgrind, no) + AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno") +]) diff --git a/common/m4/gst-x11.m4 b/common/m4/gst-x11.m4 new file mode 100644 index 0000000..d3baf2d --- /dev/null +++ b/common/m4/gst-x11.m4 @@ -0,0 +1,70 @@ +dnl macros for X-related detections +dnl AC_SUBST's HAVE_X, X_CFLAGS, X_LIBS +AC_DEFUN([AG_GST_CHECK_X], +[ + AC_PATH_XTRA + ac_cflags_save="$CFLAGS" + ac_cppflags_save="$CPPFLAGS" + CFLAGS="$CFLAGS $X_CFLAGS" + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + dnl now try to find the HEADER + AC_CHECK_HEADER(X11/Xlib.h, HAVE_X="yes", HAVE_X="no") + + if test "x$HAVE_X" = "xno" + then + AC_MSG_NOTICE([cannot find X11 development files]) + else + dnl this is much more than we want + X_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS" + dnl AC_PATH_XTRA only defines the path needed to find the X libs, + dnl it does not add the libs; therefore we add them here + X_LIBS="$X_LIBS -lX11" + AC_SUBST(X_CFLAGS) + AC_SUBST(X_LIBS) + fi + AC_SUBST(HAVE_X) + + CFLAGS="$ac_cflags_save" + CPPFLAGS="$ac_cppflags_save" +]) + +dnl *** XVideo *** +dnl Look for the PIC library first, Debian requires it. +dnl Check debian-devel archives for gory details. +dnl 20020110: +dnl At the moment XFree86 doesn't distribute shared libXv due +dnl to unstable API. On many platforms you CAN NOT link a shared +dnl lib to a static non-PIC lib. This is what the xvideo GStreamer +dnl plug-in wants to do. So Debian distributes a PIC compiled +dnl version of the static lib for plug-ins to link to when it is +dnl inappropriate to link the main application to libXv directly. +dnl FIXME: add check if this platform can support linking to a +dnl non-PIC libXv, if not then don not use Xv. +dnl FIXME: perhaps warn user if they have a shared libXv since +dnl this is an error until XFree86 starts shipping one +AC_DEFUN([AG_GST_CHECK_XV], +[ + if test x$HAVE_X = xyes; then + AC_CHECK_LIB(Xv_pic, XvQueryExtension, + HAVE_XVIDEO="yes", HAVE_XVIDEO="no", + $X_LIBS -lXext) + + if test x$HAVE_XVIDEO = xyes; then + XVIDEO_LIBS="-lXv_pic -lXext" + AC_SUBST(XVIDEO_LIBS) + else + dnl try again using something else if we didn't find it first + if test x$HAVE_XVIDEO = xno; then + AC_CHECK_LIB(Xv, XvQueryExtension, + HAVE_XVIDEO="yes", HAVE_XVIDEO="no", + $X_LIBS -lXext) + + if test x$HAVE_XVIDEO = xyes; then + XVIDEO_LIBS="-lXv -lXext" + AC_SUBST(XVIDEO_LIBS) + fi + fi + fi + fi +]) diff --git a/common/m4/gst.m4 b/common/m4/gst.m4 new file mode 100644 index 0000000..d4c53cb --- /dev/null +++ b/common/m4/gst.m4 @@ -0,0 +1,36 @@ +dnl AG_GST_INIT +dnl sets up use of GStreamer configure.ac macros +dnl all GStreamer autoconf macros are prefixed +dnl with AG_GST_ for public macros +dnl with _AG_GST_ for private macros +dnl +dnl We call AC_CANONICAL_TARGET and AC_CANONICAL_HOST so that +dnl it is valid before AC_ARG_PROGRAM is called + +AC_DEFUN([AG_GST_INIT], +[ + m4_pattern_forbid(^_?AG_GST_) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use host_ variables + AC_REQUIRE([AC_CANONICAL_TARGET]) dnl we use target_ variables +]) + +dnl AG_GST_PKG_CONFIG_PATH +dnl +dnl sets up a GST_PKG_CONFIG_PATH variable for use in Makefile.am +dnl which contains the path of the in-tree pkgconfig directory first +dnl and then any paths specified in PKG_CONFIG_PATH. +dnl +dnl We do this mostly so we don't have to use unportable shell constructs +dnl such as ${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} in Makefile.am to handle +dnl the case where the environment variable is not set, but also in order +dnl to avoid a trailing ':' in the PKG_CONFIG_PATH which apparently causes +dnl problems with pkg-config on windows with msys/mingw. +AC_DEFUN([AG_GST_PKG_CONFIG_PATH], +[ + GST_PKG_CONFIG_PATH="\$(top_builddir)/pkgconfig" + if test "x$PKG_CONFIG_PATH" != "x"; then + GST_PKG_CONFIG_PATH="$GST_PKG_CONFIG_PATH:$PKG_CONFIG_PATH" + fi + AC_SUBST([GST_PKG_CONFIG_PATH]) + AC_MSG_NOTICE([Using GST_PKG_CONFIG_PATH = $GST_PKG_CONFIG_PATH]) +]) diff --git a/common/m4/gtk-doc.m4 b/common/m4/gtk-doc.m4 new file mode 100644 index 0000000..b243f1c --- /dev/null +++ b/common/m4/gtk-doc.m4 @@ -0,0 +1,70 @@ +dnl -*- mode: autoconf -*- + +# serial 1 + +dnl Usage: +dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) +AC_DEFUN([GTK_DOC_CHECK], +[ + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + + dnl check for tools we added during development + AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) + AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) + AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) + + dnl for overriding the documentation installation directory + AC_ARG_WITH([html-dir], + AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, + [with_html_dir='${datadir}/gtk-doc/html']) + HTML_DIR="$with_html_dir" + AC_SUBST([HTML_DIR]) + + dnl enable/disable documentation building + AC_ARG_ENABLE([gtk-doc], + AS_HELP_STRING([--enable-gtk-doc], + [use gtk-doc to build documentation [[default=no]]]),, + [enable_gtk_doc=no]) + + if test x$enable_gtk_doc = xyes; then + ifelse([$1],[], + [PKG_CHECK_EXISTS([gtk-doc],, + AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], + [PKG_CHECK_EXISTS([gtk-doc >= $1],, + AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) + dnl don't check for glib if we build glib + if test "x$PACKAGE_NAME" != "xglib"; then + dnl don't fail if someone does not have glib + PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,) + fi + dnl don't rely on sed being pulled in implicitly. Fixes Solaris build. + if test -z "$SED"; then + AC_PROG_SED + fi + fi + + AC_MSG_CHECKING([whether to build gtk-doc documentation]) + AC_MSG_RESULT($enable_gtk_doc) + + dnl enable/disable output formats + AC_ARG_ENABLE([gtk-doc-html], + AS_HELP_STRING([--enable-gtk-doc-html], + [build documentation in html format [[default=yes]]]),, + [enable_gtk_doc_html=yes]) + AC_ARG_ENABLE([gtk-doc-pdf], + AS_HELP_STRING([--enable-gtk-doc-pdf], + [build documentation in pdf format [[default=no]]]),, + [enable_gtk_doc_pdf=no]) + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + + AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) + AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) +]) diff --git a/common/m4/introspection.m4 b/common/m4/introspection.m4 new file mode 100644 index 0000000..589721c --- /dev/null +++ b/common/m4/introspection.m4 @@ -0,0 +1,94 @@ +dnl -*- mode: autoconf -*- +dnl Copyright 2009 Johan Dahlin +dnl +dnl This file is free software; the author(s) gives unlimited +dnl permission to copy and/or distribute it, with or without +dnl modifications, as long as this notice is preserved. +dnl + +# serial 1 + +m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], +[ + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([LT_INIT],[$0])dnl setup libtool first + + dnl enable/disable introspection + m4_if([$2], [require], + [dnl + enable_introspection=yes + ],[dnl + AC_ARG_ENABLE(introspection, + AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]], + [Enable introspection for this build]),, + [enable_introspection=auto]) + ])dnl + + AC_MSG_CHECKING([for gobject-introspection]) + + dnl presence/version checking + AS_CASE([$enable_introspection], + [no], [dnl + found_introspection="no (disabled, use --enable-introspection to enable)" + ],dnl + [yes],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0],, + AC_MSG_ERROR([gobject-introspection-1.0 is not installed])) + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], + found_introspection=yes, + AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME])) + ],dnl + [auto],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) + ],dnl + [dnl + AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) + ])dnl + + AC_MSG_RESULT([$found_introspection]) + + INTROSPECTION_SCANNER= + INTROSPECTION_COMPILER= + INTROSPECTION_GENERATE= + INTROSPECTION_GIRDIR= + INTROSPECTION_TYPELIBDIR= + if test "x$found_introspection" = "xyes"; then + INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` + INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` + INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" + INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` + INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` + INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection + fi + AC_SUBST(INTROSPECTION_SCANNER) + AC_SUBST(INTROSPECTION_COMPILER) + AC_SUBST(INTROSPECTION_GENERATE) + AC_SUBST(INTROSPECTION_GIRDIR) + AC_SUBST(INTROSPECTION_TYPELIBDIR) + AC_SUBST(INTROSPECTION_CFLAGS) + AC_SUBST(INTROSPECTION_LIBS) + AC_SUBST(INTROSPECTION_MAKEFILE) + + AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes") +]) + + +dnl Usage: +dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version]) + +AC_DEFUN([GOBJECT_INTROSPECTION_CHECK], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1]) +]) + +dnl Usage: +dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version]) + + +AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require]) +]) diff --git a/common/m4/orc.m4 b/common/m4/orc.m4 new file mode 100644 index 0000000..26b2459 --- /dev/null +++ b/common/m4/orc.m4 @@ -0,0 +1,70 @@ +dnl pkg-config-based checks for Orc + +dnl specific: +dnl ORC_CHECK([REQUIRED_VERSION]) + +AC_DEFUN([ORC_CHECK], +[ + ORC_REQ=ifelse([$1], , "0.4.6", [$1]) + + AC_ARG_ENABLE(orc, + AC_HELP_STRING([--enable-orc],[use Orc if installed]), + [case "${enableval}" in + auto) enable_orc=auto ;; + yes) enable_orc=yes ;; + no) enable_orc=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-orc) ;; + esac + ], + [enable_orc=auto]) dnl Default value + + if test "x$enable_orc" != "xno" ; then + PKG_CHECK_MODULES(ORC, orc-0.4 >= $ORC_REQ, [ + AC_DEFINE(HAVE_ORC, 1, [Use Orc]) + HAVE_ORC=yes + if test "x$ORCC" = "x" ; then + AC_MSG_CHECKING(for usable orcc) + ORCC=`$PKG_CONFIG --variable=orcc orc-0.4` + dnl check whether the orcc found by pkg-config can be run from the build environment + dnl if this is not the case (e.g. when cross-compiling) fall back to orcc from PATH + AS_IF([$ORCC --version 1> /dev/null 2> /dev/null], [], [ORCC=`which orcc`]) + AC_MSG_RESULT($ORCC) + fi + AC_SUBST(ORCC) + ORCC_FLAGS="--compat $ORC_REQ" + AC_SUBST(ORCC_FLAGS) + AS_IF([test "x$ORCC" = "x"], [HAVE_ORCC=no], [HAVE_ORCC=yes]) + ], [ + if test "x$enable_orc" = "xyes" ; then + AC_MSG_ERROR([--enable-orc specified, but Orc >= $ORC_REQ not found]) + fi + AC_DEFINE(DISABLE_ORC, 1, [Disable Orc]) + HAVE_ORC=no + HAVE_ORCC=no + ]) + else + AC_DEFINE(DISABLE_ORC, 1, [Disable Orc]) + HAVE_ORC=no + HAVE_ORCC=no + fi + AM_CONDITIONAL(HAVE_ORC, [test "x$HAVE_ORC" = "xyes"]) + AM_CONDITIONAL(HAVE_ORCC, [test "x$HAVE_ORCC" = "xyes"]) + +])) + +AC_DEFUN([ORC_OUTPUT], +[ + if test "$HAVE_ORC" = yes ; then + printf "configure: *** Orc acceleration enabled.\n" + else + if test "x$enable_orc" = "xno" ; then + printf "configure: *** Orc acceleration disabled by --disable-orc. Slower code paths\n" + printf " will be used.\n" + else + printf "configure: *** Orc acceleration disabled. Requires Orc >= $ORC_REQ, which was\n" + printf " not found. Slower code paths will be used.\n" + fi + fi + printf "\n" +]) + diff --git a/common/m4/pkg.m4 b/common/m4/pkg.m4 new file mode 100644 index 0000000..996e294 --- /dev/null +++ b/common/m4/pkg.m4 @@ -0,0 +1,157 @@ +# 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. + +# 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_default([$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]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# 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 + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $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. + +_PKG_TEXT + +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 diff --git a/common/mangle-tmpl.py b/common/mangle-tmpl.py new file mode 100644 index 0000000..51ea8c2 --- /dev/null +++ b/common/mangle-tmpl.py @@ -0,0 +1,165 @@ +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +""" +use the output from gst-xmlinspect.py to mangle tmpl/*.sgml and +insert/overwrite Short Description and Long Description +""" + +# FIXME: right now it uses pygst and scans on its own; +# we really should use inspect/*.xml instead since the result of +# gst-xmlinspect.py is committed by the docs maintainer, who can be +# expected to have pygst, but this step should be done for every docs build, +# so no pygst allowed + +# read in inspect/*.xml +# for every tmpl/element-(name).xml: mangle with details from element + +from __future__ import print_function, unicode_literals + +import glob +import re +import sys +import os + +class Tmpl: + def __init__(self, filename): + self.filename = filename + self._sectionids = [] + self._sections = {} + + def read(self): + """ + Read and parse the sections from the given file. + """ + lines = open(self.filename).readlines() + matcher = re.compile("\n") + id = None + + for line in lines: + match = matcher.search(line) + if match: + id = match.expand("\\1") + self._sectionids.append(id) + self._sections[id] = [] + else: + if not id: + sys.stderr.write( + "WARNING: line before a SECTION header: %s" % line) + else: + self._sections[id].append(line) + + def get_section(self, id): + """ + Get the content from the given section. + """ + return self._sections[id] + + def set_section(self, id, content): + """ + Replace the given section id with the given content. + """ + self._sections[id] = content + + def output(self): + """ + Return the output of the current template in the tmpl/*.sgml format. + """ + lines = [] + for id in self._sectionids: + lines.append("\n" % id) + for line in self._sections[id]: + lines.append(line) + + return "".join(lines) + + def write(self, backup=False): + """ + Write out the template file again, backing up the previous one. + """ + if backup: + target = self.filename + ".mangle.bak" + os.rename(self.filename, target) + + handle = open(self.filename, "w") + handle.write(self.output()) + handle.close() + +import xml.dom.minidom + +def get_elements(file): + elements = {} + doc = xml.dom.minidom.parse(file) + + elem = None + for e in doc.childNodes: + if e.nodeType == e.ELEMENT_NODE and e.localName == 'plugin': + elem = e + break + if elem == None: + return None + + elem2 = None + for e in elem.childNodes: + if e.nodeType == e.ELEMENT_NODE and e.localName == 'elements': + elem2 = e + break + if elem2 == None: + return None + + elem = elem2 + + for e in elem.childNodes: + if e.nodeType == e.ELEMENT_NODE and e.localName == 'element': + name = None + description = None + + for e2 in e.childNodes: + if e2.nodeType == e2.ELEMENT_NODE and e2.localName == 'name': + name = e2.childNodes[0].nodeValue.encode("UTF-8") + elif e2.nodeType == e2.ELEMENT_NODE and e2.localName == 'description': + if e2.childNodes: + description = e2.childNodes[0].nodeValue.encode("UTF-8") + else: + description = 'No description' + + if name != None and description != None: + elements[name] = {'description': description} + + return elements + +def main(): + if not len(sys.argv) == 3: + sys.stderr.write('Please specify the inspect/ dir and the tmpl/ dir') + sys.exit(1) + + inspectdir = sys.argv[1] + tmpldir = sys.argv[2] + + # parse all .xml files; build map of element name -> short desc + #for file in glob.glob("inspect/plugin-*.xml"): + elements = {} + for file in glob.glob("%s/plugin-*.xml" % inspectdir): + elements.update(get_elements(file)) + + for file in glob.glob("%s/element-*.sgml" % tmpldir): + base = os.path.basename(file) + element = base[len("element-"):-len(".sgml")] + tmpl = Tmpl(file) + tmpl.read() + if element in elements.keys(): + description = elements[element]['description'] + tmpl.set_section("Short_Description", "%s\n\n" % description) + + # put in an include if not yet there + line = '' + \ + '' + \ + '\n' + section = tmpl.get_section("Long_Description") + if not section[0] == line: + section.insert(0, line) + tmpl.set_section("Long_Description", section) + tmpl.write() + +main() diff --git a/common/orc.mak b/common/orc.mak new file mode 100644 index 0000000..a232b5d --- /dev/null +++ b/common/orc.mak @@ -0,0 +1,76 @@ +# +# This is a makefile.am fragment to build Orc code. +# +# Define ORC_SOURCE and then include this file, such as: +# +# ORC_SOURCE=gstadderorc +# include $(top_srcdir)/common/orc.mak +# +# This fragment will create tmp-orc.c and gstadderorc.h from +# gstadderorc.orc. +# +# When 'make dist' is run at the top level, or 'make orc-update' +# in a directory including this fragment, the generated source +# files will be copied to $(ORC_SOURCE)-dist.[ch]. These files +# should be checked in to git, since they are used if Orc is +# disabled. +# +# Note that this file defines BUILT_SOURCES, so any later usage +# of BUILT_SOURCES in the Makefile.am that includes this file +# must use '+='. +# + + +EXTRA_DIST = $(ORC_SOURCE).orc + +ORC_NODIST_SOURCES = tmp-orc.c $(ORC_SOURCE).h +BUILT_SOURCES = tmp-orc.c $(ORC_SOURCE).h + + +orc-update: tmp-orc.c $(ORC_SOURCE).h + $(top_srcdir)/common/gst-indent tmp-orc.c + cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c + cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h + +orcc_v_gen = $(orcc_v_gen_$(V)) +orcc_v_gen_ = $(orcc_v_gen_$(AM_DEFAULT_VERBOSITY)) +orcc_v_gen_0 = @echo " ORCC $@"; + +cp_v_gen = $(cp_v_gen_$(V)) +cp_v_gen_ = $(cp_v_gen_$(AM_DEFAULT_VERBOSITY)) +cp_v_gen_0 = @echo " CP $@"; + +if HAVE_ORCC +tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc + $(orcc_v_gen)$(ORCC) $(ORCC_FLAGS) --implementation --include glib.h -o tmp-orc.c $(srcdir)/$(ORC_SOURCE).orc + +$(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc + $(orcc_v_gen)$(ORCC) $(ORCC_FLAGS) --header --include glib.h -o $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE).orc +else +tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc $(srcdir)/$(ORC_SOURCE)-dist.c + $(cp_v_gen)cp $(srcdir)/$(ORC_SOURCE)-dist.c tmp-orc.c + +$(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc $(srcdir)/$(ORC_SOURCE)-dist.c + $(cp_v_gen)cp $(srcdir)/$(ORC_SOURCE)-dist.h $(ORC_SOURCE).h +endif + +clean-local: clean-orc +.PHONY: clean-orc +clean-orc: + rm -f tmp-orc.c $(ORC_SOURCE).h + +dist-hook: dist-hook-orc +.PHONY: dist-hook-orc + +# we try and copy updated orc -dist files below, but don't fail if it +# doesn't work as the srcdir might not be writable +dist-hook-orc: tmp-orc.c $(ORC_SOURCE).h + $(top_srcdir)/common/gst-indent tmp-orc.c + rm -f tmp-orc.c~ + cmp -s tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c || \ + cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c || true + cmp -s $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h || \ + cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h || true + cp -p tmp-orc.c $(distdir)/$(ORC_SOURCE)-dist.c + cp -p $(ORC_SOURCE).h $(distdir)/$(ORC_SOURCE)-dist.h + diff --git a/common/parallel-subdirs.mak b/common/parallel-subdirs.mak new file mode 100644 index 0000000..36885df --- /dev/null +++ b/common/parallel-subdirs.mak @@ -0,0 +1,13 @@ +# include this at the end of $MODULE/ext/Makefile.am to force make to +# build subdirectories in parallel when make -jN is used. We will end up +# descending into all subdirectories a second time, but only after the first +# (parallel) run has finished, so it should go right through the second time. + +.PHONY: independent-subdirs $(SUBDIRS) + +independent-subdirs: $(SUBDIRS) + +$(SUBDIRS): + $(MAKE) -C $@ + +all-recursive: independent-subdirs diff --git a/common/plugins.xsl b/common/plugins.xsl new file mode 100644 index 0000000..60515b6 --- /dev/null +++ b/common/plugins.xsl @@ -0,0 +1,209 @@ + + + + + + + + + + + + -plugins- + + + + + + + + + + + + + + Element Information + + + + + plugin + + + + plugin- + + + + + + + + author + + + + + + + class + + + + + + + + + + Element Pads + + + + + name + + + + + + + direction + + + + + + + presence + + + + + + + + + details + + + + + + + + + + + + + + + + + + + + + -plugins-plugin- + + + + + + 3 + FIXME Library + + + + + + + + + + plugin- + + + + + + + Plugin Information + + + + filename + + + + + + + version + + + + + + + run-time license + + + + + + + package + + + + + + + origin + + + + + + + + + + + + + + + + + + + + + + + Elements + + + + + + + + + + + + + + diff --git a/common/po.mak b/common/po.mak new file mode 100644 index 0000000..e019fac --- /dev/null +++ b/common/po.mak @@ -0,0 +1,4 @@ +# rule to download the latest .po files +download-po: $(top_srcdir)/common/download-translations + $(top_srcdir)/common/download-translations $(PACKAGE) + diff --git a/common/release.mak b/common/release.mak new file mode 100644 index 0000000..715657b --- /dev/null +++ b/common/release.mak @@ -0,0 +1,34 @@ +# include this snippet to add a common release: target by using +# include $(top_srcdir)/common/release.mak + +release: dist + @$(MAKE) $(PACKAGE)-$(VERSION).tar.xz.sha256sum + @echo + @echo "=================================================================================================" + @echo "http://gstreamer.freedesktop.org/src/$(PACKAGE)/$(PACKAGE)-$(VERSION).tar.xz" + @cat $(PACKAGE)-$(VERSION).tar.xz.sha256sum + @echo "=================================================================================================" + @if [ -d ~/releases/ ]; then \ + cp -v $(PACKAGE)-$(VERSION).tar.xz ~/releases/; \ + fi + @if [ -d ../www/data/src ]; then \ + mv -v $(PACKAGE)-$(VERSION).tar.xz ../www/data/src/$(PACKAGE)/ ; \ + mv -v $(PACKAGE)-$(VERSION).tar.xz.sha256sum ../www/data/src/$(PACKAGE)/ ; \ + fi + @echo "=================================================================================================" + +# generate sha256 sum files +%.sha256sum: % + @sha256sum $< > $@ + +# check that no marshal or enumtypes files are included +# this in turn ensures that distcheck fails for missing .list files which is currently +# shadowed when the corresponding .c and .h files are included. +distcheck-hook: + @test "x" = "x`find $(distdir) -name \*-enumtypes.[ch] | grep -v win32`" && \ + test "x" = "x`find $(distdir) -name \*-marshal.[ch]`" || \ + ( echo "*** Leftover enumtypes or marshal files in the tarball." && \ + echo "*** Make sure the following files are not disted:" && \ + find $(distdir) -name \*-enumtypes.[ch] | grep -v win32 && \ + find $(distdir) -name \*-marshal.[ch] && \ + false ) diff --git a/common/scangobj-merge.py b/common/scangobj-merge.py new file mode 100755 index 0000000..4a9f1fc --- /dev/null +++ b/common/scangobj-merge.py @@ -0,0 +1,311 @@ +#!/usr/bin/python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +""" +parse, merge and write gstdoc-scanobj files +""" + +from __future__ import print_function, unicode_literals + +import sys +import os + +def debug(*args): + pass + +# OrderedDict class based on +# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747 +# Licensed under the Python License +class OrderedDict(dict): + def __init__(self): + self._keys = [] + dict.__init__(self) + + def __delitem__(self, key): + dict.__delitem__(self, key) + self._keys.remove(key) + + def __setitem__(self, key, item): + dict.__setitem__(self, key, item) + if key not in self._keys: self._keys.append(key) + + def clear(self): + dict.clear(self) + self._keys = [] + + def copy(self): + dict = dict.copy(self) + dict._keys = self._keys[:] + return dict + + def items(self): + return zip(self._keys, self.values()) + + def keys(self): + return self._keys + + def popitem(self): + try: + key = self._keys[-1] + except IndexError: + raise KeyError('dictionary is empty') + + val = self[key] + del self[key] + + return (key, val) + + def setdefault(self, key, failobj = None): + dict.setdefault(self, key, failobj) + if key not in self._keys: self._keys.append(key) + + def update(self, dict): + dict.update(self, dict) + for key in dict.keys(): + if key not in self._keys: self._keys.append(key) + + def values(self): + return map(self.get, self._keys) + +class Object: + def __init__(self, name): + self._signals = OrderedDict() + self._args = OrderedDict() + self.name = name + + def __repr__(self): + return "" % self.name + + def add_signal(self, signal, overwrite=True): + if not overwrite and signal.name in self._signals: + raise IndexError("signal %s already in %r" % (signal.name, self)) + self._signals[signal.name] = signal + + def add_arg(self, arg, overwrite=True): + if not overwrite and arg.name in self._args: + raise IndexError("arg %s already in %r" % (arg.name, self)) + self._args[arg.name] = arg + +class Docable: + def __init__(self, **kwargs): + for key in self.attrs: + setattr(self, key, kwargs[key]) + self.dict = kwargs + + def __repr__(self): + return "<%r %s>" % (str(self.__class__), self.name) + +class Signal(Docable): + attrs = ['name', 'returns', 'args'] + +class Arg(Docable): + attrs = ['name', 'type', 'range', 'flags', 'nick', 'blurb', 'default'] + +class GDoc: + def load_file(self, filename): + try: + lines = open(filename).readlines() + self.load_data("".join(lines)) + except IOError: + print ("WARNING - could not read from %s" % filename) + + def save_file(self, filename, backup=False): + """ + Save the information to the given file if the file content changed. + """ + olddata = None + try: + lines = open(filename).readlines() + olddata = "".join(lines) + except IOError: + print ("WARNING - could not read from %s" % filename) + newdata = self.get_data() + if olddata and olddata == newdata: + return + + if olddata: + if backup: + os.rename(filename, filename + '.bak') + + handle = open(filename, "w") + handle.write(newdata) + handle.close() + +class Signals(GDoc): + def __init__(self): + self._objects = OrderedDict() + + def load_data(self, data): + """ + Load the .signals lines, creating our list of objects and signals. + """ + import re + smatcher = re.compile( + '(?s)' # make . match \n + '\n(.*?)\n' + ) + nmatcher = re.compile( + '' + '(?P\S*)' # store object + '::' + '(?P\S*)' # store signal + '' + ) + rmatcher = re.compile( + '(?s)' # make . match \n + '(?P\S*)\n' # store returns + '(?P.*)' # store args + ) + for block in smatcher.findall(data): + nmatch = nmatcher.search(block) + if nmatch: + o = nmatch.group('object') + debug("Found object", o) + debug("Found signal", nmatch.group('signal')) + if o not in self._objects: + object = Object(o) + self._objects[o] = object + + rmatch = rmatcher.search(block) + if rmatch: + dict = rmatch.groupdict().copy() + dict['name'] = nmatch.group('signal') + signal = Signal(**dict) + self._objects[o].add_signal(signal) + + def get_data(self): + lines = [] + for o in self._objects.values(): + for s in o._signals.values(): + block = """ +%(object)s::%(name)s +%(returns)s +%(args)s +""" + d = s.dict.copy() + d['object'] = o.name + lines.append(block % d) + + return "\n".join(lines) + '\n' + +class Args(GDoc): + def __init__(self): + self._objects = OrderedDict() + + def load_data(self, data): + """ + Load the .args lines, creating our list of objects and args. + """ + import re + amatcher = re.compile( + '(?s)' # make . match \n + '\n(.*?)\n' + ) + nmatcher = re.compile( + '' + '(?P\S*)' # store object + '::' + '(?P\S*)' # store arg + '' + ) + rmatcher = re.compile( + '(?s)' # make . match \n + '(?P\S*)\n' # store type + '(?P.*?)\n' # store range + '(?P\S*)\n' # store flags + '(?P.*?)\n' # store nick + '(?P.*?)\n' # store blurb + '(?P.*?)\n' # store default + ) + for block in amatcher.findall(data): + nmatch = nmatcher.search(block) + if nmatch: + o = nmatch.group('object') + debug("Found object", o) + debug("Found arg", nmatch.group('arg')) + if o not in self._objects: + object = Object(o) + self._objects[o] = object + + rmatch = rmatcher.search(block) + if rmatch: + dict = rmatch.groupdict().copy() + dict['name'] = nmatch.group('arg') + arg = Arg(**dict) + self._objects[o].add_arg(arg) + else: + print ("ERROR: could not match arg from block %s" % block) + + def get_data(self): + lines = [] + for o in self._objects.values(): + for a in o._args.values(): + block = """ +%(object)s::%(name)s +%(type)s +%(range)s +%(flags)s +%(nick)s +%(blurb)s +%(default)s + +""" + d = a.dict.copy() + d['object'] = o.name + lines.append(block % d) + + return "\n".join(lines) + '\n' + +class SingleLine(GDoc): + def __init__(self): + self._objects = [] + + def load_data(self, data): + """ + Load the .interfaces/.prerequisites lines, merge duplicates + """ + # split data on '\n' + lines = data.splitlines(); + # merge them into self._objects + for line in lines: + if line not in self._objects: + self._objects.append(line) + + def get_data(self): + lines = sorted(self._objects) + return "\n".join(lines) + '\n' + +def main(argv): + modulename = None + try: + modulename = argv[1] + except IndexError: + sys.stderr.write('Please provide a documentation module name\n') + sys.exit(1) + + signals = Signals() + signals.load_file(modulename + '.signals') + signals.load_file(modulename + '.signals.new') + signals.save_file(modulename + '.signals', backup=True) + os.unlink(modulename + '.signals.new') + + args = Args() + args.load_file(modulename + '.args') + args.load_file(modulename + '.args.new') + args.save_file(modulename + '.args', backup=True) + os.unlink(modulename + '.args.new') + + ifaces = SingleLine() + ifaces.load_file(modulename + '.interfaces') + ifaces.load_file(modulename + '.interfaces.new') + ifaces.save_file(modulename + '.interfaces', backup=True) + os.unlink(modulename + '.interfaces.new') + + prereq = SingleLine() + prereq.load_file(modulename + '.prerequisites') + prereq.load_file(modulename + '.prerequisites.new') + prereq.save_file(modulename + '.prerequisites', backup=True) + os.unlink(modulename + '.prerequisites.new') + +main(sys.argv) diff --git a/common/upload-doc.mak b/common/upload-doc.mak new file mode 100644 index 0000000..c1c4945 --- /dev/null +++ b/common/upload-doc.mak @@ -0,0 +1,64 @@ +# this snippet is to be included by both our docbook manuals +# and gtk-doc API references + +# it adds an upload target to each of these dir's Makefiles + +# each Makefile.am should define the following variables: +# - DOC: the base name of the documentation +# (faq, manual, pwg, gstreamer, gstreamer-libs) +# - FORMATS: the formats in which DOC is output +# (html ps pdf) + +# if you want to use it, make sure your $HOME/.ssh/config file contains the +# correct User entry for the Host entry for the DOC_SERVER + +# these variables define the location of the online docs +DOC_SERVER = gstreamer.freedesktop.org +DOC_BASE = /srv/gstreamer.freedesktop.org/www/data/doc +DOC_URL = $(DOC_SERVER):$(DOC_BASE) + +upload: $(FORMATS) + @if echo $(FORMATS) | grep html > /dev/null; then \ + echo "Preparing docs for upload (rebasing cross-references) ..." ; \ + if test x$(builddir) != x$(srcdir); then \ + echo "make upload can only be used if srcdir == builddir"; \ + exit 1; \ + fi; \ + # gtkdoc-rebase sometimes gets confused, so reset everything to \ + # local links before rebasing to online links \ + gtkdoc-rebase --html-dir=$(builddir)/html 2>/dev/null 2>/dev/null ; \ + rebase=`gtkdoc-rebase --verbose --online --html-dir=$(builddir)/html` ; \ + echo "$$rebase" | grep -e "On-*line"; \ + for req in glib gobject gstreamer gstreamer-libs gst-plugins-base-libs; do \ + if ! ( echo "$$rebase" | grep -i -e "On-*line.*/$$req/" ); then \ + echo "===============================================================================" ; \ + echo " Could not determine online location for $$req docs. Cross-referencing will be " ; \ + echo " broken, so not uploading. Make sure the library's gtk-doc documentation is " ; \ + echo " installed somewhere in /usr/share/gtk-doc. " ; \ + echo "===============================================================================" ; \ + exit 1; \ + fi; \ + done; \ + export SRC="$$SRC html"; \ + fi; \ + if echo $(FORMATS) | grep ps > /dev/null; then export SRC="$$SRC $(DOC).ps"; fi; \ + if echo $(FORMATS) | grep pdf > /dev/null; then export SRC="$$SRC $(DOC).pdf"; fi; \ + \ + # upload releases to both X.Y/ and head/ subdirectories \ + export DIR=$(DOC_BASE)/gstreamer/$(PACKAGE_VERSION_MAJOR).$(PACKAGE_VERSION_MINOR)/$(DOC); \ + echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) mkdir -p $$DIR; \ + rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) chmod -R g+w $$DIR; \ + \ + export DIR=$(DOC_BASE)/gstreamer/head/$(DOC); \ + echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) mkdir -p $$DIR; \ + rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) chmod -R g+w $$DIR; \ + \ + if echo $(FORMATS) | grep html > /dev/null; then \ + echo "Un-preparing docs for upload (rebasing cross-references) ..." ; \ + gtkdoc-rebase --html-dir=$(builddir)/html ; \ + fi; \ + echo Done diff --git a/common/win32.mak b/common/win32.mak new file mode 100644 index 0000000..30e347e --- /dev/null +++ b/common/win32.mak @@ -0,0 +1,78 @@ +# various tests to make sure we dist the win32 stuff (for MSVC builds) right + +# the MANIFEST contains all win32 related files that should be disted +win32 = $(shell cat $(top_srcdir)/win32/MANIFEST) + +# wildcard is apparently not portable to other makes, hence the use of find +# these are library .def files with the symbols to export +win32defs = $(shell find $(top_srcdir)/win32/common -name '*.def') + +# wildcard is apparently not portable to other makes, hence the use of find +# these are files that need to be disted with CRLF line endings: +win32crlf = $(shell find $(top_srcdir)/win32 -name '*.dsw' -o -name '*.dsp') + +win32-debug: + @echo; \ + echo win32 = $(win32); \ + echo; \ + echo win32defs = $(win32defs); \ + echo; \ + echo win32crlf = $(win32crlf); \ + echo + +win32-check-crlf: + @echo Checking win32 files for CR LF line endings ...; \ + fail=0 ; \ + for each in $(win32crlf) ; do \ + result=`perl -e 'print grep(/\r\n/,<>)' "$$each" | wc -l`; \ + if test "$$result" = 0 ; then \ + echo $$each must be fixed to have CRLF line endings ; \ + fail=1; \ + fi ; \ + done ; \ + exit $$fail + +# make sure all symbols we export on linux are defined in the win32 .def too +# (don't care about other unixes for now, it's enough if it works on one of +# the linux build bots; we assume .so ) +check-exports: + @fail=0 ; \ + for l in $(win32defs); do \ + libbase=`basename "$$l" ".def"`; \ + libso=`find "$(top_builddir)" -name "$$libbase-@GST_API_VERSION@.so" | grep -v /_build/ | head -n1`; \ + libdef="$(top_srcdir)/win32/common/$$libbase.def"; \ + if test "x$$libso" != "x"; then \ + echo Checking symbols in $$libso; \ + if ! ($(top_srcdir)/common/check-exports $$libdef $$libso) ; then \ + fail=1; \ + fi; \ + fi; \ + done ; \ + if test $$fail != 0; then \ + echo '-----------------------------------------------------------'; \ + echo 'Run this to update the .def files:'; \ + echo 'make update-exports'; \ + echo '-----------------------------------------------------------'; \ + fi; \ + exit $$fail + +update-exports: + make check-exports 2>&1 | patch -p1 + git add win32/common/libgst*.def + git diff --cached -- win32/common/ + echo '^^^--- updated and staged changes above' + +# complain about nonportable printf format strings (%lld, %llu, %zu etc.) +check-nonportable-print-format: + @fail=0 ; \ + loc=`find "$(top_srcdir)" -name '*.c' | xargs grep -n -e '%[0-9]*ll[udx]' -e '%[0-9]*z[udx]'`; \ + if test "x$$loc" != "x"; then \ + echo "Please fix the following print format strings:" ; \ + find "$(top_srcdir)" -name '*.c' | xargs grep -n -e '%[0-9]*ll[udx]' -e '%[0-9]*z[udx]'; \ + fail=1; \ + fi; \ + exit $$fail + +dist-hook: check-exports win32-check-crlf + + diff --git a/compile b/compile new file mode 100755 index 0000000..531136b --- /dev/null +++ b/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# 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, see . + +# 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. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +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 $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + 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 "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# 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 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# 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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..1f5c50c --- /dev/null +++ b/config.guess @@ -0,0 +1,1420 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2014 Free Software Foundation, Inc. + +timestamp='2014-03-23' + +# 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 +# the Free Software Foundation; either version 3 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, see . +# +# 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. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2014 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # 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'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + 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 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + 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 + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + 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 ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + 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 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + 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 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # 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 + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + 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; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????: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 ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + 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 + 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 ;; + *:AIX:*:[4567]) + 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 + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + 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 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + 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 -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + 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 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + 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 ;; + 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 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + 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 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *: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/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + 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 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + 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 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + 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 + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + 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 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/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 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 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; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + 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; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + 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 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*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 ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..8057bad --- /dev/null +++ b/config.h.in @@ -0,0 +1,107 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Default audio sink */ +#undef DEFAULT_AUDIOSINK + +/* Default audio source */ +#undef DEFAULT_AUDIOSRC + +/* Default video sink */ +#undef DEFAULT_VIDEOSINK + +/* Default video source */ +#undef DEFAULT_VIDEOSRC + +/* Default visualizer */ +#undef DEFAULT_VISUALIZER + +/* The GIO library directory. */ +#undef GIO_LIBDIR + +/* The GIO modules directory. */ +#undef GIO_MODULE_DIR + +/* Defined if gcov is enabled to force a rebuild due to config.h changing */ +#undef GST_GCOV_ENABLED + +/* Default errorlevel to use */ +#undef GST_LEVEL_DEFAULT + +/* GStreamer license */ +#undef GST_LICENSE + +/* package name in plugins */ +#undef GST_PACKAGE_NAME + +/* package origin */ +#undef GST_PACKAGE_ORIGIN + +/* GStreamer package release date/time for plugins as YYYY-MM-DD */ +#undef GST_PACKAGE_RELEASE_DATETIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if valgrind should be used */ +#undef HAVE_VALGRIND + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* directory where plugins are located */ +#undef PLUGINDIR + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..d654d03 --- /dev/null +++ b/config.sub @@ -0,0 +1,1794 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2014 Free Software Foundation, Inc. + +timestamp='2014-05-01' + +# 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 +# the Free Software Foundation; either version 3 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, see . +# +# 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. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2014 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -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* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..2b2deac --- /dev/null +++ b/configure @@ -0,0 +1,19508 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for GStreamer RTSP Server Library 1.4.1. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='GStreamer RTSP Server Library' +PACKAGE_TARNAME='gst-rtsp-server' +PACKAGE_VERSION='1.4.1' +PACKAGE_STRING='GStreamer RTSP Server Library 1.4.1' +PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer' +PACKAGE_URL='' + +ac_unique_file="gst/rtsp-server/rtsp-server.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +HAVE_LIBCGROUP_FALSE +HAVE_LIBCGROUP_TRUE +LIBCGROUP_LIBS +LIBCGROUP_CFLAGS +GST_OBJ_LIBS +GST_OBJ_CFLAGS +GST_LIB_LDFLAGS +GST_ALL_LDFLAGS +GST_ALL_LIBS +GST_ALL_CFLAGS +GST_OPTION_CFLAGS +DEPRECATED_CFLAGS +PROFILE_CFLAGS +DEFAULT_VISUALIZER +DEFAULT_VIDEOSRC +DEFAULT_VIDEOSINK +DEFAULT_AUDIOSRC +DEFAULT_AUDIOSINK +GST_LEVEL_DEFAULT +ERROR_CFLAGS +WARNING_CFLAGS +plugindir +PLUGINDIR +GST_LICENSE +HAVE_CHECK_FALSE +HAVE_CHECK_TRUE +GST_CHECK_LIBS +GST_CHECK_CFLAGS +GSTPD_PLUGINS_DIR +GST_PLUGINS_BAD_DIR +GST_PLUGINS_BAD_LIBS +GST_PLUGINS_BAD_CFLAGS +GSTPG_PLUGINS_DIR +GST_PLUGINS_GOOD_DIR +GST_PLUGINS_GOOD_LIBS +GST_PLUGINS_GOOD_CFLAGS +GSTPB_PLUGINS_DIR +GST_PLUGINS_BASE_DIR +GST_PLUGINS_BASE_LIBS +GST_PLUGINS_BASE_CFLAGS +GST_BASE_LIBS +GST_BASE_CFLAGS +GST_PLUGINS_DIR +GST_TOOLS_DIR +GST_LIBS +GST_CFLAGS +GIO_LDFLAGS +GIO_LIBS +GIO_CFLAGS +GLIB_EXTRA_CFLAGS +GLIB_MKENUMS +GLIB_GENMARSHAL +GLIB_LIBS +GLIB_CFLAGS +GLIB_REQ +GTK_DOC_USE_LIBTOOL_FALSE +GTK_DOC_USE_LIBTOOL_TRUE +GTK_DOC_BUILD_PDF_FALSE +GTK_DOC_BUILD_PDF_TRUE +GTK_DOC_BUILD_HTML_FALSE +GTK_DOC_BUILD_HTML_TRUE +ENABLE_GTK_DOC_FALSE +ENABLE_GTK_DOC_TRUE +GTKDOC_DEPS_LIBS +GTKDOC_DEPS_CFLAGS +HTML_DIR +GTKDOC_MKPDF +GTKDOC_REBASE +GTKDOC_CHECK +DOC_PS_FALSE +DOC_PS_TRUE +DOC_PDF_FALSE +DOC_PDF_TRUE +DOC_HTML_FALSE +DOC_HTML_TRUE +ENABLE_DOCBOOK_FALSE +ENABLE_DOCBOOK_TRUE +HAVE_EPSTOPDF +HAVE_PNMTOPS +HAVE_PNGTOPNM +HAVE_XMLLINT +HAVE_DVIPS +CAT_ENTRY_END +CAT_ENTRY_START +DOCBOOK_ROOT +XSLTPROC_FLAGS +XML_CATALOG +XSLTPROC +HAVE_PS2PDF +HAVE_JADETEX +HAVE_XSLTPROC +HAVE_DOCBOOK2PS +HAVE_INTROSPECTION_FALSE +HAVE_INTROSPECTION_TRUE +INTROSPECTION_MAKEFILE +INTROSPECTION_LIBS +INTROSPECTION_CFLAGS +INTROSPECTION_TYPELIBDIR +INTROSPECTION_GIRDIR +INTROSPECTION_GENERATE +INTROSPECTION_COMPILER +INTROSPECTION_SCANNER +HAVE_VALGRIND_FALSE +HAVE_VALGRIND_TRUE +VALGRIND_PATH +am__fastdepCCAS_FALSE +am__fastdepCCAS_TRUE +CCASDEPMODE +CCAS +BUILD_TESTS_FALSE +BUILD_TESTS_TRUE +GST_PKG_CONFIG_PATH +GST_PACKAGE_ORIGIN +GST_PACKAGE_NAME +GST_GCOV_ENABLED_FALSE +GST_GCOV_ENABLED_TRUE +CCASFLAGS +FFLAGS +CXXFLAGS +GCOV +GCOV_LIBS +GCOV_CFLAGS +VALGRIND_LIBS +VALGRIND_CFLAGS +PKG_CONFIG +ACLOCAL_AMFLAGS +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +LIBTOOL +OBJDUMP +DLLTOOL +AS +GST_LT_LDFLAGS +GST_LIBVERSION +GST_AGE +GST_REVISION +GST_CURRENT +GST_API_VERSION +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +PACKAGE_VERSION_RELEASE +PACKAGE_VERSION_NANO +PACKAGE_VERSION_MICRO +PACKAGE_VERSION_MINOR +PACKAGE_VERSION_MAJOR +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_maintainer_mode +enable_static +enable_shared +with_pic +enable_fast_install +enable_dependency_tracking +with_gnu_ld +with_sysroot +enable_libtool_lock +with_autoconf +with_autoheader +with_automake +with_aclocal +enable_fatal_warnings +enable_debug +enable_valgrind +enable_gcov +with_pkg_config_path +with_package_name +with_package_origin +enable_tests +enable_introspection +enable_docbook +with_html_dir +enable_gtk_doc +enable_gtk_doc_html +enable_gtk_doc_pdf +enable_gobject_cast_checks +enable_glib_asserts +enable_Bsymbolic +with_default_audiosink +with_default_audiosrc +with_default_videosink +with_default_videosrc +with_default_visualizer +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +PKG_CONFIG +VALGRIND_CFLAGS +VALGRIND_LIBS +CCAS +CCASFLAGS +GTKDOC_DEPS_CFLAGS +GTKDOC_DEPS_LIBS +GLIB_CFLAGS +GLIB_LIBS +GIO_CFLAGS +GIO_LIBS +GST_CFLAGS +GST_LIBS +GST_BASE_CFLAGS +GST_BASE_LIBS +GST_PLUGINS_BASE_CFLAGS +GST_PLUGINS_BASE_LIBS +GST_PLUGINS_GOOD_CFLAGS +GST_PLUGINS_GOOD_LIBS +GST_PLUGINS_BAD_CFLAGS +GST_PLUGINS_BAD_LIBS +GST_CHECK_CFLAGS +GST_CHECK_LIBS +LIBCGROUP_CFLAGS +LIBCGROUP_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures GStreamer RTSP Server Library 1.4.1 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/gst-rtsp-server] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of GStreamer RTSP Server Library 1.4.1:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --disable-maintainer-mode + disable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-static[=PKGS] build static libraries [default=no] + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-libtool-lock avoid locking (might break parallel builds) + --disable-fatal-warnings + Don't turn compiler warnings into fatal errors + --disable-debug disable addition of -g debugging info + --disable-valgrind disable run-time valgrind detection + --enable-gcov compile with coverage profiling instrumentation (gcc + only) + --disable-tests disable building test apps + --enable-introspection=[no/auto/yes] + Enable introspection for this build + --enable-docbook use docbook to build documentation [default=no] + --enable-gtk-doc use gtk-doc to build documentation [[default=no]] + --enable-gtk-doc-html build documentation in html format [[default=yes]] + --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] + --enable-gobject-cast-checks=[no/auto/yes] + Enable GObject cast checks + --enable-glib-asserts=[no/auto/yes] + Enable GLib assertion + --disable-Bsymbolic avoid linking with -Bsymbolic + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-autoconf use a different autoconf for regeneration of + Makefiles + --with-autoheader use a different autoheader for regeneration of + Makefiles + --with-automake use a different automake for regeneration of + Makefiles + --with-aclocal use a different aclocal for regeneration of + Makefiles + --with-pkg-config-path colon-separated list of pkg-config(1) dirs + --with-package-name specify package name to use in plugins + --with-package-origin specify package origin URL to use in plugins + --with-html-dir=PATH path to installed docs + --with-default-audiosink + specify default audio sink + --with-default-audiosrc specify default audio source + --with-default-videosink + specify default video sink + --with-default-videosrc specify default video source + --with-default-visualizer + specify default visualizer + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + PKG_CONFIG path to pkg-config utility + VALGRIND_CFLAGS + C compiler flags for VALGRIND, overriding pkg-config + VALGRIND_LIBS + linker flags for VALGRIND, overriding pkg-config + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) + GTKDOC_DEPS_CFLAGS + C compiler flags for GTKDOC_DEPS, overriding pkg-config + GTKDOC_DEPS_LIBS + linker flags for GTKDOC_DEPS, overriding pkg-config + GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config + GLIB_LIBS linker flags for GLIB, overriding pkg-config + GIO_CFLAGS C compiler flags for GIO, overriding pkg-config + GIO_LIBS linker flags for GIO, overriding pkg-config + GST_CFLAGS C compiler flags for GST, overriding pkg-config + GST_LIBS linker flags for GST, overriding pkg-config + GST_BASE_CFLAGS + C compiler flags for GST_BASE, overriding pkg-config + GST_BASE_LIBS + linker flags for GST_BASE, overriding pkg-config + GST_PLUGINS_BASE_CFLAGS + C compiler flags for GST_PLUGINS_BASE, overriding pkg-config + GST_PLUGINS_BASE_LIBS + linker flags for GST_PLUGINS_BASE, overriding pkg-config + GST_PLUGINS_GOOD_CFLAGS + C compiler flags for GST_PLUGINS_GOOD, overriding pkg-config + GST_PLUGINS_GOOD_LIBS + linker flags for GST_PLUGINS_GOOD, overriding pkg-config + GST_PLUGINS_BAD_CFLAGS + C compiler flags for GST_PLUGINS_BAD, overriding pkg-config + GST_PLUGINS_BAD_LIBS + linker flags for GST_PLUGINS_BAD, overriding pkg-config + GST_CHECK_CFLAGS + C compiler flags for GST_CHECK, overriding pkg-config + GST_CHECK_LIBS + linker flags for GST_CHECK, overriding pkg-config + LIBCGROUP_CFLAGS + C compiler flags for LIBCGROUP, overriding pkg-config + LIBCGROUP_LIBS + linker flags for LIBCGROUP, 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. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +GStreamer RTSP Server Library configure 1.4.1 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by GStreamer RTSP Server Library $as_me 1.4.1, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + + + +am__api_version='1.14' + +# 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: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# 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 ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + 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 + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # 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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +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. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +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 + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + 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 + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='gst-rtsp-server' + VERSION='1.4.1' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' + +# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + if test $am_uid -le $am_max_uid; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + _am_tools=none + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + if test $am_gid -le $am_max_gid; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + _am_tools=none + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +$as_echo_n "checking how to create a ustar tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_ustar-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if ${am_cv_prog_tar_ustar+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_prog_tar_ustar=$_am_tool +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +$as_echo "$am_cv_prog_tar_ustar" >&6; } + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + + + PACKAGE_VERSION_MAJOR=$(echo 1.4.1 | cut -d'.' -f1) + PACKAGE_VERSION_MINOR=$(echo 1.4.1 | cut -d'.' -f2) + PACKAGE_VERSION_MICRO=$(echo 1.4.1 | cut -d'.' -f3) + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking nano version" >&5 +$as_echo_n "checking nano version... " >&6; } + + NANO=$(echo 1.4.1 | cut -d'.' -f4) + + if test x"$NANO" = x || test "x$NANO" = "x0" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: 0 (release)" >&5 +$as_echo "0 (release)" >&6; } + NANO=0 + PACKAGE_VERSION_RELEASE=1 + GST_GIT="no" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NANO" >&5 +$as_echo "$NANO" >&6; } + PACKAGE_VERSION_RELEASE=0.`date +%Y%m%d.%H%M%S` + if test "x$NANO" != "x1" ; then + GST_GIT="no" + else + GST_GIT="yes" + fi + fi + PACKAGE_VERSION_NANO=$NANO + + + + + + +ac_config_headers="$ac_config_headers config.h" + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + +GST_API_VERSION=1.0 + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +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' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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". + rm -rf conftest.dir + 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_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # 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 + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$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` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + 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 + ;; + +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', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + 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|DragonFly)/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 + ;; + +haiku*) + 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +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 glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-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=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +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 + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# 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]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # 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(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && 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 +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#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 + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf 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 + +fi + +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +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 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + 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" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + 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 + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + GST_CURRENT=401 + GST_REVISION=0 + GST_AGE=401 + GST_LIBVERSION=401:0:401 + + + + + + GST_LT_LDFLAGS="$GST_LT_LDFLAGS -version-info $GST_LIBVERSION" + if test ! -z "" + then + GST_LT_LDFLAGS="$GST_LT_LDFLAGS -release " + fi + + + + + + + +# Set options +enable_dlopen=yes +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; 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 +else + enable_static=no +fi + + + + + + + + + + + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; 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 +else + enable_shared=yes +fi + + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; 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 +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + 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 + +*** 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 + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + 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 + +*** 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 + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## 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... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # 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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # 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_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-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_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # 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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # 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'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # 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. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${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 + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [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 + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$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)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** 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. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$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. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$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 + + # 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].*|aix[5-9]*) + 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 + + # 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. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-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 + : + else + # We have old collect2 + hardcode_direct=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 + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + link_all_deplibs=no + 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 + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=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. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${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. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$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)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # 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. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # 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. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=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. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=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*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$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 + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$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' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='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' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + 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. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + 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 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds 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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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" +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 # correct to gnu/linux during the next big refactor + 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' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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 + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + 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* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + 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 + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # 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 + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # 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}${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`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + 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 glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | 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' + ;; + +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 # correct to gnu/linux during the next big refactor + 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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + 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.3*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = 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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != 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_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = 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 + + + + + + + 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* | cegcc*) + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + 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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + 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 + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +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" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +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" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + 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 + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +GST_REQ=1.4.0 +GSTPB_REQ=1.4.0 +GSTPG_REQ=1.4.0 +GSTPD_REQ=1.4.0 + + + + +# Check whether --with-autoconf was given. +if test "${with_autoconf+set}" = set; then : + withval=$with_autoconf; + unset AUTOCONF + +AUTOCONF=${AUTOCONF-"${am_missing_run}${withval}"} + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $AUTOCONF as autoconf" >&5 +$as_echo "$as_me: Using $AUTOCONF as autoconf" >&6;} + +fi + + + +# Check whether --with-autoheader was given. +if test "${with_autoheader+set}" = set; then : + withval=$with_autoheader; + unset AUTOHEADER + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}${withval}"} + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $AUTOHEADER as autoheader" >&5 +$as_echo "$as_me: Using $AUTOHEADER as autoheader" >&6;} + +fi + + + +# Check whether --with-automake was given. +if test "${with_automake+set}" = set; then : + withval=$with_automake; + unset AUTOMAKE + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}${withval}"} + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $AUTOMAKE as automake" >&5 +$as_echo "$as_me: Using $AUTOMAKE as automake" >&6;} + +fi + + + +# Check whether --with-aclocal was given. +if test "${with_aclocal+set}" = set; then : + withval=$with_aclocal; + unset ACLOCAL + +ACLOCAL=${ACLOCAL-"${am_missing_run}${withval}"} + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $ACLOCAL as aclocal" >&5 +$as_echo "$as_me: Using $ACLOCAL as aclocal" >&6;} + +fi + + + +ACLOCAL_AMFLAGS="-I m4 -I common/m4" + + + +#AM_GNU_GETTEXT_VERSION([0.17]) +#AM_GNU_GETTEXT([external]) +#AG_GST_GETTEXT([gst-rtsp-server-$GST_API_VERSION]) + + + + # Check whether --enable-fatal-warnings was given. +if test "${enable_fatal_warnings+set}" = set; then : + enableval=$enable_fatal_warnings; + case "${enableval}" in + yes) FATAL_WARNINGS=yes ;; + no) FATAL_WARNINGS=no ;; + *) as_fn_error $? "bad value ${enableval} for --disable-fatal-warnings" "$LINENO" 5 ;; + esac + +else + + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + FATAL_WARNINGS=yes + else + FATAL_WARNINGS=no + fi + +fi + + + + + # Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; + case "${enableval}" in + yes) USE_DEBUG=yes ;; + no) USE_DEBUG=no ;; + *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;; + esac + +else + USE_DEBUG=yes +fi + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi + +fi + + # Check whether --enable-valgrind was given. +if test "${enable_valgrind+set}" = set; then : + enableval=$enable_valgrind; + case "${enableval}" in + yes) USE_VALGRIND="$USE_DEBUG" ;; + no) USE_VALGRIND=no ;; + *) as_fn_error $? "bad value ${enableval} for --enable-valgrind" "$LINENO" 5 ;; + esac + +else + USE_VALGRIND="$USE_DEBUG" +fi + VALGRIND_REQ="3.0" + if test "x$USE_VALGRIND" = xyes; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VALGRIND" >&5 +$as_echo_n "checking for VALGRIND... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$VALGRIND_CFLAGS"; then + pkg_cv_VALGRIND_CFLAGS="$VALGRIND_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"valgrind >= \$VALGRIND_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "valgrind >= $VALGRIND_REQ") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_VALGRIND_CFLAGS=`$PKG_CONFIG --cflags "valgrind >= $VALGRIND_REQ" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$VALGRIND_LIBS"; then + pkg_cv_VALGRIND_LIBS="$VALGRIND_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"valgrind >= \$VALGRIND_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "valgrind >= $VALGRIND_REQ") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_VALGRIND_LIBS=`$PKG_CONFIG --libs "valgrind >= $VALGRIND_REQ" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + VALGRIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "valgrind >= $VALGRIND_REQ"` + else + VALGRIND_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "valgrind >= $VALGRIND_REQ"` + fi + # Put the nasty error message in config.log where it belongs + echo "$VALGRIND_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + USE_VALGRIND="no" +elif test $pkg_failed = untried; then + USE_VALGRIND="no" +else + VALGRIND_CFLAGS=$pkg_cv_VALGRIND_CFLAGS + VALGRIND_LIBS=$pkg_cv_VALGRIND_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + USE_VALGRIND="yes" +fi + fi + if test "x$USE_VALGRIND" = xyes; then + +$as_echo "#define HAVE_VALGRIND 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using extra code paths for valgrind" >&5 +$as_echo "$as_me: Using extra code paths for valgrind" >&6;} + fi + + + # Check whether --enable-gcov was given. +if test "${enable_gcov+set}" = set; then : + enableval=$enable_gcov; enable_gcov=$enableval +else + enable_gcov=no +fi + + if test x$enable_gcov = xyes ; then + if test "x$GCC" != "xyes" + then + as_fn_error $? "gcov only works if gcc is used" "$LINENO" 5 + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands \"-fprofile-arcs\"" >&5 +$as_echo_n "checking to see if compiler understands \"-fprofile-arcs\"... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS "-fprofile-arcs"" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + GCOV_CFLAGS="$GCOV_CFLAGS -fprofile-arcs" + true + else + true + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands \"-ftest-coverage\"" >&5 +$as_echo_n "checking to see if compiler understands \"-ftest-coverage\"... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS "-ftest-coverage"" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + GCOV_CFLAGS="$GCOV_CFLAGS -ftest-coverage" + true + else + true + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + GCOV_CFLAGS=`echo "$GCOV_CFLAGS" | sed -e 's/-O[0-9]*//g'` + GCOV_LIBS=-lgcov + + + GCOV=`echo $CC | sed s/gcc/gcov/g` + + + GST_GCOV_ENABLED=yes + +cat >>confdefs.h <<_ACEOF +#define GST_GCOV_ENABLED 1 +_ACEOF + + if test "x$GST_GCOV_ENABLED" = "xyes" + then + CFLAGS="$CFLAGS -O0" + + CXXFLAGS="$CXXFLAGS -O0" + + FFLAGS="$FFLAGS -O0" + + CCASFLAGS="$CCASFLAGS -O0" + + { $as_echo "$as_me:${as_lineno-$LINENO}: gcov enabled, setting CFLAGS and friends to $CFLAGS" >&5 +$as_echo "$as_me: gcov enabled, setting CFLAGS and friends to $CFLAGS" >&6;} + fi + fi + if test x$enable_gcov = xyes; then + GST_GCOV_ENABLED_TRUE= + GST_GCOV_ENABLED_FALSE='#' +else + GST_GCOV_ENABLED_TRUE='#' + GST_GCOV_ENABLED_FALSE= +fi + + + + +# Check whether --with-pkg-config-path was given. +if test "${with_pkg_config_path+set}" = set; then : + withval=$with_pkg_config_path; + export PKG_CONFIG_PATH=${withval} + { $as_echo "$as_me:${as_lineno-$LINENO}: Set PKG_CONFIG_PATH to $PKG_CONFIG_PATH" >&5 +$as_echo "$as_me: Set PKG_CONFIG_PATH to $PKG_CONFIG_PATH" >&6;} + +fi + + + + +# Check whether --with-package-name was given. +if test "${with_package_name+set}" = set; then : + withval=$with_package_name; + case "${withval}" in + yes) as_fn_error $? "bad value ${withval} for --with-package-name" "$LINENO" 5 ;; + no) as_fn_error $? "bad value ${withval} for --with-package-name" "$LINENO" 5 ;; + *) GST_PACKAGE_NAME="${withval}" ;; + esac + +else + + P= + if test "x$P" = "x" + then + P=$PACKAGE_NAME + fi + + if test "x$PACKAGE_VERSION_NANO" = "x0" + then + GST_PACKAGE_NAME="$P source release" + else + if test "x$PACKAGE_VERSION_NANO" = "x1" + then + GST_PACKAGE_NAME="$P git" + else + GST_PACKAGE_NAME="$P prerelease" + fi + fi + + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $GST_PACKAGE_NAME as package name" >&5 +$as_echo "$as_me: Using $GST_PACKAGE_NAME as package name" >&6;} + +cat >>confdefs.h <<_ACEOF +#define GST_PACKAGE_NAME "$GST_PACKAGE_NAME" +_ACEOF + + + + + +# Check whether --with-package-origin was given. +if test "${with_package_origin+set}" = set; then : + withval=$with_package_origin; + case "${withval}" in + yes) as_fn_error $? "bad value ${withval} for --with-package-origin" "$LINENO" 5 ;; + no) as_fn_error $? "bad value ${withval} for --with-package-origin" "$LINENO" 5 ;; + *) GST_PACKAGE_ORIGIN="${withval}" ;; + esac + +else + GST_PACKAGE_ORIGIN="Unknown package origin" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $GST_PACKAGE_ORIGIN as package origin" >&5 +$as_echo "$as_me: Using $GST_PACKAGE_ORIGIN as package origin" >&6;} + +cat >>confdefs.h <<_ACEOF +#define GST_PACKAGE_ORIGIN "$GST_PACKAGE_ORIGIN" +_ACEOF + + + + + + GST_PKG_CONFIG_PATH="\$(top_builddir)/pkgconfig" + if test "x$PKG_CONFIG_PATH" != "x"; then + GST_PKG_CONFIG_PATH="$GST_PKG_CONFIG_PATH:$PKG_CONFIG_PATH" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using GST_PKG_CONFIG_PATH = $GST_PKG_CONFIG_PATH" >&5 +$as_echo "$as_me: Using GST_PKG_CONFIG_PATH = $GST_PKG_CONFIG_PATH" >&6;} + + + + if test "x$PACKAGE_VERSION_NANO" = "x0"; then + + if test "xyes" = "xno" -o "xyes" = "x"; then + GST_PACKAGE_RELEASE_DATETIME=`date -u "+%Y-%m-%dT%H:%MZ"` + elif test "xyes" = "xyes"; then + if ( echo yes | grep '^201-90-9-0-10-9-0-30-9' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=yes + else + YYYY_MM_DD=`sh "${srcdir}/common/extract-release-date-from-doap-file" $PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO "${srcdir}/gst-rtsp-server.doap" `; + if test "x$YYYY_MM_DD" != "x"; then + GST_PACKAGE_RELEASE_DATETIME=$YYYY_MM_DD + else + as_fn_error $? "SET_PACKAGE_RELEASE_DATETIME: could not extract + release date for release version $PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO from \"${srcdir}/gst-rtsp-server.doap\" " "$LINENO" 5 + GST_PACKAGE_RELEASE_DATETIME="" + fi + fi + elif ( echo yes | grep '^201-90-9-0-10-9-0-30-9' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&5 +$as_echo "$as_me: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&2;} + GST_PACKAGE_RELEASE_DATETIME="" + fi + + if test "x$GST_PACKAGE_RELEASE_DATETIME" = "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&2;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&6;} + + +cat >>confdefs.h <<_ACEOF +#define GST_PACKAGE_RELEASE_DATETIME "$GST_PACKAGE_RELEASE_DATETIME" +_ACEOF + + fi + + else + + if test "xno" = "xno" -o "xno" = "x"; then + GST_PACKAGE_RELEASE_DATETIME=`date -u "+%Y-%m-%dT%H:%MZ"` + elif test "xno" = "xyes"; then + if ( echo no | grep '^201-90-9-0-10-9-0-30-9' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=no + else + YYYY_MM_DD=`sh "${srcdir}/common/extract-release-date-from-doap-file" `; + if test "x$YYYY_MM_DD" != "x"; then + GST_PACKAGE_RELEASE_DATETIME=$YYYY_MM_DD + else + as_fn_error $? "SET_PACKAGE_RELEASE_DATETIME: could not extract + release date for release version from " "$LINENO" 5 + GST_PACKAGE_RELEASE_DATETIME="" + fi + fi + elif ( echo no | grep '^201-90-9-0-10-9-0-30-9' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=no + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&5 +$as_echo "$as_me: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&2;} + GST_PACKAGE_RELEASE_DATETIME="" + fi + + if test "x$GST_PACKAGE_RELEASE_DATETIME" = "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&2;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&6;} + + +cat >>confdefs.h <<_ACEOF +#define GST_PACKAGE_RELEASE_DATETIME "$GST_PACKAGE_RELEASE_DATETIME" +_ACEOF + + fi + + fi + + +# Check whether --enable-tests was given. +if test "${enable_tests+set}" = set; then : + enableval=$enable_tests; + case "${enableval}" in + yes) BUILD_TESTS=yes ;; + no) BUILD_TESTS=no ;; + *) as_fn_error $? "bad value ${enableval} for --disable-tests" "$LINENO" 5 ;; + esac + +else + BUILD_TESTS=yes +fi + if test "x$BUILD_TESTS" = "xyes"; then + BUILD_TESTS_TRUE= + BUILD_TESTS_FALSE='#' +else + BUILD_TESTS_TRUE='#' + BUILD_TESTS_FALSE= +fi + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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". + rm -rf conftest.dir + 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_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + case $ac_cv_prog_cc_stdc in #( + no) : + ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if ${ac_cv_prog_cc_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_cv_prog_cc_stdc=no +fi + +fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 +$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } + if ${ac_cv_prog_cc_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +fi + + case $ac_cv_prog_cc_stdc in #( + no) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 +$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; +esac + + + + +# By default we simply use the C compiler to build assembly code. + +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + + + +depcc="$CCAS" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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". + rm -rf conftest.dir + 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_CCAS_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + + + 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 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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_CCAS_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CCAS_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } +CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then + am__fastdepCCAS_TRUE= + am__fastdepCCAS_FALSE='#' +else + am__fastdepCCAS_TRUE='#' + am__fastdepCCAS_FALSE= +fi + + + +# Extract the first word of "valgrind", so it can be a program name with args. +set dummy valgrind; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_VALGRIND_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $VALGRIND_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_VALGRIND_PATH="$VALGRIND_PATH" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_VALGRIND_PATH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_VALGRIND_PATH" && ac_cv_path_VALGRIND_PATH="no" + ;; +esac +fi +VALGRIND_PATH=$ac_cv_path_VALGRIND_PATH +if test -n "$VALGRIND_PATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VALGRIND_PATH" >&5 +$as_echo "$VALGRIND_PATH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test ! "x$VALGRIND_PATH" = "xno"; then + HAVE_VALGRIND_TRUE= + HAVE_VALGRIND_FALSE='#' +else + HAVE_VALGRIND_TRUE='#' + HAVE_VALGRIND_FALSE= +fi + + + + + + # Check whether --enable-introspection was given. +if test "${enable_introspection+set}" = set; then : + enableval=$enable_introspection; +else + enable_introspection=auto +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-introspection" >&5 +$as_echo_n "checking for gobject-introspection... " >&6; } + + case $enable_introspection in #( + no) : + found_introspection="no (disabled, use --enable-introspection to enable)" + ;; #( + yes) : + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + : +else + as_fn_error $? "gobject-introspection-1.0 is not installed" "$LINENO" 5 +fi + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 1.31.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 1.31.1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + found_introspection=yes +else + as_fn_error $? "You need to have gobject-introspection >= 1.31.1 installed to build GStreamer RTSP Server Library" "$LINENO" 5 +fi + ;; #( + auto) : + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 1.31.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 1.31.1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + found_introspection=yes +else + found_introspection=no +fi + ;; #( + *) : + as_fn_error $? "invalid argument passed to --enable-introspection, should be one of [no/auto/yes]" "$LINENO" 5 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_introspection" >&5 +$as_echo "$found_introspection" >&6; } + + INTROSPECTION_SCANNER= + INTROSPECTION_COMPILER= + INTROSPECTION_GENERATE= + INTROSPECTION_GIRDIR= + INTROSPECTION_TYPELIBDIR= + if test "x$found_introspection" = "xyes"; then + INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` + INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` + INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" + INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` + INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` + INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection + fi + + + + + + + + + + if test "x$found_introspection" = "xyes"; then + HAVE_INTROSPECTION_TRUE= + HAVE_INTROSPECTION_FALSE='#' +else + HAVE_INTROSPECTION_TRUE='#' + HAVE_INTROSPECTION_FALSE= +fi + + + + + + if test "x$PACKAGE_TARNAME" = "x" + then + as_fn_error $? "Internal error - PACKAGE_TARNAME not set" "$LINENO" 5 + fi + docdir="\$(datadir)/doc/$PACKAGE_TARNAME-$GST_API_VERSION" + + # Check whether --enable-docbook was given. +if test "${enable_docbook+set}" = set; then : + enableval=$enable_docbook; +else + enable_docbook=no +fi + + + have_docbook=no + + if test x$enable_docbook = xyes; then + + # Extract the first word of "docbook2ps", so it can be a program name with args. +set dummy docbook2ps; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAVE_DOCBOOK2PS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_DOCBOOK2PS"; then + ac_cv_prog_HAVE_DOCBOOK2PS="$HAVE_DOCBOOK2PS" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_DOCBOOK2PS="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_HAVE_DOCBOOK2PS" && ac_cv_prog_HAVE_DOCBOOK2PS="no" +fi +fi +HAVE_DOCBOOK2PS=$ac_cv_prog_HAVE_DOCBOOK2PS +if test -n "$HAVE_DOCBOOK2PS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DOCBOOK2PS" >&5 +$as_echo "$HAVE_DOCBOOK2PS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "xsltproc", so it can be a program name with args. +set dummy xsltproc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAVE_XSLTPROC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_XSLTPROC"; then + ac_cv_prog_HAVE_XSLTPROC="$HAVE_XSLTPROC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_XSLTPROC="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_HAVE_XSLTPROC" && ac_cv_prog_HAVE_XSLTPROC="no" +fi +fi +HAVE_XSLTPROC=$ac_cv_prog_HAVE_XSLTPROC +if test -n "$HAVE_XSLTPROC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_XSLTPROC" >&5 +$as_echo "$HAVE_XSLTPROC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "jadetex", so it can be a program name with args. +set dummy jadetex; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAVE_JADETEX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_JADETEX"; then + ac_cv_prog_HAVE_JADETEX="$HAVE_JADETEX" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_JADETEX="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_HAVE_JADETEX" && ac_cv_prog_HAVE_JADETEX="no" +fi +fi +HAVE_JADETEX=$ac_cv_prog_HAVE_JADETEX +if test -n "$HAVE_JADETEX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_JADETEX" >&5 +$as_echo "$HAVE_JADETEX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "ps2pdf", so it can be a program name with args. +set dummy ps2pdf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAVE_PS2PDF+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_PS2PDF"; then + ac_cv_prog_HAVE_PS2PDF="$HAVE_PS2PDF" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_PS2PDF="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_HAVE_PS2PDF" && ac_cv_prog_HAVE_PS2PDF="no" +fi +fi +HAVE_PS2PDF=$ac_cv_prog_HAVE_PS2PDF +if test -n "$HAVE_PS2PDF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_PS2PDF" >&5 +$as_echo "$HAVE_PS2PDF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + XSLTPROC_FLAGS=--nonet + DOCBOOK_ROOT= + TYPE_LC=xml + TYPE_UC=XML + DOCBOOK_VERSION=4.1.2 + + if test -n "$XML_CATALOG_FILES"; then + oldIFS=$IFS + IFS=' ' + for xml_catalog_file in $XML_CATALOG_FILES; do + if test -f $xml_catalog_file; then + XML_CATALOG=$xml_catalog_file + CAT_ENTRY_START='' + break + fi + done + IFS=$oldIFS + elif test ! -f /etc/xml/catalog; then + for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/ /usr/local/share/xsl/docbook ; + do + if test -d "$i"; then + DOCBOOK_ROOT=$i + fi + done + else + XML_CATALOG=/etc/xml/catalog + CAT_ENTRY_START='' + fi + + # Extract the first word of "xsltproc", so it can be a program name with args. +set dummy xsltproc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_XSLTPROC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$XSLTPROC"; then + ac_cv_prog_XSLTPROC="$XSLTPROC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_XSLTPROC="xsltproc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +XSLTPROC=$ac_cv_prog_XSLTPROC +if test -n "$XSLTPROC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 +$as_echo "$XSLTPROC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + XSLTPROC_WORKS=no + if test -n "$XSLTPROC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xsltproc docbook processing works" >&5 +$as_echo_n "checking whether xsltproc docbook processing works... " >&6; } + + if test -n "$XML_CATALOG"; then + DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" + else + DB_FILE="$DOCBOOK_ROOT/xhtml/docbook.xsl" + fi + $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END + + + + +END + if test "$?" = 0; then + XSLTPROC_WORKS=yes + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC_WORKS" >&5 +$as_echo "$XSLTPROC_WORKS" >&6; } + fi + + if test "x$XSLTPROC_WORKS" = "xyes"; then + have_docbook=yes + else + have_docbook=no + fi + + + + + + + + + # Extract the first word of "dvips", so it can be a program name with args. +set dummy dvips; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAVE_DVIPS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_DVIPS"; then + ac_cv_prog_HAVE_DVIPS="$HAVE_DVIPS" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_DVIPS="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_HAVE_DVIPS" && ac_cv_prog_HAVE_DVIPS="no" +fi +fi +HAVE_DVIPS=$ac_cv_prog_HAVE_DVIPS +if test -n "$HAVE_DVIPS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DVIPS" >&5 +$as_echo "$HAVE_DVIPS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "xmllint", so it can be a program name with args. +set dummy xmllint; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAVE_XMLLINT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_XMLLINT"; then + ac_cv_prog_HAVE_XMLLINT="$HAVE_XMLLINT" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_XMLLINT="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_HAVE_XMLLINT" && ac_cv_prog_HAVE_XMLLINT="no" +fi +fi +HAVE_XMLLINT=$ac_cv_prog_HAVE_XMLLINT +if test -n "$HAVE_XMLLINT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_XMLLINT" >&5 +$as_echo "$HAVE_XMLLINT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + # Extract the first word of "pngtopnm", so it can be a program name with args. +set dummy pngtopnm; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAVE_PNGTOPNM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_PNGTOPNM"; then + ac_cv_prog_HAVE_PNGTOPNM="$HAVE_PNGTOPNM" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_PNGTOPNM="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_HAVE_PNGTOPNM" && ac_cv_prog_HAVE_PNGTOPNM="no" +fi +fi +HAVE_PNGTOPNM=$ac_cv_prog_HAVE_PNGTOPNM +if test -n "$HAVE_PNGTOPNM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_PNGTOPNM" >&5 +$as_echo "$HAVE_PNGTOPNM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "pnmtops", so it can be a program name with args. +set dummy pnmtops; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAVE_PNMTOPS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_PNMTOPS"; then + ac_cv_prog_HAVE_PNMTOPS="$HAVE_PNMTOPS" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_PNMTOPS="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_HAVE_PNMTOPS" && ac_cv_prog_HAVE_PNMTOPS="no" +fi +fi +HAVE_PNMTOPS=$ac_cv_prog_HAVE_PNMTOPS +if test -n "$HAVE_PNMTOPS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_PNMTOPS" >&5 +$as_echo "$HAVE_PNMTOPS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "epstopdf", so it can be a program name with args. +set dummy epstopdf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAVE_EPSTOPDF+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_EPSTOPDF"; then + ac_cv_prog_HAVE_EPSTOPDF="$HAVE_EPSTOPDF" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_EPSTOPDF="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_HAVE_EPSTOPDF" && ac_cv_prog_HAVE_EPSTOPDF="no" +fi +fi +HAVE_EPSTOPDF=$ac_cv_prog_HAVE_EPSTOPDF +if test -n "$HAVE_EPSTOPDF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_EPSTOPDF" >&5 +$as_echo "$HAVE_EPSTOPDF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + if test "x$HAVE_XSLTPROC" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes"; then + DOC_HTML=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: Will output HTML documentation" >&5 +$as_echo "$as_me: Will output HTML documentation" >&6;} + else + DOC_HTML=no + { $as_echo "$as_me:${as_lineno-$LINENO}: Will not output HTML documentation" >&5 +$as_echo "$as_me: Will not output HTML documentation" >&6;} + fi + + if test "x$HAVE_DOCBOOK2PS" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes" && \ + test "x$HAVE_JADETEX" = "xyes" && \ + test "x$HAVE_DVIPS" = "xyes" && \ + test "x$HAVE_PNGTOPNM" = "xyes" && \ + test "x$HAVE_PNMTOPS" = "xyes"; then + DOC_PS=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: Will output PS documentation" >&5 +$as_echo "$as_me: Will output PS documentation" >&6;} + else + DOC_PS=no + { $as_echo "$as_me:${as_lineno-$LINENO}: Will not output PS documentation" >&5 +$as_echo "$as_me: Will not output PS documentation" >&6;} + fi + + if test "x$DOC_PS" = "xyes" && \ + test "x$enable_docbook" = "xyes" && \ + test "x$HAVE_XMLLINT" = "xyes" && \ + test "x$HAVE_PS2PDF" = "xyes"; then + DOC_PDF=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: Will output PDF documentation" >&5 +$as_echo "$as_me: Will output PDF documentation" >&6;} + else + DOC_PDF=no + { $as_echo "$as_me:${as_lineno-$LINENO}: Will not output PDF documentation" >&5 +$as_echo "$as_me: Will not output PDF documentation" >&6;} + fi + + if test "x$have_docbook" != "xyes"; then + enable_docbook=no + fi + fi + + if test "x$have_docbook" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Installing documentation in $docdir" >&5 +$as_echo "$as_me: Installing documentation in $docdir" >&6;} + + fi + + if test x$enable_docbook = xyes; then + ENABLE_DOCBOOK_TRUE= + ENABLE_DOCBOOK_FALSE='#' +else + ENABLE_DOCBOOK_TRUE='#' + ENABLE_DOCBOOK_FALSE= +fi + + if test x$DOC_HTML = xyes; then + DOC_HTML_TRUE= + DOC_HTML_FALSE='#' +else + DOC_HTML_TRUE='#' + DOC_HTML_FALSE= +fi + + if test x$DOC_PDF = xyes; then + DOC_PDF_TRUE= + DOC_PDF_FALSE='#' +else + DOC_PDF_TRUE='#' + DOC_PDF_FALSE= +fi + + if test x$DOC_PS = xyes; then + DOC_PS_TRUE= + DOC_PS_FALSE='#' +else + DOC_PS_TRUE='#' + DOC_PS_FALSE= +fi + + + + + + # Extract the first word of "gtkdoc-check", so it can be a program name with args. +set dummy gtkdoc-check; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_CHECK+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_CHECK in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK +if test -n "$GTKDOC_CHECK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 +$as_echo "$GTKDOC_CHECK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + for ac_prog in gtkdoc-rebase +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_REBASE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_REBASE in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE +if test -n "$GTKDOC_REBASE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 +$as_echo "$GTKDOC_REBASE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$GTKDOC_REBASE" && break +done +test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" + + # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. +set dummy gtkdoc-mkpdf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_MKPDF in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF +if test -n "$GTKDOC_MKPDF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 +$as_echo "$GTKDOC_MKPDF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + +# Check whether --with-html-dir was given. +if test "${with_html_dir+set}" = set; then : + withval=$with_html_dir; +else + with_html_dir='${datadir}/gtk-doc/html' +fi + + HTML_DIR="$with_html_dir" + + + # Check whether --enable-gtk-doc was given. +if test "${enable_gtk_doc+set}" = set; then : + enableval=$enable_gtk_doc; +else + enable_gtk_doc=no +fi + + + if test x$enable_gtk_doc = xyes; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.12\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.12") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + : +else + as_fn_error $? "You need to have gtk-doc >= 1.12 installed to build $PACKAGE_NAME" "$LINENO" 5 +fi + if test "x$PACKAGE_NAME" != "xglib"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 +$as_echo_n "checking for GTKDOC_DEPS... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GTKDOC_DEPS_CFLAGS"; then + pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GTKDOC_DEPS_LIBS"; then + pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0"` + else + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0) were not met: + +$GTKDOC_DEPS_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GTKDOC_DEPS_CFLAGS +and GTKDOC_DEPS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_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 environment variables GTKDOC_DEPS_CFLAGS +and GTKDOC_DEPS_LIBS 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" "$LINENO" 5; } +else + GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS + GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + fi + if test -z "$SED"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 +$as_echo_n "checking whether to build gtk-doc documentation... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 +$as_echo "$enable_gtk_doc" >&6; } + + # Check whether --enable-gtk-doc-html was given. +if test "${enable_gtk_doc_html+set}" = set; then : + enableval=$enable_gtk_doc_html; +else + enable_gtk_doc_html=yes +fi + + # Check whether --enable-gtk-doc-pdf was given. +if test "${enable_gtk_doc_pdf+set}" = set; then : + enableval=$enable_gtk_doc_pdf; +else + enable_gtk_doc_pdf=no +fi + + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + + if test x$enable_gtk_doc = xyes; then + ENABLE_GTK_DOC_TRUE= + ENABLE_GTK_DOC_FALSE='#' +else + ENABLE_GTK_DOC_TRUE='#' + ENABLE_GTK_DOC_FALSE= +fi + + if test x$enable_gtk_doc_html = xyes; then + GTK_DOC_BUILD_HTML_TRUE= + GTK_DOC_BUILD_HTML_FALSE='#' +else + GTK_DOC_BUILD_HTML_TRUE='#' + GTK_DOC_BUILD_HTML_FALSE= +fi + + if test x$enable_gtk_doc_pdf = xyes; then + GTK_DOC_BUILD_PDF_TRUE= + GTK_DOC_BUILD_PDF_FALSE='#' +else + GTK_DOC_BUILD_PDF_TRUE='#' + GTK_DOC_BUILD_PDF_FALSE= +fi + + if test -n "$LIBTOOL"; then + GTK_DOC_USE_LIBTOOL_TRUE= + GTK_DOC_USE_LIBTOOL_FALSE='#' +else + GTK_DOC_USE_LIBTOOL_TRUE='#' + GTK_DOC_USE_LIBTOOL_FALSE= +fi + + + + + + + + + + +GLIB_REQ=2.32.0 + + + + + GLIB_REQ=$GLIB_REQ + if test "x$GLIB_REQ" = "x" + then + as_fn_error $? "Please specify a required version for GLib 2.0" "$LINENO" 5 + fi + + + + which="glib-2.0 >= $GLIB_REQ gobject-2.0 gmodule-no-export-2.0" + required="no" + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 +$as_echo_n "checking for GLIB... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GLIB_CFLAGS"; then + pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$which\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$which") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "$which" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GLIB_LIBS"; then + pkg_cv_GLIB_LIBS="$GLIB_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$which\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$which") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "$which" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$which"` + else + GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$which"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GLIB_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + HAVE_GLIB="no" + if test "x$required" = "xyes"; then + as_fn_error $? "$GLIB_PKG_ERRORS" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: $GLIB_PKG_ERRORS" >&5 +$as_echo "$as_me: $GLIB_PKG_ERRORS" >&6;} + fi + +elif test $pkg_failed = untried; then + + HAVE_GLIB="no" + if test "x$required" = "xyes"; then + as_fn_error $? "$GLIB_PKG_ERRORS" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: $GLIB_PKG_ERRORS" >&5 +$as_echo "$as_me: $GLIB_PKG_ERRORS" >&6;} + fi + +else + GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS + GLIB_LIBS=$pkg_cv_GLIB_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + HAVE_GLIB="yes" + +fi + + + + if test "x$HAVE_GLIB" = "xno"; then + as_fn_error $? "This package requires GLib >= $GLIB_REQ to compile." "$LINENO" 5 + fi + + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_THREADS_MANDATORY" + + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_DEPRECATED" + fi + + # Check whether --enable-gobject-cast-checks was given. +if test "${enable_gobject_cast_checks+set}" = set; then : + enableval=$enable_gobject_cast_checks; enable_gobject_cast_checks=$enableval +else + enable_gobject_cast_checks=auto +fi + + + if test "x$enable_gobject_cast_checks" = "xauto"; then + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + enable_gobject_cast_checks=yes + else + enable_gobject_cast_checks=no + fi + fi + + if test "x$enable_gobject_cast_checks" = "xno"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_CAST_CHECKS" + fi + + # Check whether --enable-glib-asserts was given. +if test "${enable_glib_asserts+set}" = set; then : + enableval=$enable_glib_asserts; enable_glib_assertions=$enableval +else + enable_glib_assertions=auto +fi + + + if test "x$enable_glib_assertions" = "xauto"; then + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + enable_glib_assertions=yes + else + enable_glib_assertions=no + fi + fi + + if test "x$enable_glib_assertions" = "xno"; then + GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_ASSERT" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib-genmarshal" >&5 +$as_echo_n "checking for glib-genmarshal... " >&6; } + if test "x$GLIB_GENMARSHAL" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL (from environment)" >&5 +$as_echo "$GLIB_GENMARSHAL (from environment)" >&6; } + else + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + if $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL (from pkg-config path)" >&5 +$as_echo "$GLIB_GENMARSHAL (from pkg-config path)" >&6; } + else + # Extract the first word of "glib-genmarshal", so it can be a program name with args. +set dummy glib-genmarshal; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GLIB_GENMARSHAL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GLIB_GENMARSHAL in + [\\/]* | ?:[\\/]*) + ac_cv_path_GLIB_GENMARSHAL="$GLIB_GENMARSHAL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GLIB_GENMARSHAL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GLIB_GENMARSHAL" && ac_cv_path_GLIB_GENMARSHAL="glib-genmarshal" + ;; +esac +fi +GLIB_GENMARSHAL=$ac_cv_path_GLIB_GENMARSHAL +if test -n "$GLIB_GENMARSHAL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL" >&5 +$as_echo "$GLIB_GENMARSHAL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL" >&5 +$as_echo "$GLIB_GENMARSHAL" >&6; } + fi + fi + if ! $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $GLIB_GENMARSHAL does not seem to work!" >&5 +$as_echo "$as_me: WARNING: $GLIB_GENMARSHAL does not seem to work!" >&2;} + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib-mkenums" >&5 +$as_echo_n "checking for glib-mkenums... " >&6; } + if test "x$GLIB_MKENUMS" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_MKENUMS (from environment)" >&5 +$as_echo "$GLIB_MKENUMS (from environment)" >&6; } + else + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_MKENUMS" >&5 +$as_echo "$GLIB_MKENUMS" >&6; } + fi + if ! $GLIB_MKENUMS --version 2>/dev/null >/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $GLIB_MKENUMS does not seem to work!" >&5 +$as_echo "$as_me: WARNING: $GLIB_MKENUMS does not seem to work!" >&2;} + fi + + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIO" >&5 +$as_echo_n "checking for GIO... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GIO_CFLAGS"; then + pkg_cv_GIO_CFLAGS="$GIO_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= \$GLIB_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-2.0 >= $GLIB_REQ") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 >= $GLIB_REQ" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GIO_LIBS"; then + pkg_cv_GIO_LIBS="$GIO_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= \$GLIB_REQ\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-2.0 >= $GLIB_REQ") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GIO_LIBS=`$PKG_CONFIG --libs "gio-2.0 >= $GLIB_REQ" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gio-2.0 >= $GLIB_REQ"` + else + GIO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gio-2.0 >= $GLIB_REQ"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GIO_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (gio-2.0 >= $GLIB_REQ) were not met: + +$GIO_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GIO_CFLAGS +and GIO_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_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 environment variables GIO_CFLAGS +and GIO_LIBS 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" "$LINENO" 5; } +else + GIO_CFLAGS=$pkg_cv_GIO_CFLAGS + GIO_LIBS=$pkg_cv_GIO_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + if test "x$HAVE_GIO" = "xno"; then + as_fn_error $? "This package requires GIO >= $GLIB_REQ to compile." "$LINENO" 5 + fi + + GIO_MODULE_DIR="`$PKG_CONFIG --variable=giomoduledir gio-2.0`" + +cat >>confdefs.h <<_ACEOF +#define GIO_MODULE_DIR "$GIO_MODULE_DIR" +_ACEOF + + GIO_LIBDIR="`$PKG_CONFIG --variable=libdir gio-2.0`" + +cat >>confdefs.h <<_ACEOF +#define GIO_LIBDIR "$GIO_LIBDIR" +_ACEOF + + + + + + + + + module=gstreamer-$GST_API_VERSION + minver=$GST_REQ + name="GStreamer" + required=yes + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST" >&5 +$as_echo_n "checking for GST... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GST_CFLAGS"; then + pkg_cv_GST_CFLAGS="$GST_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GST_LIBS"; then + pkg_cv_GST_LIBS="$GST_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GST_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` + else + GST_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GST_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + HAVE_GST="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +elif test $pkg_failed = untried; then + + HAVE_GST="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +else + GST_CFLAGS=$pkg_cv_GST_CFLAGS + GST_LIBS=$pkg_cv_GST_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + HAVE_GST="yes" + +fi + + + if test -z $GST_TOOLS_DIR; then + GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_API_VERSION` + if test -z $GST_TOOLS_DIR; then + as_fn_error $? "no tools dir set in GStreamer pkg-config file, core upgrade needed." "$LINENO" 5 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: using GStreamer tools in $GST_TOOLS_DIR" >&5 +$as_echo "$as_me: using GStreamer tools in $GST_TOOLS_DIR" >&6;} + + + if test -z $GST_PLUGINS_DIR; then + GST_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-$GST_API_VERSION` + if test -z $GST_PLUGINS_DIR; then + as_fn_error $? "no pluginsdir set in GStreamer pkg-config file, core upgrade needed." "$LINENO" 5 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: using GStreamer plug-ins in $GST_PLUGINS_DIR" >&5 +$as_echo "$as_me: using GStreamer plug-ins in $GST_PLUGINS_DIR" >&6;} + + + +GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_API_VERSION` +if test -z $GST_TOOLS_DIR; then + as_fn_error $? "no tools dir defined in GStreamer pkg-config file; core upgrade needed." "$LINENO" 5 +fi + + +GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_API_VERSION --variable pluginsdir` + +{ $as_echo "$as_me:${as_lineno-$LINENO}: Using GStreamer Core Plugins in $GST_PLUGINS_DIR" >&5 +$as_echo "$as_me: Using GStreamer Core Plugins in $GST_PLUGINS_DIR" >&6;} + + + + module=gstreamer-base-$GST_API_VERSION + minver=$GST_REQ + name="GStreamer Base Libraries" + required=yes + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_BASE" >&5 +$as_echo_n "checking for GST_BASE... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GST_BASE_CFLAGS"; then + pkg_cv_GST_BASE_CFLAGS="$GST_BASE_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_BASE_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GST_BASE_LIBS"; then + pkg_cv_GST_BASE_LIBS="$GST_BASE_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_BASE_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GST_BASE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` + else + GST_BASE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GST_BASE_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + HAVE_GST_BASE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_BASE_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_BASE_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +elif test $pkg_failed = untried; then + + HAVE_GST_BASE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_BASE_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_BASE_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +else + GST_BASE_CFLAGS=$pkg_cv_GST_BASE_CFLAGS + GST_BASE_LIBS=$pkg_cv_GST_BASE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + HAVE_GST_BASE="yes" + +fi + + + + + + + module=gstreamer-plugins-base-$GST_API_VERSION + minver=$GSTPB_REQ + name="GStreamer Base Plugins" + required=yes + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_PLUGINS_BASE" >&5 +$as_echo_n "checking for GST_PLUGINS_BASE... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GST_PLUGINS_BASE_CFLAGS"; then + pkg_cv_GST_PLUGINS_BASE_CFLAGS="$GST_PLUGINS_BASE_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_PLUGINS_BASE_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GST_PLUGINS_BASE_LIBS"; then + pkg_cv_GST_PLUGINS_BASE_LIBS="$GST_PLUGINS_BASE_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_PLUGINS_BASE_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GST_PLUGINS_BASE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` + else + GST_PLUGINS_BASE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GST_PLUGINS_BASE_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + HAVE_GST_PLUGINS_BASE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PLUGINS_BASE_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PLUGINS_BASE_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +elif test $pkg_failed = untried; then + + HAVE_GST_PLUGINS_BASE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PLUGINS_BASE_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PLUGINS_BASE_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +else + GST_PLUGINS_BASE_CFLAGS=$pkg_cv_GST_PLUGINS_BASE_CFLAGS + GST_PLUGINS_BASE_LIBS=$pkg_cv_GST_PLUGINS_BASE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + HAVE_GST_PLUGINS_BASE="yes" + +fi + + + + if test "x$HAVE_GST_PLUGINS_BASE" = "xyes"; then + if test -z $GSTPB_PLUGINS_DIR; then + GSTPB_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-base-$GST_API_VERSION` + if test -z $GSTPB_PLUGINS_DIR; then + as_fn_error $? "no pluginsdir set in GStreamer Base Plugins pkg-config file" "$LINENO" 5 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR" >&5 +$as_echo "$as_me: using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR" >&6;} + GST_PLUGINS_BASE_DIR="$GSTPB_PLUGINS_DIR/gst:$GSTPB_PLUGINS_DIR/sys:$GSTPB_PLUGINS_DIR/ext" + + + fi + +GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_API_VERSION --variable pluginsdir` + +{ $as_echo "$as_me:${as_lineno-$LINENO}: Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR" >&5 +$as_echo "$as_me: Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR" >&6;} + + + + module=gstreamer-plugins-good-$GST_API_VERSION + minver=$GSTPG_REQ + name="GStreamer Good Plugins" + required=no + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_PLUGINS_GOOD" >&5 +$as_echo_n "checking for GST_PLUGINS_GOOD... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GST_PLUGINS_GOOD_CFLAGS"; then + pkg_cv_GST_PLUGINS_GOOD_CFLAGS="$GST_PLUGINS_GOOD_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_PLUGINS_GOOD_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GST_PLUGINS_GOOD_LIBS"; then + pkg_cv_GST_PLUGINS_GOOD_LIBS="$GST_PLUGINS_GOOD_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_PLUGINS_GOOD_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GST_PLUGINS_GOOD_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` + else + GST_PLUGINS_GOOD_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GST_PLUGINS_GOOD_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + HAVE_GST_PLUGINS_GOOD="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PLUGINS_GOOD_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PLUGINS_GOOD_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +elif test $pkg_failed = untried; then + + HAVE_GST_PLUGINS_GOOD="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PLUGINS_GOOD_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PLUGINS_GOOD_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +else + GST_PLUGINS_GOOD_CFLAGS=$pkg_cv_GST_PLUGINS_GOOD_CFLAGS + GST_PLUGINS_GOOD_LIBS=$pkg_cv_GST_PLUGINS_GOOD_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + HAVE_GST_PLUGINS_GOOD="yes" + +fi + + + + if test "x$HAVE_GST_PLUGINS_GOOD" = "xyes"; then + if test -z $GST_PLUGINS_GOOD_DIR; then + GST_PLUGINS_GOOD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-good-$GST_API_VERSION` + if test -z $GST_PLUGINS_GOOD_DIR; then + as_fn_error $? "no pluginsdir set in GStreamer Good Plugins pkg-config file" "$LINENO" 5 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: using GStreamer Good Plugins in $GST_PLUGINS_GOOD_DIR" >&5 +$as_echo "$as_me: using GStreamer Good Plugins in $GST_PLUGINS_GOOD_DIR" >&6;} + GST_PLUGINS_GOOD_DIR="$GST_PLUGINS_GOOD_DIR/gst:$GST_PLUGINS_GOOD_DIR/sys:$GST_PLUGINS_GOOD_DIR/ext" + + fi + +GSTPG_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-good-$GST_API_VERSION --variable pluginsdir` + +{ $as_echo "$as_me:${as_lineno-$LINENO}: Using GStreamer Good Plugins in $GSTPG_PLUGINS_DIR" >&5 +$as_echo "$as_me: Using GStreamer Good Plugins in $GSTPG_PLUGINS_DIR" >&6;} + + + + module=gstreamer-plugins-bad-$GST_API_VERSION + minver=$GSTPD_REQ + name="GStreamer Bad Plugins" + required=no + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_PLUGINS_BAD" >&5 +$as_echo_n "checking for GST_PLUGINS_BAD... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GST_PLUGINS_BAD_CFLAGS"; then + pkg_cv_GST_PLUGINS_BAD_CFLAGS="$GST_PLUGINS_BAD_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_PLUGINS_BAD_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GST_PLUGINS_BAD_LIBS"; then + pkg_cv_GST_PLUGINS_BAD_LIBS="$GST_PLUGINS_BAD_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_PLUGINS_BAD_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GST_PLUGINS_BAD_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` + else + GST_PLUGINS_BAD_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GST_PLUGINS_BAD_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + HAVE_GST_PLUGINS_BAD="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PLUGINS_BAD_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PLUGINS_BAD_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +elif test $pkg_failed = untried; then + + HAVE_GST_PLUGINS_BAD="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_PLUGINS_BAD_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_PLUGINS_BAD_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +else + GST_PLUGINS_BAD_CFLAGS=$pkg_cv_GST_PLUGINS_BAD_CFLAGS + GST_PLUGINS_BAD_LIBS=$pkg_cv_GST_PLUGINS_BAD_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + HAVE_GST_PLUGINS_BAD="yes" + +fi + + + + if test "x$HAVE_GST_PLUGINS_BAD" = "xyes"; then + if test -z $GST_PLUGINS_BAD_DIR; then + GST_PLUGINS_BAD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-bad-$GST_API_VERSION` + if test -z $GST_PLUGINS_BAD_DIR; then + as_fn_error $? "no pluginsdir set in GStreamer Bad Plugins pkg-config file" "$LINENO" 5 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: using GStreamer Bad Plugins in $GST_PLUGINS_BAD_DIR" >&5 +$as_echo "$as_me: using GStreamer Bad Plugins in $GST_PLUGINS_BAD_DIR" >&6;} + GST_PLUGINS_BAD_DIR="$GST_PLUGINS_BAD_DIR/gst:$GST_PLUGINS_BAD_DIR/sys:$GST_PLUGINS_BAD_DIR/ext" + + fi + +GSTPD_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-bad-$GST_API_VERSION --variable pluginsdir` + +{ $as_echo "$as_me:${as_lineno-$LINENO}: Using GStreamer Bad Plugins in $GSTPD_PLUGINS_DIR" >&5 +$as_echo "$as_me: Using GStreamer Bad Plugins in $GSTPD_PLUGINS_DIR" >&6;} + + + + module=gstreamer-check-$GST_API_VERSION + minver=$GST_REQ + name="GStreamer Check unittest Library" + required=no + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GST_CHECK" >&5 +$as_echo_n "checking for GST_CHECK... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GST_CHECK_CFLAGS"; then + pkg_cv_GST_CHECK_CFLAGS="$GST_CHECK_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_CHECK_CFLAGS=`$PKG_CONFIG --cflags "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GST_CHECK_LIBS"; then + pkg_cv_GST_CHECK_LIBS="$GST_CHECK_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$module >= \$minver\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$module >= $minver") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GST_CHECK_LIBS=`$PKG_CONFIG --libs "$module >= $minver" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GST_CHECK_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$module >= $minver"` + else + GST_CHECK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$module >= $minver"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GST_CHECK_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + HAVE_GST_CHECK="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_CHECK_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_CHECK_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +elif test $pkg_failed = untried; then + + HAVE_GST_CHECK="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: $GST_CHECK_PKG_ERRORS" >&5 +$as_echo "$as_me: $GST_CHECK_PKG_ERRORS" >&6;} + if test "x$required" = "xyes"; then + as_fn_error $? "no $module >= $minver ($name) found" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: no $module >= $minver ($name) found" >&5 +$as_echo "$as_me: no $module >= $minver ($name) found" >&6;} + fi + +else + GST_CHECK_CFLAGS=$pkg_cv_GST_CHECK_CFLAGS + GST_CHECK_LIBS=$pkg_cv_GST_CHECK_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + HAVE_GST_CHECK="yes" + +fi + + + + if test "x$HAVE_GST_CHECK" = "xyes"; then + HAVE_CHECK_TRUE= + HAVE_CHECK_FALSE='#' +else + HAVE_CHECK_TRUE='#' + HAVE_CHECK_FALSE= +fi + + +# Check whether --enable-Bsymbolic was given. +if test "${enable_Bsymbolic+set}" = set; then : + enableval=$enable_Bsymbolic; +else + SAVED_LDFLAGS="${LDFLAGS}" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Bsymbolic-functions linker flag" >&5 +$as_echo_n "checking for -Bsymbolic-functions linker flag... " >&6; } + LDFLAGS=-Wl,-Bsymbolic-functions + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +int main (void) { return 0; } + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + enable_Bsymbolic=yes +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + enable_Bsymbolic=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="${SAVED_LDFLAGS}" +fi + + + +GST_LICENSE="LGPL" + +cat >>confdefs.h <<_ACEOF +#define GST_LICENSE "$GST_LICENSE" +_ACEOF + + + + + + EXP_VAR=PLUGINDIR + FROM_VAR=${libdir}/gstreamer-$GST_API_VERSION + + prefix_save=$prefix + exec_prefix_save=$exec_prefix + + if test "x$prefix" = "xNONE"; then + prefix="$ac_default_prefix" + fi + if test "x$exec_prefix" = "xNONE"; then + exec_prefix=$prefix + fi + + full_var="$FROM_VAR" + while true; do + new_full_var="`eval echo $full_var`" + if test "x$new_full_var" = "x$full_var"; then break; fi + full_var=$new_full_var + done + + full_var=$new_full_var + PLUGINDIR="$full_var" + + + prefix=$prefix_save + exec_prefix=$exec_prefix_save + + +cat >>confdefs.h <<_ACEOF +#define PLUGINDIR "$PLUGINDIR" +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $PLUGINDIR as the plugin install location" >&5 +$as_echo "$as_me: Using $PLUGINDIR as the plugin install location" >&6;} + + plugindir="\$(libdir)/gstreamer-$GST_API_VERSION" + + + + + if test "x$PACKAGE_VERSION_NANO" = "x0"; then + + if test "xyes" = "xno" -o "xyes" = "x"; then + GST_PACKAGE_RELEASE_DATETIME=`date -u "+%Y-%m-%dT%H:%MZ"` + elif test "xyes" = "xyes"; then + if ( echo yes | grep '^201-90-9-0-10-9-0-30-9' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=yes + else + YYYY_MM_DD=`sh "${srcdir}/common/extract-release-date-from-doap-file" $PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO "${srcdir}/gst-rtsp-server.doap" `; + if test "x$YYYY_MM_DD" != "x"; then + GST_PACKAGE_RELEASE_DATETIME=$YYYY_MM_DD + else + as_fn_error $? "SET_PACKAGE_RELEASE_DATETIME: could not extract + release date for release version $PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO from \"${srcdir}/gst-rtsp-server.doap\" " "$LINENO" 5 + GST_PACKAGE_RELEASE_DATETIME="" + fi + fi + elif ( echo yes | grep '^201-90-9-0-10-9-0-30-9' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&5 +$as_echo "$as_me: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&2;} + GST_PACKAGE_RELEASE_DATETIME="" + fi + + if test "x$GST_PACKAGE_RELEASE_DATETIME" = "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&2;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&6;} + + +cat >>confdefs.h <<_ACEOF +#define GST_PACKAGE_RELEASE_DATETIME "$GST_PACKAGE_RELEASE_DATETIME" +_ACEOF + + fi + + else + + if test "xno" = "xno" -o "xno" = "x"; then + GST_PACKAGE_RELEASE_DATETIME=`date -u "+%Y-%m-%dT%H:%MZ"` + elif test "xno" = "xyes"; then + if ( echo no | grep '^201-90-9-0-10-9-0-30-9' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=no + else + YYYY_MM_DD=`sh "${srcdir}/common/extract-release-date-from-doap-file" `; + if test "x$YYYY_MM_DD" != "x"; then + GST_PACKAGE_RELEASE_DATETIME=$YYYY_MM_DD + else + as_fn_error $? "SET_PACKAGE_RELEASE_DATETIME: could not extract + release date for release version from " "$LINENO" 5 + GST_PACKAGE_RELEASE_DATETIME="" + fi + fi + elif ( echo no | grep '^201-90-9-0-10-9-0-30-9' >/dev/null ) ; then + GST_PACKAGE_RELEASE_DATETIME=no + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&5 +$as_echo "$as_me: WARNING: SET_PACKAGE_RELEASE_DATETIME: invalid first argument" >&2;} + GST_PACKAGE_RELEASE_DATETIME="" + fi + + if test "x$GST_PACKAGE_RELEASE_DATETIME" = "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: WARNING: Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME" >&2;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&5 +$as_echo "$as_me: Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME" >&6;} + + +cat >>confdefs.h <<_ACEOF +#define GST_PACKAGE_RELEASE_DATETIME "$GST_PACKAGE_RELEASE_DATETIME" +_ACEOF + + fi + + fi + + +# set by AG_GST_PARSE_SUBSYSTEM_DISABLES above +NO_WARNINGS="" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the GStreamer debugging system is enabled" >&5 +$as_echo_n "checking whether the GStreamer debugging system is enabled... " >&6; } + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + save_CFLAGS="$CFLAGS" + CFLAGS="$GST_CFLAGS $CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #ifdef GST_DISABLE_GST_DEBUG + #error "debugging disabled, make compiler fail" + #endif +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + debug_system_enabled=yes +else + debug_system_enabled=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $debug_system_enabled" >&5 +$as_echo "$debug_system_enabled" >&6; } + + if test "x$debug_system_enabled" = "xyes" ; then + NO_WARNINGS="" + true + else + NO_WARNINGS="-Wno-unused" + true + fi + + + + + + + WARNING_CFLAGS="" + ERROR_CFLAGS="" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wall" >&5 +$as_echo_n "checking to see if compiler understands -Wall... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wall" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + WARNING_CFLAGS="$WARNING_CFLAGS -Wall" + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wdeclaration-after-statement" >&5 +$as_echo_n "checking to see if compiler understands -Wdeclaration-after-statement... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wdeclaration-after-statement" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + WARNING_CFLAGS="$WARNING_CFLAGS -Wdeclaration-after-statement" + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wvla" >&5 +$as_echo_n "checking to see if compiler understands -Wvla... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wvla" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + WARNING_CFLAGS="$WARNING_CFLAGS -Wvla" + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wpointer-arith" >&5 +$as_echo_n "checking to see if compiler understands -Wpointer-arith... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wpointer-arith" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + WARNING_CFLAGS="$WARNING_CFLAGS -Wpointer-arith" + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + + if test "x$FATAL_WARNINGS" != "xno" + then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Werror" >&5 +$as_echo_n "checking to see if compiler understands -Werror... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + ERROR_CFLAGS="$ERROR_CFLAGS -Werror" + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + + if test "x$ERROR_CFLAGS" = "x" + then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -errwarn=%all" >&5 +$as_echo_n "checking to see if compiler understands -errwarn=%all... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -errwarn=%all" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + + ERROR_CFLAGS="-errwarn=%all" + for f in 'no%E_EMPTY_DECLARATION' \ + 'no%E_STATEMENT_NOT_REACHED' \ + 'no%E_ARGUEMENT_MISMATCH' \ + 'no%E_MACRO_REDEFINED' \ + 'no%E_LOOP_NOT_ENTERED_AT_TOP' + do + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -errwarn=%all,$f" >&5 +$as_echo_n "checking to see if compiler understands -errwarn=%all,$f... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -errwarn=%all,$f" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + + ERROR_CFLAGS="$ERROR_CFLAGS,$f" + + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + done + + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 < 2.19.8\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 < 2.19.8") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -fno-strict-aliasing" >&5 +$as_echo_n "checking to see if compiler understands -fno-strict-aliasing... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-strict-aliasing" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + ERROR_CFLAGS="$ERROR_CFLAGS -fno-strict-aliasing" + true + else + + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + +fi + fi + fi + + if test "x-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs $NO_WARNINGS" != "x" + then + UNSUPPORTED="" + list="-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs $NO_WARNINGS" + for each in $list + do + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands $each" >&5 +$as_echo_n "checking to see if compiler understands $each... " >&6; } + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $each" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + flag_ok=yes +else + flag_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + WARNING_CFLAGS="$WARNING_CFLAGS $each" + true + else + UNSUPPORTED="$UNSUPPORTED $each" + true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 +$as_echo "$flag_ok" >&6; } + + done + if test "X$UNSUPPORTED" != X ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: unsupported compiler flags: $UNSUPPORTED" >&5 +$as_echo "$as_me: unsupported compiler flags: $UNSUPPORTED" >&6;} + fi + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: set WARNING_CFLAGS to $WARNING_CFLAGS" >&5 +$as_echo "$as_me: set WARNING_CFLAGS to $WARNING_CFLAGS" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: set ERROR_CFLAGS to $ERROR_CFLAGS" >&5 +$as_echo "$as_me: set ERROR_CFLAGS to $ERROR_CFLAGS" >&6;} + + + + if test "x$GST_GIT" = "xyes"; then + GST_LEVEL_DEFAULT=GST_LEVEL_ERROR + else + GST_LEVEL_DEFAULT=GST_LEVEL_NONE + fi + +cat >>confdefs.h <<_ACEOF +#define GST_LEVEL_DEFAULT $GST_LEVEL_DEFAULT +_ACEOF + + + + + + DEFAULT_AUDIOSINK="autoaudiosink" + DEFAULT_VIDEOSINK="autovideosink" + DEFAULT_AUDIOSRC="alsasrc" + DEFAULT_VIDEOSRC="v4l2src" + DEFAULT_VISUALIZER="goom" + case "$host" in + *-sun-* | *pc-solaris* ) + DEFAULT_AUDIOSRC="sunaudiosrc" + ;; + *-darwin* ) + DEFAULT_AUDIOSRC="osxaudiosrc" + ;; + esac + + +# Check whether --with-default-audiosink was given. +if test "${with_default_audiosink+set}" = set; then : + withval=$with_default_audiosink; + case "${withval}" in + yes) as_fn_error $? "bad value ${withval} for --with-default-audiosink" "$LINENO" 5 ;; + no) as_fn_error $? "bad value ${withval} for --with-default-audiosink" "$LINENO" 5 ;; + *) DEFAULT_AUDIOSINK="${withval}" ;; + esac + +else + + DEFAULT_AUDIOSINK="$DEFAULT_AUDIOSINK" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $DEFAULT_AUDIOSINK as default audio sink" >&5 +$as_echo "$as_me: Using $DEFAULT_AUDIOSINK as default audio sink" >&6;} + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_AUDIOSINK "$DEFAULT_AUDIOSINK" +_ACEOF + + + +# Check whether --with-default-audiosrc was given. +if test "${with_default_audiosrc+set}" = set; then : + withval=$with_default_audiosrc; + case "${withval}" in + yes) as_fn_error $? "bad value ${withval} for --with-default-audiosrc" "$LINENO" 5 ;; + no) as_fn_error $? "bad value ${withval} for --with-default-audiosrc" "$LINENO" 5 ;; + *) DEFAULT_AUDIOSRC="${withval}" ;; + esac + +else + + DEFAULT_AUDIOSRC="$DEFAULT_AUDIOSRC" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $DEFAULT_AUDIOSRC as default audio source" >&5 +$as_echo "$as_me: Using $DEFAULT_AUDIOSRC as default audio source" >&6;} + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_AUDIOSRC "$DEFAULT_AUDIOSRC" +_ACEOF + + + +# Check whether --with-default-videosink was given. +if test "${with_default_videosink+set}" = set; then : + withval=$with_default_videosink; + case "${withval}" in + yes) as_fn_error $? "bad value ${withval} for --with-default-videosink" "$LINENO" 5 ;; + no) as_fn_error $? "bad value ${withval} for --with-default-videosink" "$LINENO" 5 ;; + *) DEFAULT_VIDEOSINK="${withval}" ;; + esac + +else + + DEFAULT_VIDEOSINK="$DEFAULT_VIDEOSINK" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $DEFAULT_VIDEOSINK as default video sink" >&5 +$as_echo "$as_me: Using $DEFAULT_VIDEOSINK as default video sink" >&6;} + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_VIDEOSINK "$DEFAULT_VIDEOSINK" +_ACEOF + + + +# Check whether --with-default-videosrc was given. +if test "${with_default_videosrc+set}" = set; then : + withval=$with_default_videosrc; + case "${withval}" in + yes) as_fn_error $? "bad value ${withval} for --with-default-videosrc" "$LINENO" 5 ;; + no) as_fn_error $? "bad value ${withval} for --with-default-videosrc" "$LINENO" 5 ;; + *) DEFAULT_VIDEOSRC="${withval}" ;; + esac + +else + + DEFAULT_VIDEOSRC="$DEFAULT_VIDEOSRC" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $DEFAULT_VIDEOSRC as default video source" >&5 +$as_echo "$as_me: Using $DEFAULT_VIDEOSRC as default video source" >&6;} + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_VIDEOSRC "$DEFAULT_VIDEOSRC" +_ACEOF + + + +# Check whether --with-default-visualizer was given. +if test "${with_default_visualizer+set}" = set; then : + withval=$with_default_visualizer; + case "${withval}" in + yes) as_fn_error $? "bad value ${withval} for --with-default-visualizer" "$LINENO" 5 ;; + no) as_fn_error $? "bad value ${withval} for --with-default-visualizer" "$LINENO" 5 ;; + *) DEFAULT_VISUALIZER="${withval}" ;; + esac + +else + + DEFAULT_VISUALIZER="$DEFAULT_VISUALIZER" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $DEFAULT_VISUALIZER as default visualizer" >&5 +$as_echo "$as_me: Using $DEFAULT_VISUALIZER as default visualizer" >&6;} + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_VISUALIZER "$DEFAULT_VISUALIZER" +_ACEOF + + + + + +if test "x$USE_DEBUG" = xyes; then + PROFILE_CFLAGS="-g" +fi + + +# GST_DISABLE_DEPRECATED: hide the visibility of deprecated +# functionality from the API that gstreamer uses +# GST_REMOVE_DEPRECATED: don't compile deprecated functionality (breaks ABI) +if test "x$PACKAGE_VERSION_NANO" = "x1"; then + DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED" +else + DEPRECATED_CFLAGS="" +fi + + +GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)" + + +GST_CFLAGS="$GST_CFLAGS \$(GST_OPTION_CFLAGS)" + + + +GST_ALL_CFLAGS="-I\$(top_srcdir) -I\$(top_builddir) $GST_PLUGINS_BASE_CFLAGS $GST_CFLAGS \$(GST_OPTION_CFLAGS)" + + +GST_ALL_LIBS="$GST_LIBS $LTLIBINTL \$(GCOV_LIBS)" + + +GST_ALL_LDFLAGS="-no-undefined" +if test "x${enable_Bsymbolic}" = "xyes"; then + GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions" +fi + + + +GST_LIB_LDFLAGS="-export-symbols-regex \^_?\(gst_\|Gst\|GST_\).*" + + +GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)" + +GST_OBJ_LIBS="\$(top_builddir)/gst/rtsp-server/libgstrtspserver-$GST_API_VERSION.la \$(GST_ALL_LIBS)" + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCGROUP" >&5 +$as_echo_n "checking for LIBCGROUP... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$LIBCGROUP_CFLAGS"; then + pkg_cv_LIBCGROUP_CFLAGS="$LIBCGROUP_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcgroup >= 0.26\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcgroup >= 0.26") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBCGROUP_CFLAGS=`$PKG_CONFIG --cflags "libcgroup >= 0.26" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$LIBCGROUP_LIBS"; then + pkg_cv_LIBCGROUP_LIBS="$LIBCGROUP_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcgroup >= 0.26\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcgroup >= 0.26") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBCGROUP_LIBS=`$PKG_CONFIG --libs "libcgroup >= 0.26" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBCGROUP_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libcgroup >= 0.26"` + else + LIBCGROUP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libcgroup >= 0.26"` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBCGROUP_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_LIBCGROUP="no" +elif test $pkg_failed = untried; then + HAVE_LIBCGROUP="no" +else + LIBCGROUP_CFLAGS=$pkg_cv_LIBCGROUP_CFLAGS + LIBCGROUP_LIBS=$pkg_cv_LIBCGROUP_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_LIBCGROUP="yes" +fi + + + if test "x$HAVE_LIBCGROUP" = "xyes"; then + HAVE_LIBCGROUP_TRUE= + HAVE_LIBCGROUP_FALSE='#' +else + HAVE_LIBCGROUP_TRUE='#' + HAVE_LIBCGROUP_FALSE= +fi + + + + +ac_config_files="$ac_config_files Makefile gst-rtsp.spec common/Makefile common/m4/Makefile gst/Makefile gst/rtsp-server/Makefile examples/Makefile tests/Makefile tests/check/Makefile pkgconfig/Makefile pkgconfig/gstreamer-rtsp-server.pc pkgconfig/gstreamer-rtsp-server-uninstalled.pc docs/Makefile docs/version.entities docs/libs/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GST_GCOV_ENABLED_TRUE}" && test -z "${GST_GCOV_ENABLED_FALSE}"; then + as_fn_error $? "conditional \"GST_GCOV_ENABLED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_TESTS_TRUE}" && test -z "${BUILD_TESTS_FALSE}"; then + as_fn_error $? "conditional \"BUILD_TESTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_VALGRIND_TRUE}" && test -z "${HAVE_VALGRIND_FALSE}"; then + as_fn_error $? "conditional \"HAVE_VALGRIND\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_INTROSPECTION_TRUE}" && test -z "${HAVE_INTROSPECTION_FALSE}"; then + as_fn_error $? "conditional \"HAVE_INTROSPECTION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_DOCBOOK_TRUE}" && test -z "${ENABLE_DOCBOOK_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_DOCBOOK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DOC_HTML_TRUE}" && test -z "${DOC_HTML_FALSE}"; then + as_fn_error $? "conditional \"DOC_HTML\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DOC_PDF_TRUE}" && test -z "${DOC_PDF_FALSE}"; then + as_fn_error $? "conditional \"DOC_PDF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DOC_PS_TRUE}" && test -z "${DOC_PS_FALSE}"; then + as_fn_error $? "conditional \"DOC_PS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CHECK_TRUE}" && test -z "${HAVE_CHECK_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CHECK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LIBCGROUP_TRUE}" && test -z "${HAVE_LIBCGROUP_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LIBCGROUP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by GStreamer RTSP Server Library $as_me 1.4.1, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +GStreamer RTSP Server Library config.status 1.4.1 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# 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 + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "gst-rtsp.spec") CONFIG_FILES="$CONFIG_FILES gst-rtsp.spec" ;; + "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; + "common/m4/Makefile") CONFIG_FILES="$CONFIG_FILES common/m4/Makefile" ;; + "gst/Makefile") CONFIG_FILES="$CONFIG_FILES gst/Makefile" ;; + "gst/rtsp-server/Makefile") CONFIG_FILES="$CONFIG_FILES gst/rtsp-server/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests/check/Makefile") CONFIG_FILES="$CONFIG_FILES tests/check/Makefile" ;; + "pkgconfig/Makefile") CONFIG_FILES="$CONFIG_FILES pkgconfig/Makefile" ;; + "pkgconfig/gstreamer-rtsp-server.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/gstreamer-rtsp-server.pc" ;; + "pkgconfig/gstreamer-rtsp-server-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/gstreamer-rtsp-server-uninstalled.pc" ;; + "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; + "docs/version.entities") CONFIG_FILES="$CONFIG_FILES docs/version.entities" ;; + "docs/libs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/libs/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. 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 " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($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. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# 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 + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# 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 + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# 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 + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# 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 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# 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=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + 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 + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # 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) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +echo " + +Configuration + Version : ${VERSION} + Source code location : ${srcdir} + Prefix : ${prefix} + Compiler : ${CC} + CGroups example : ${HAVE_LIBCGROUP} + +gst-rtsp-server configured. Type 'make' to build. +" diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..5c7802c --- /dev/null +++ b/configure.ac @@ -0,0 +1,344 @@ +AC_PREREQ(2.62) +dnl initialize autoconf +dnl when going to/from release please set the nano (fourth number) right ! +dnl releases only do Wall, cvs and prerelease does Werror too +AC_INIT([GStreamer RTSP Server Library], [1.4.1], + [http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer], + [gst-rtsp-server]) +AG_GST_INIT + +dnl initialize automake +AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar subdir-objects]) + +dnl define PACKAGE_VERSION_* variables +AS_VERSION + +dnl check if this is a release version +AS_NANO(GST_GIT="no", GST_GIT="yes") + +dnl can autoconf find the source ? +AC_CONFIG_SRCDIR([gst/rtsp-server/rtsp-server.c]) + +dnl define the output header for config +AC_CONFIG_HEADERS([config.h]) + +dnl AM_MAINTAINER_MODE only provides the option to configure to enable it +AM_MAINTAINER_MODE([enable]) + +dnl sets host_* variables +AC_CANONICAL_HOST + +dnl use pretty build output with automake >= 1.11 +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])], + [AM_DEFAULT_VERBOSITY=1 + AC_SUBST(AM_DEFAULT_VERBOSITY)]) + +dnl our libraries and install dirs use major.minor as a version +dnl GST_API_VERSION=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR +dnl we override it here if we need to for the release candidate of new series +GST_API_VERSION=1.0 +AC_SUBST(GST_API_VERSION) + +dnl CURRENT, REVISION, AGE +dnl - library source changed -> increment REVISION +dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0 +dnl - interfaces added -> increment AGE +dnl - interfaces removed -> AGE = 0 +dnl +dnl Keep CURRENT as MINOR * 100 + MICRO +dnl Ex : 1.0.0 => 0 +dnl 1.0.3 => 3 +dnl 1.1.0 => 100 +dnl 1.2.5 => 205 +dnl 1.10.9 (who knows) => 1009 +dnl +dnl sets GST_LT_LDFLAGS +AS_LIBTOOL(GST, 401, 0, 401) + +dnl *** required versions of GStreamer stuff *** +GST_REQ=1.4.0 +GSTPB_REQ=1.4.0 +GSTPG_REQ=1.4.0 +GSTPD_REQ=1.4.0 + +dnl *** autotools stuff **** + +dnl allow for different autotools +AS_AUTOTOOLS_ALTERNATE + +dnl Add parameters for aclocal +AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4") +AC_CONFIG_MACRO_DIR([m4]) + +dnl set up gettext +dnl the version check needs to stay here because autopoint greps for it +#AM_GNU_GETTEXT_VERSION([0.17]) +#AM_GNU_GETTEXT([external]) +#AG_GST_GETTEXT([gst-rtsp-server-$GST_API_VERSION]) + +dnl *** check for arguments to configure *** + +AG_GST_ARG_DISABLE_FATAL_WARNINGS + +AG_GST_ARG_DEBUG +AG_GST_ARG_VALGRIND +AG_GST_ARG_GCOV +AG_GST_ARG_WITH_PKG_CONFIG_PATH +AG_GST_ARG_WITH_PACKAGE_NAME +AG_GST_ARG_WITH_PACKAGE_ORIGIN + +AG_GST_PKG_CONFIG_PATH + +AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO], + ["${srcdir}/gst-rtsp-server.doap"], + [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO]) + +dnl building of tests +AC_ARG_ENABLE(tests, + AS_HELP_STRING([--disable-tests],[disable building test apps]), + [ + case "${enableval}" in + yes) BUILD_TESTS=yes ;; + no) BUILD_TESTS=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;; + esac + ], +[BUILD_TESTS=yes]) dnl Default value +AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes") + +dnl *** checks for platform *** + +dnl * hardware/architecture * + +dnl *** checks for programs *** + +dnl find a compiler +AC_PROG_CC +AC_PROG_CC_STDC + +dnl check if the compiler supports '-c' and '-o' options +AM_PROG_CC_C_O + +dnl find an assembler +AM_PROG_AS + +AC_PATH_PROG(VALGRIND_PATH, valgrind, no) +AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno") + +dnl check for gobject-introspection +GOBJECT_INTROSPECTION_CHECK([1.31.1]) + +dnl check for documentation tools +AG_GST_DOCBOOK_CHECK +GTK_DOC_CHECK([1.12]) + +dnl *** checks for libraries *** + +dnl *** checks for header files *** + +dnl *** checks for types/defines *** + +dnl *** checks for structures *** + +dnl *** checks for compiler characteristics *** + +dnl *** checks for library functions *** + +dnl *** checks for dependancy libraries *** + +dnl GLib is required +GLIB_REQ=2.32.0 +AC_SUBST([GLIB_REQ]) +AG_GST_GLIB_CHECK([$GLIB_REQ]) + +dnl checks for gstreamer +dnl uninstalled is selected preferentially -- see pkg-config(1) +AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], [yes]) + +GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_API_VERSION` +if test -z $GST_TOOLS_DIR; then + AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.]) +fi +AC_SUBST(GST_TOOLS_DIR) + +GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_API_VERSION --variable pluginsdir` +AC_SUBST(GST_PLUGINS_DIR) +AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR) + +AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], [yes]) + +AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], [yes]) +GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_API_VERSION --variable pluginsdir` +AC_SUBST(GSTPB_PLUGINS_DIR) +AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR) + +AG_GST_CHECK_GST_PLUGINS_GOOD($GST_API_VERSION, [$GSTPG_REQ], [yes]) +GSTPG_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-good-$GST_API_VERSION --variable pluginsdir` +AC_SUBST(GSTPG_PLUGINS_DIR) +AC_MSG_NOTICE(Using GStreamer Good Plugins in $GSTPG_PLUGINS_DIR) + +AG_GST_CHECK_GST_PLUGINS_BAD($GST_API_VERSION, [$GSTPD_REQ], [yes]) +GSTPD_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-bad-$GST_API_VERSION --variable pluginsdir` +AC_SUBST(GSTPD_PLUGINS_DIR) +AC_MSG_NOTICE(Using GStreamer Bad Plugins in $GSTPD_PLUGINS_DIR) + +AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no) +AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_GST_CHECK" = "xyes") + +dnl Check for -Bsymbolic-functions linker flag used to avoid +dnl intra-library PLT jumps, if available. +AC_ARG_ENABLE(Bsymbolic, + [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],, + [SAVED_LDFLAGS="${LDFLAGS}" + AC_MSG_CHECKING([for -Bsymbolic-functions linker flag]) + LDFLAGS=-Wl,-Bsymbolic-functions + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int main (void) { return 0; }]])],[ + AC_MSG_RESULT(yes) + enable_Bsymbolic=yes],[ + AC_MSG_RESULT(no) + enable_Bsymbolic=no]) + LDFLAGS="${SAVED_LDFLAGS}"]) + +dnl *** set variables based on configure arguments *** + +dnl set license and copyright notice +GST_LICENSE="LGPL" +AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license]) +AC_SUBST(GST_LICENSE) + +dnl set location of plugin directory +AG_GST_SET_PLUGINDIR + +dnl set release date/time (and check that release version is in doap file) +AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO], + ["${srcdir}/gst-rtsp-server.doap"], + [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO]) + +# set by AG_GST_PARSE_SUBSYSTEM_DISABLES above +dnl make sure it doesn't complain about unused variables if debugging is disabled +NO_WARNINGS="" +AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""]) + +dnl define an ERROR_CFLAGS Makefile variable +AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs $NO_WARNINGS]) + +dnl define correct level for debugging messages +AG_GST_SET_LEVEL_DEFAULT($GST_GIT) + +dnl used in examples +AG_GST_DEFAULT_ELEMENTS + +dnl *** finalize CFLAGS, LDFLAGS, LIBS + +dnl Overview: +dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ... +dnl GST_*: flags shared by built objects to link against GStreamer +dnl GST_ALL_LDFLAGS: linker flags shared by all +dnl GST_LIB_LDFLAGS: additional linker flags for all libaries +dnl GST_LT_LDFLAGS: library versioning of our libraries +dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins + +dnl GST_OPTION_CFLAGS +if test "x$USE_DEBUG" = xyes; then + PROFILE_CFLAGS="-g" +fi +AC_SUBST(PROFILE_CFLAGS) + +# GST_DISABLE_DEPRECATED: hide the visibility of deprecated +# functionality from the API that gstreamer uses +# GST_REMOVE_DEPRECATED: don't compile deprecated functionality (breaks ABI) +if test "x$PACKAGE_VERSION_NANO" = "x1"; then + dnl Define _only_ when compiling from git (not for pre-releases or releases) + DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED" +else + DEPRECATED_CFLAGS="" +fi +AC_SUBST(DEPRECATED_CFLAGS) + +dnl every flag in GST_OPTION_CFLAGS can be overridden at make time +GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)" +AC_SUBST(GST_OPTION_CFLAGS) + +dnl FIXME: do we want to rename to GST_ALL_* ? +dnl prefer internal headers to already installed ones +dnl add GST_OPTION_CFLAGS, but overridable +GST_CFLAGS="$GST_CFLAGS \$(GST_OPTION_CFLAGS)" +AC_SUBST(GST_CFLAGS) +AC_SUBST(GST_LIBS) + +dnl GST_ALL_* +dnl vars common to for all internal objects (core libs, elements, applications) +dnl CFLAGS: +dnl - src and build dirs need to be added because every piece that gets built +dnl will need the GStreamer source and generated headers +GST_ALL_CFLAGS="-I\$(top_srcdir) -I\$(top_builddir) $GST_PLUGINS_BASE_CFLAGS $GST_CFLAGS \$(GST_OPTION_CFLAGS)" +AC_SUBST([GST_ALL_CFLAGS]) + +dnl FIXME: check if LTLIBINTL is needed everywhere +dnl I presume it is given that it contains the symbols that _() stuff maps to +GST_ALL_LIBS="$GST_LIBS $LTLIBINTL \$(GCOV_LIBS)" +AC_SUBST([GST_ALL_LIBS]) + +dnl LDFLAGS really should only contain flags, not libs - they get added before +dnl whatevertarget_LIBS and -L flags here affect the rest of the linking +GST_ALL_LDFLAGS="-no-undefined" +if test "x${enable_Bsymbolic}" = "xyes"; then + GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions" +fi + +AC_SUBST(GST_ALL_LDFLAGS) + +dnl GST_LIB_LDFLAGS +dnl linker flags shared by all libraries +dnl LDFLAGS modifier defining exported symbols from built libraries +GST_LIB_LDFLAGS="-export-symbols-regex \^[_]?\(gst_\|Gst\|GST_\).*" +AC_SUBST(GST_LIB_LDFLAGS) + +dnl GST_OBJ_* +dnl default vars for all internal objects built on libgstrtspserver +dnl includes GST_ALL_* +GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)" +AC_SUBST([GST_OBJ_CFLAGS]) +GST_OBJ_LIBS="\$(top_builddir)/gst/rtsp-server/libgstrtspserver-$GST_API_VERSION.la \$(GST_ALL_LIBS)" +AC_SUBST([GST_OBJ_LIBS]) + +PKG_CHECK_MODULES(LIBCGROUP, libcgroup >= 0.26, HAVE_LIBCGROUP="yes", HAVE_LIBCGROUP="no") +AC_SUBST(LIBCGROUP_CFLAGS) +AC_SUBST(LIBCGROUP_LIBS) +AM_CONDITIONAL(HAVE_LIBCGROUP, test "x$HAVE_LIBCGROUP" = "xyes") + +dnl this really should only contain flags, not libs - they get added before +dnl whatevertarget_LIBS and -L flags here affect the rest of the linking + +dnl *** output files *** + +dnl keep this alphabetic per directory, please +AC_CONFIG_FILES([ +Makefile +common/Makefile +common/m4/Makefile +gst/Makefile +gst/rtsp-server/Makefile +examples/Makefile +tests/Makefile +tests/check/Makefile +pkgconfig/Makefile +pkgconfig/gstreamer-rtsp-server.pc +pkgconfig/gstreamer-rtsp-server-uninstalled.pc +docs/Makefile +docs/version.entities +docs/libs/Makefile +]) +AC_OUTPUT + +echo " + +Configuration + Version : ${VERSION} + Source code location : ${srcdir} + Prefix : ${prefix} + Compiler : ${CC} + CGroups example : ${HAVE_LIBCGROUP} + +gst-rtsp-server configured. Type 'make' to build. +" diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..4ebd5b3 --- /dev/null +++ b/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2013-05-30.07; # UTC + +# Copyright (C) 1999-2013 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, see . + +# 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 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'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +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 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..9f9f150 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,20 @@ +if ENABLE_GTK_DOC +DOCS_SUBDIRS = libs +else +DOCS_SUBDIRS = +endif + +SUBDIRS = $(DOCS_SUBDIRS) +DIST_SUBDIRS = libs + +EXTRA_DIST = \ + version.entities.in + +upload: + @if test "x$(SUBDIRS)" != x; then \ + for a in $(SUBDIRS); do \ + cd $$a; \ + make upload; \ + cd ..; \ + done; \ + fi diff --git a/docs/Makefile.in b/docs/Makefile.in new file mode 100644 index 0000000..3aa1228 --- /dev/null +++ b/docs/Makefile.in @@ -0,0 +1,751 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = docs +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/version.entities.in README +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-docbook.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-doc.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/introspection.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = version.entities +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAT_ENTRY_END = @CAT_ENTRY_END@ +CAT_ENTRY_START = @CAT_ENTRY_START@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPD_PLUGINS_DIR = @GSTPD_PLUGINS_DIR@ +GSTPG_PLUGINS_DIR = @GSTPG_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALL_CFLAGS = @GST_ALL_CFLAGS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_ALL_LIBS = @GST_ALL_LIBS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OBJ_CFLAGS = @GST_OBJ_CFLAGS@ +GST_OBJ_LIBS = @GST_OBJ_LIBS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PKG_CONFIG_PATH = @GST_PKG_CONFIG_PATH@ +GST_PLUGINS_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@ +GST_PLUGINS_BAD_DIR = @GST_PLUGINS_BAD_DIR@ +GST_PLUGINS_BAD_LIBS = @GST_PLUGINS_BAD_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@ +GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@ +GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ +HAVE_DVIPS = @HAVE_DVIPS@ +HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ +HAVE_JADETEX = @HAVE_JADETEX@ +HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ +HAVE_PNMTOPS = @HAVE_PNMTOPS@ +HAVE_PS2PDF = @HAVE_PS2PDF@ +HAVE_XMLLINT = @HAVE_XMLLINT@ +HAVE_XSLTPROC = @HAVE_XSLTPROC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCGROUP_CFLAGS = @LIBCGROUP_CFLAGS@ +LIBCGROUP_LIBS = @LIBCGROUP_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XML_CATALOG = @XML_CATALOG@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +@ENABLE_GTK_DOC_FALSE@DOCS_SUBDIRS = +@ENABLE_GTK_DOC_TRUE@DOCS_SUBDIRS = libs +SUBDIRS = $(DOCS_SUBDIRS) +DIST_SUBDIRS = libs +EXTRA_DIST = \ + version.entities.in + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +version.entities: $(top_builddir)/config.status $(srcdir)/version.entities.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + 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 || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + 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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean 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-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am + + +upload: + @if test "x$(SUBDIRS)" != x; then \ + for a in $(SUBDIRS); do \ + cd $$a; \ + make upload; \ + cd ..; \ + done; \ + fi + +# 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: diff --git a/docs/README b/docs/README new file mode 100644 index 0000000..e1cdc9c --- /dev/null +++ b/docs/README @@ -0,0 +1,498 @@ +README +------ + +(Last updated on Mon 15 jul 2013, version 0.11.90.1) + +This HOWTO describes the basic usage of the GStreamer RTSP libraries and how you +can build simple server applications with it. + +* General + + The server relies heavily on the RTSP infrastructure of GStreamer. This includes + all of the media acquisition, decoding, encoding, payloading and UDP/TCP + streaming. We use the rtpbin element for all the session management. Most of + the RTSP message parsing and construction in the server is done using the RTSP + library that comes with gst-plugins-base. + + The result is that the server is rather small (a few 11000 lines of code) and easy + to understand and extend. In its current state of development, things change + fast, API and ABI are unstable. We encourage people to use it for their various + use cases and participate by suggesting changes/features. + + Most of the server is built as a library containing a bunch of GObject objects + that provide reasonable default functionality but has a fair amount of hooks + to override the default behaviour. + + The server currently integrates with the glib mainloop nicely. It's currently + not meant to be used in high-load scenarios and because no security audit has + been done, you should probably not put it on a public IP address. + +* Initialisation + + You need to initialize GStreamer before using any of the RTSP server functions. + + #include + + int + main (int argc, char *argv[]) + { + gst_init (&argc, &argv); + + ... + } + + The server itself currently does not have any specific initialisation function + but that might change in the future. + + +* Creating the server + + The first thing you want to do is create a new GstRTSPServer object. This object + will handle all the new client connections to your server once it is added to a + GMainLoop. You can create a new server object like this: + + #include + + GstRTSPServer *server; + + server = gst_rtsp_server_new (); + + The server will by default listen on port 8554 for new connections. This can be + changed by calling gst_rtsp_server_set_service() or with the 'service' GObject + property. This makes it possible to run multiple server instances listening on + multiple ports on one machine. + + We can make the server start listening on its default port by attaching it to a + mainloop. The following example shows how this is done and will start a server + on the default 8554 port. For any request we make, we will get a NOT_FOUND + error code because we need to configure more things before the server becomes + useful. + + #include + #include + + int + main (int argc, char *argv[]) + { + GstRTSPServer *server; + GMainLoop *loop; + + gst_init (&argc, &argv); + + server = gst_rtsp_server_new (); + + /* make a mainloop for the default context */ + loop = g_main_loop_new (NULL, FALSE); + + /* attach the server to the default maincontext */ + gst_rtsp_server_attach (server, NULL); + + /* start serving */ + g_main_loop_run (loop); + } + + The server manages four other objects: GstRTSPSessionPool, + GstRTSPMountPoints, GstRTSPAuth and GstRTSPThreadPool. + + The GstRTSPSessionPool is an object that keeps track of all the active sessions + in the server. A session will usually be kept for each client that performed a + SETUP request for a certain media stream. It contains the configuration that + the client negotiated with the server to receive the particular stream, ie. the + transport used and port pairs for UDP along with the state of the streaming. + The default implementation of the session pool is usually sufficient but + alternative implementation can be used by the server. + + The GstRTSPMountPoints object is more interesting and needs more configuration + before the server object is useful. This object manages the mapping from a + request URL to a specific stream and its configuration. We explain in the next + topic how to configure this object. + + GstRTSPAuth is an object that authenticates users and authorizes actions + performed by users. By default, a server does not have a GstRTSPAuth object and + thus does not try to perform any authentication or authorization. + + GstRTSPThreadPool manages the threads used for client connections and media + pipelines. The server has a default implementation of a threadpool that should + be sufficient in most cases. + + +* Making url mount points + + Next we need to define what media is attached to a particular URL. What we want + to achieve is that when the user asks our server for a specific URL, say /test, + that we create (or reuse) a GStreamer pipeline that produces one or more RTP + streams. + + The object that can create such pipeline is called a GstRTSPMediaFactory object. + The default implementation of GstRTSPMediaFactory allows you to easily create + GStreamer pipelines using the gst-launch syntax. It is possible to create a + GstRTSPMediaFactory subclass that uses different methods for constructing + pipelines. + + The default GstRTSPMediaFactory can be configured with a gst-launch line that + produces a toplevel bin (use '(' and ')' around the pipeline description to + force a toplevel GstBin instead of the default GstPipeline toplevel element). + The pipeline description should contain elements named payN, one for each + stream (ex. pay0, pay1, ...). Also, for increased compatibility each stream + should have a different payload type which can be configured on the payloader. + + The following code snippet illustrates how to create a media factory that + creates an RTP feed of an H264 encoded test video signal. + + GstRTSPMediaFactory *factory; + + factory = gst_rtsp_media_factory_new (); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! x264enc ! rtph264pay pt=96 name=pay0 )"); + + Now that we have the media factory, we can attach it to a specific url. To do + this we get the default GstRTSPMountPoints from our server and add the url to + factory mount points to it like this: + + GstRTSPMountPoints *mounts; + + ...create server..create factory.. + + /* get the default mount points from the server */ + mounts = gst_rtsp_server_get_mount_points (server); + + /* attach the video test signal to the "/test" URL */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + g_object_unref (mounts); + + When starting the server now and directing an RTP client to the URL (like with + vlc, mplayer or gstreamer): + + rtsp://localhost:8554/test + + a test signal will be streamed to the client. The full example code can be + found in the examples/test-readme.c file. + + Note that by default the factory will create a new pipeline for each client. If + you want to share a pipeline between clients, use + gst_rtsp_media_factory_set_shared(). + + +* more on GstRTSPMediaFactory + + The GstRTSPMediaFactory is responsible for creating and caching GstRTSPMedia + objects. + + A freshly created GstRTSPMedia object from the factory initially only contains a + GstElement containing the elements to produce the RTP streams for the media and + a GPtrArray of GstRTSPStream objects describing the payloader and its source + pad. The media is unprepared in this state. + + Usually the url will determine what kind of pipeline should be created. You can + for example use query parameters to configure certain parts of the pipeline or + select encoders and payloaders based on some url pattern. + + When dealing with a live stream from, for example, a webcam, it can be + interesting to share the pipeline with multiple clients. This must be done when + only one instance of the video capture element can be used at a time. In this + case, the shared property of GstRTSPMedia must be used to instruct the default + GstRTSPMediaFactory implementation to cache the media. + + When all objects created from a factory can be shared, you can set the shared + property directly on the factory. + +* more on GstRTSPMedia + + After creating the GstRTSPMedia object from the factory, it can be prepared + with gst_rtsp_media_prepare(). This method will put those objects in a + GstPipeline and will construct and link the streaming elements and the + rtpbin session manager object. + + The _prepare() method will then preroll the pipeline in order to figure out the + caps on the payloaders. After the GstRTSPMedia prerolled it will be in the + prepared state and can be used for creating SDP files or for streaming to + clients. + + The prepare method will also create 2 UDP ports for each stream that can be + used for sending and receiving RTP/RTCP from clients. These port numbers will + have to be negotiated with the client in the SETUP requests. + + When preparing a GstRTSPMedia, an appsink and asppsrc is also constructed + for streaming the stream over TCP when requested. + + Media is prepared by the server when DESCRIBE or SETUP requests are received + from the client. + + +* the GstRTSPClient object + + When a server detects a new client connection on its port, it will accept the + connection, check if the connection is allowed and then call the vmethod + create_client. The default implementation of this function will create + a new GstRTCPClient object, will configure the session pool, mount points, + auth and thread pool objects in it. + + The server will then attach the new client to a server mainloop to let it + handle further communication with the client. In RTSP it is usual to keep + the connection open between multiple RTSP requests. The client watch will + be dispatched by the server mainloop when a new GstRTSPMessage is received, + which will then be handled and a response will be sent. + + The GstRTSPClient object remains alive for as long as a client has a TCP + connection open with the server. Since is possible for a client to open and close + the TCP connection between requests, we cannot store the state related + to the configured RTSP session in the GstRTSPClient object. This server state + is instead stored in the GstRTSPSession object, identified with the session + id. + + +* GstRTSPSession + + This object contains state about a specific RTSP session identified with a + session id. This state contains the configured streams and their associated + transports. + + When a GstRTSPClient performs a SETUP request, the server will allocate a new + GstRTSPSession with a unique session id from the GstRTSPSessionPool. The pool + maintains a list of all existing sessions and makes sure that no session id is + used multiple times. The session id is sent to the client so that the client + can refer to its previously configured state by sending the session id in + further requests. + + A client will then use the session id to configure one or more + GstRTSPSessionMedia objects, identified by their url. This SessionMedia object + contains the configuration of a GstRTSPMedia and its configured + GstRTSPStreamTransport. + + +* GstRTSPSessionMedia and GstRTSPStreamTransport + + A GstRTSPSessionMedia is identified by a URL and is referenced by a + GstRTSPSession. It is created as soon as a client performs a SETUP operation on + a particular URL. It will contain a link to the GstRTSPMedia object associated + with the URL along with the state of the media and the configured transports + for each of the streams in the media. + + Each SETUP request performed by the client will configure a + GstRTSPStreamTransport object linked to by the GstRTSPSessionMedia structure. + It will contain the transport information needed to send this stream to the + client. The GstRTSPStreamTransport also contains a link to the GstRTSPStream + object that generates the actual data to be streamed to the client. + + Note how GstRTSPMedia and GstRTSPStream (the providers of the data to + stream) are decoupled from GstRTSPSessionMedia and GstRTSPStreamTransport (the + configuration of how to send this stream to a client) in order to be able to + send the data of one GstRTSPMedia to multiple clients. + + +* media control + + After a client has configured the transports for a GstRTSPMedia and its + GstRTSPStreams, the client can play/pause/stop the stream. + + The GstRTSPMedia object was prepared in the DESCRIBE call (or during SETUP when + the client skipped the DESCRIBE request). As seen earlier, this configures a + couple of udpsink and udpsrc elements to respectively send and receive the + media to clients. + + When a client performs a PLAY request, its configured destination UDP ports are + added to the GstRTSPStream target destinations, at which point data will + be sent to the client. The corresponding GstRTSPMedia object will be set to the + PLAYING state if it was not allready in order to send the data to the + destination. + + The server needs to prepare an RTP-Info header field in the PLAY response, + which consists of the sequence number and the RTP timestamp of the next RTP + packet. In order to achive this, the server queries the payloaders for this + information when it prerolled the pipeline. + + When a client performs a PAUSE request, the destination UDP ports are removed + from the GstRTSPStream object and the GstRTSPMedia object is set to PAUSED + if no other destinations are configured anymore. + + +* seeking + + A seek is performed when a client sends a Range header in the PLAY request. + This only works when not dealing with shared (live) streams. + + The server performs a GStreamer flushing seek on the media, waits for the + pipeline to preroll again and then responds to the client after collecting the + new RTP sequence number and timestamp from the payloaders. + + +* session management + + The server has to react to clients that suddenly disappear because of network + problems or otherwise. It needs to make sure that it can reasonable free the + resources that are used by the various objects in use for streaming when the + client appears to be gone. + + Each of the GstRTSPSession objects managed by a GstRTSPSessionPool has + therefore a last_access field that contains the timestamp of when activity from + a client was last recorded. + + Various ways exist to detect activity from a client: + + - RTSP keepalive requests. When a client is receiving RTP data, the RTSP TCP + connection is largely unused. It is the client's responsability to + periodically send keep-alive requests over the TCP channel. + + Whenever a keep-alive request is received by the server (any request that + contains a session id, usually an OPTION or GET_PARAMETER request) the + last_access of the session is updated. + + - Since it is not required for a client to keep the RTSP TCP connection open + while streaming, gst-rtsp-server also detects activity from clients by + looking at the RTCP messages it receives. + + When an RTCP message is received from a client, the server looks in its list + of active ports if this message originates from a known host/port pair that + is currently active in a GstRTSPSession. If this is the case, the session is + kept alive. + + Since the server does not know anything about the port number that will be + used by the client to send RTCP, this method does not always work. Later + RTSP RFCs will include support for negotiating this port number with the + server. Most clients however use the same port number for sending and + receiving RTCP exactly for this reason. + + If there was no activity in a particular session for a long time (by default 60 + seconds), the application should remove the session from the pool. For this, + the application should periodically (say every 2 seconds) check if no sessions + expired and call gst_rtsp_session_pool_cleanup() to remove them. + + When a session is removed from the sessionpool and its last reference is + unreffef, all related objects and media are destroyed as if a TEARDOWN happened + from the client. + + +* TEARDOWN + + A TEARDOWN request will first locate the GstRTSPSessionMedia of the URL. It + will then remove all transports from the streams, making sure that streaming + stops to the clients. It will then remove the GstRTSPSessionMedia and + GstRTSPStreamTransport objects. Finally the GstRTSPSession is released back + into the pool. + + When there are no more references to the GstRTSPMedia, the media pipeline is + shut down (with _unprepare) and destroyed. This will then also destroy the + GstRTSPStream objects. + + +* Security + + The security of the server and the policy is implemented in a GstRTSPAuth + object. The object is reponsible for: + + - authenticate the user of the server. + + - check if the current user is authorized to perform an operation. + + For critical operations, the server will call gst_rtsp_auth_check() with + a string describing the operation which should be validated. The installed + GstRTSPAuth object is then responsible for checking if the operation is + allowed. + + Implementations of GstRTSPAuth objects can use the following infrastructure + bits of the rtsp server to implement these checks: + + - GstRTSPToken: a generic structure describing roles and permissions granted + to a user. + + - GstRTSPPermissions: a generic list of roles and matching permissions. These + can be attached to media and facties currently. + + An Auth implementation will usually authenticate a user, using method such as + Basic authentication or client certificates or perhaps simply use the IP address. + The result of the authentication of the user will be a GstRTSPToken that is made + current in the context of the ongoing request. + + The auth module can then implement the various checks in the server by looking + at the current token and, if needed, compare it to the required GstRTSPPermissions + of the current object. + + The security is deliberately kept generic with a default implementation of the + GstRTSPAuth object providing a usable and simple implementaion. To make more + complicated security modules, the auth object should be subclassed and new + implementations for the checks needs to be made. + + +Objects +------- + +GstRTSPServer + - Toplevel object listening for connections and creating new + GstRTSPClient objects + +GstRTSPClient + - Handle RTSP Requests from connected clients. All other objects + are called by this object. + +GstRTSPContext + - Helper structure contaning the current state of the request + handled by the client. + + +GstRTSPMountPoints + - Maps a url to a GstRTSPMediaFactory implementation. The default + implementation uses a simple hashtable to map a url to a factory. + +GstRTSPMediaFactory + - Creates and caches GstRTSPMedia objects. The default implementation + can create GstRTSPMedia objects based on gst-launch syntax. + +GstRTSPMediaFactoryURI + - Specialized GstRTSPMediaFactory that can stream the content of any + URI. + +GstRTSPMedia + - The object that contains the media pipeline and various GstRTSPStream + objects that produce RTP packets + +GstRTSPStream + - Manages the elements to stream a stream of a GstRTSPMedia to one or + more GstRTSPStreamTransports. + + +GstRTSPSessionPool + - Creates and manages GstRTSPSession objects identified by an id. + +GstRTSPSession + - An object containing the various GstRTSPSessionMedia objects managed + by this session. + +GstRTSPSessionMedia + - The state of a GstRTSPMedia and the configuration of a GstRTSPStream + objects. The configuration for the GstRTSPStream is stored in + GstRTSPStreamTransport objects. + +GstRTSPStreamTransport + - Configuration of how a GstRTSPStream is send to a particular client. It + contains the transport that was negotiated with the client in the SETUP + request. + + +GstRTSPSDP + - helper functions for creating SDP messages from gstRTSPMedia + +GstRTSPAddressPool + - a pool of multicast and unicast addresses used in streaming + +GstRTSPThreadPool + - a pool of threads used for various server tasks such as handling clients and + managin media pipelines. + + +GstRTSPAuth + - Hooks for checking authorizations, all client activity will call this + object with the GstRTSPContext structure. By default it supports + basic authentication. + +GstRTSPToken + - Credentials of a user. This contrains the roles that the user is allowed + to assume and other permissions or capabilities of the user. + +GstRTSPPermissions + - A list of permissions for each role. The permissions are usually attached + to objects to describe what roles have what permissions. + +GstRTSPParams + - object to handle get and set parameter requests. + diff --git a/docs/design/gst-rtp-server-design b/docs/design/gst-rtp-server-design new file mode 100644 index 0000000..7da8283 --- /dev/null +++ b/docs/design/gst-rtp-server-design @@ -0,0 +1,35 @@ +RTSP server +----------- + +This directory contains an example RTSP server built with various GStreamer +components and libraries. It also uses GStreamer for all of the multimedia +procesing and RTP bits. The following features are implemented: + + - + +Server Design +------------- + +The toplevel component of the server is a GstRTSPServer object. This object +creates and binds on the server socket and attaches into the mainloop. + +For each request a new GstRTSPClient object is created that will accept the +request and a thread is started to handle further communication with the +client until the connection is closed. + +When a client issues a SETUP request we create a GstRTSPSession object, +identified with a sessionid, that will keep track of the state of a client. +The object is destroyed when a TEARDOWN request is made for that sessionid. + +We also maintain a pool of URL to media pipeline mappings. Each url is mapped to +an object that is able to provide a pipeline for that media. We provide +pipelines to stream live captured data, on-demand file streaming or on-demand +transcoding of a file or stream. + +A pool of currently active pipelines is also maintained. Usually the active +pipelines are in use by one or more GstRTSPSession objects. An active pipeline +becomes inactive when no more sessions refer to it. + +A client can choose to start a new pipeline or join a currently active pipeline. +Some active pipeline cannot be joined (such as on-demand streams) but a new +instance of that pipeline can be created. diff --git a/docs/libs/Makefile.am b/docs/libs/Makefile.am new file mode 100644 index 0000000..64b7aa5 --- /dev/null +++ b/docs/libs/Makefile.am @@ -0,0 +1,106 @@ +GST_DOC_SCANOBJ = $(top_srcdir)/common/gstdoc-scangobj + +## Process this file with automake to produce Makefile.in + +# The name of the module, e.g. 'glib'. +MODULE=gst-rtsp-server +DOC_MODULE=$(MODULE) + +# for upload-doc.mak +DOC=$(MODULE) +FORMATS=html +html: html-build.stamp +include $(top_srcdir)/common/upload-doc.mak + +# generated basefiles +#basefiles = \ +## $(DOC_MODULE).types \ +# $(DOC_MODULE)-sections.txt \ +# $(DOC_MODULE)-docs.sgml + +# ugly hack to make -unused.sgml work +#unused-build.stamp: +# BUILDDIR=`pwd` && \ +# cd $(srcdir)/tmpl && \ +# ln -sf gstreamer-libs-unused.sgml \ +# $$BUILDDIR/tmpl/gstreamer-libs-@GST_API_VERSION@-unused.sgml +# touch unused-build.stamp + +# these rules are added to create parallel docs using GST_API_VERSION +#$(basefiles): gstreamer-libs-@GST_API_VERSION@%: gstreamer-libs% +# cp $< $@ + +#CLEANFILES = $(basefiles) + +# The top-level SGML file. Change it if you want. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml + +# The directory containing the source code. Relative to $(top_srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting functions and macros. +DOC_SOURCE_DIR = $(top_srcdir)/gst/rtsp-server/ +DOC_BUILD_DIR=$(top_builddir)/gst/rtsp-server/ + +SCAN_OPTIONS= + +# FIXME : +# there's something wrong with gstreamer-sections.txt not being in the dist +# maybe it doesn't resolve; we're adding it below for now +#EXTRA_DIST = gstreamer.types.in gstreamer.hierarchy $(DOC_MODULE)-sections.txt gstreamer-sections.txt $(DOC_MAIN_SGML_FILE) + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS=--sgml-mode --source-suffixes=c,h,cc,m + +# Extra options to supply to gtkdoc-fixref. +FIXXREF_OPTIONS=--extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html \ + --extra-dir=$(GST_PREFIX)/share/gtk-doc/html \ + --extra-dir=$(GSTPB_PREFIX)/share/gtk-doc/html + +# Used for dependencies. +HFILE_GLOB=$(DOC_SOURCE_DIR)/*.h +CFILE_GLOB=$(DOC_SOURCE_DIR)/*.c + +SCANOBJ_DEPS = \ + $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la + +# Extra options to supply to gtkdoc-scan. +SCANOBJ_OPTIONS=--type-init-func="g_type_init();gst_init(&argc,&argv)" + +# Header files to ignore when scanning. +IGNORE_HFILES = +IGNORE_CFILES = + +# we add all .h files of elements that have signals/args we want +# sadly this also pulls in the private methods - maybe we should +# move those around in the source ? +# also, we should add some stuff here conditionally based on whether +# or not the plugin will actually build +# but I'm not sure about that - it might be this Just Works given that +# the registry won't have the element + +EXTRA_HFILES = + +# Images to copy into HTML directory. +HTML_IMAGES = + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +content_files = + +# Other files to distribute. +extra_files = + +# CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib +# contains GtkObjects/GObjects and you want to document signals and properties. +GTKDOC_CFLAGS = -I$(top_srcdir) $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) $(GST_CFLAGS) +GTKDOC_LIBS = $(SCANOBJ_DEPS) $(GST_PLUGINS_BASE_LIBS) \ + $(GST_BASE_LIBS) $(GST_LIBS) $(GCOV_LIBS) + +GTKDOC_CC=$(LIBTOOL) --tag=CC --mode=compile $(CC) +GTKDOC_LD=$(LIBTOOL) --tag=CC --mode=link $(CC) + +# If you need to override some of the declarations, place them in this file +# and uncomment this line. +DOC_OVERRIDES = $(DOC_MODULE)-overrides.txt + +include $(top_srcdir)/common/gtk-doc.mak diff --git a/docs/libs/Makefile.in b/docs/libs/Makefile.in new file mode 100644 index 0000000..95811a2 --- /dev/null +++ b/docs/libs/Makefile.in @@ -0,0 +1,946 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ + +# this snippet is to be included by both our docbook manuals +# and gtk-doc API references + +# it adds an upload target to each of these dir's Makefiles + +# each Makefile.am should define the following variables: +# - DOC: the base name of the documentation +# (faq, manual, pwg, gstreamer, gstreamer-libs) +# - FORMATS: the formats in which DOC is output +# (html ps pdf) + +# if you want to use it, make sure your $HOME/.ssh/config file contains the +# correct User entry for the Host entry for the DOC_SERVER + +########################################################################### +# Everything below here is generic and you shouldn't need to change it. +########################################################################### +# thomas: except of course that we did +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = $(top_srcdir)/common/upload-doc.mak \ + $(top_srcdir)/common/gtk-doc.mak $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am +subdir = docs/libs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-docbook.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-doc.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/introspection.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAT_ENTRY_END = @CAT_ENTRY_END@ +CAT_ENTRY_START = @CAT_ENTRY_START@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPD_PLUGINS_DIR = @GSTPD_PLUGINS_DIR@ +GSTPG_PLUGINS_DIR = @GSTPG_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALL_CFLAGS = @GST_ALL_CFLAGS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_ALL_LIBS = @GST_ALL_LIBS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OBJ_CFLAGS = @GST_OBJ_CFLAGS@ +GST_OBJ_LIBS = @GST_OBJ_LIBS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PKG_CONFIG_PATH = @GST_PKG_CONFIG_PATH@ +GST_PLUGINS_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@ +GST_PLUGINS_BAD_DIR = @GST_PLUGINS_BAD_DIR@ +GST_PLUGINS_BAD_LIBS = @GST_PLUGINS_BAD_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@ +GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@ +GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ +HAVE_DVIPS = @HAVE_DVIPS@ +HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ +HAVE_JADETEX = @HAVE_JADETEX@ +HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ +HAVE_PNMTOPS = @HAVE_PNMTOPS@ +HAVE_PS2PDF = @HAVE_PS2PDF@ +HAVE_XMLLINT = @HAVE_XMLLINT@ +HAVE_XSLTPROC = @HAVE_XSLTPROC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCGROUP_CFLAGS = @LIBCGROUP_CFLAGS@ +LIBCGROUP_LIBS = @LIBCGROUP_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XML_CATALOG = @XML_CATALOG@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +GST_DOC_SCANOBJ = $(top_srcdir)/common/gstdoc-scangobj + +# The name of the module, e.g. 'glib'. +MODULE = gst-rtsp-server +DOC_MODULE = $(MODULE) + +# for upload-doc.mak +DOC = $(MODULE) +FORMATS = html + +# these variables define the location of the online docs +DOC_SERVER = gstreamer.freedesktop.org +DOC_BASE = /srv/gstreamer.freedesktop.org/www/data/doc +DOC_URL = $(DOC_SERVER):$(DOC_BASE) + +# generated basefiles +#basefiles = \ +# $(DOC_MODULE)-sections.txt \ +# $(DOC_MODULE)-docs.sgml + +# ugly hack to make -unused.sgml work +#unused-build.stamp: +# BUILDDIR=`pwd` && \ +# cd $(srcdir)/tmpl && \ +# ln -sf gstreamer-libs-unused.sgml \ +# $$BUILDDIR/tmpl/gstreamer-libs-@GST_API_VERSION@-unused.sgml +# touch unused-build.stamp + +# these rules are added to create parallel docs using GST_API_VERSION +#$(basefiles): gstreamer-libs-@GST_API_VERSION@%: gstreamer-libs% +# cp $< $@ + +#CLEANFILES = $(basefiles) + +# The top-level SGML file. Change it if you want. +DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml + +# The directory containing the source code. Relative to $(top_srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting functions and macros. +DOC_SOURCE_DIR = $(top_srcdir)/gst/rtsp-server/ +DOC_BUILD_DIR = $(top_builddir)/gst/rtsp-server/ +SCAN_OPTIONS = + +# FIXME : +# there's something wrong with gstreamer-sections.txt not being in the dist +# maybe it doesn't resolve; we're adding it below for now +#EXTRA_DIST = gstreamer.types.in gstreamer.hierarchy $(DOC_MODULE)-sections.txt gstreamer-sections.txt $(DOC_MAIN_SGML_FILE) + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS = --sgml-mode --source-suffixes=c,h,cc,m + +# Extra options to supply to gtkdoc-fixref. +FIXXREF_OPTIONS = --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html \ + --extra-dir=$(GST_PREFIX)/share/gtk-doc/html \ + --extra-dir=$(GSTPB_PREFIX)/share/gtk-doc/html + + +# Used for dependencies. +HFILE_GLOB = $(DOC_SOURCE_DIR)/*.h +CFILE_GLOB = $(DOC_SOURCE_DIR)/*.c +SCANOBJ_DEPS = \ + $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la + + +# Extra options to supply to gtkdoc-scan. +SCANOBJ_OPTIONS = --type-init-func="g_type_init();gst_init(&argc,&argv)" + +# Header files to ignore when scanning. +IGNORE_HFILES = +IGNORE_CFILES = + +# we add all .h files of elements that have signals/args we want +# sadly this also pulls in the private methods - maybe we should +# move those around in the source ? +# also, we should add some stuff here conditionally based on whether +# or not the plugin will actually build +# but I'm not sure about that - it might be this Just Works given that +# the registry won't have the element +EXTRA_HFILES = + +# Images to copy into HTML directory. +HTML_IMAGES = + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +content_files = + +# Other files to distribute. +extra_files = + +# CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib +# contains GtkObjects/GObjects and you want to document signals and properties. +GTKDOC_CFLAGS = -I$(top_srcdir) $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) $(GST_CFLAGS) + +GTKDOC_LIBS = $(SCANOBJ_DEPS) $(GST_PLUGINS_BASE_LIBS) \ + $(GST_BASE_LIBS) $(GST_LIBS) $(GCOV_LIBS) + +GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) +GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) + +# If you need to override some of the declarations, place them in this file +# and uncomment this line. +DOC_OVERRIDES = $(DOC_MODULE)-overrides.txt + +# thomas: copied from glib-2 +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +# thomas: make docs parallel installable +TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE)-@GST_API_VERSION@ +EXTRA_DIST = \ + $(content_files) \ + $(extra_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE).types \ + $(DOC_OVERRIDES) \ + $(DOC_MODULE)-sections.txt + +DOC_STAMPS = \ + setup-build.stamp \ + scan-build.stamp \ + sgml-build.stamp \ + html-build.stamp \ + sgml.stamp \ + html.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals \ + .libs/$(DOC_MODULE)-scan.o + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) doc-registry.xml +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/common/upload-doc.mak $(top_srcdir)/common/gtk-doc.mak $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/libs/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/libs/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_srcdir)/common/upload-doc.mak $(top_srcdir)/common/gtk-doc.mak: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am +check: check-am +all-am: Makefile all-local +installdirs: +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-local + +dvi: dvi-am + +dvi-am: + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic \ + maintainer-clean-local + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-local + +.MAKE: install-am install-strip + +.PHONY: all all-am all-local check check-am clean clean-generic \ + clean-libtool clean-local cscopelist-am ctags-am dist-hook \ + distclean distclean-generic distclean-libtool distclean-local \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-data-local \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + maintainer-clean-local mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-local + +html: html-build.stamp + +upload: $(FORMATS) + @if echo $(FORMATS) | grep html > /dev/null; then \ + echo "Preparing docs for upload (rebasing cross-references) ..." ; \ + if test x$(builddir) != x$(srcdir); then \ + echo "make upload can only be used if srcdir == builddir"; \ + exit 1; \ + fi; \ + # gtkdoc-rebase sometimes gets confused, so reset everything to \ + # local links before rebasing to online links \ + gtkdoc-rebase --html-dir=$(builddir)/html 2>/dev/null 2>/dev/null ; \ + rebase=`gtkdoc-rebase --verbose --online --html-dir=$(builddir)/html` ; \ + echo "$$rebase" | grep -e "On-*line"; \ + for req in glib gobject gstreamer gstreamer-libs gst-plugins-base-libs; do \ + if ! ( echo "$$rebase" | grep -i -e "On-*line.*/$$req/" ); then \ + echo "===============================================================================" ; \ + echo " Could not determine online location for $$req docs. Cross-referencing will be " ; \ + echo " broken, so not uploading. Make sure the library's gtk-doc documentation is " ; \ + echo " installed somewhere in /usr/share/gtk-doc. " ; \ + echo "===============================================================================" ; \ + exit 1; \ + fi; \ + done; \ + export SRC="$$SRC html"; \ + fi; \ + if echo $(FORMATS) | grep ps > /dev/null; then export SRC="$$SRC $(DOC).ps"; fi; \ + if echo $(FORMATS) | grep pdf > /dev/null; then export SRC="$$SRC $(DOC).pdf"; fi; \ + \ + # upload releases to both X.Y/ and head/ subdirectories \ + export DIR=$(DOC_BASE)/gstreamer/$(PACKAGE_VERSION_MAJOR).$(PACKAGE_VERSION_MINOR)/$(DOC); \ + echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) mkdir -p $$DIR; \ + rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) chmod -R g+w $$DIR; \ + \ + export DIR=$(DOC_BASE)/gstreamer/head/$(DOC); \ + echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) mkdir -p $$DIR; \ + rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \ + ssh $(DOC_SERVER) chmod -R g+w $$DIR; \ + \ + if echo $(FORMATS) | grep html > /dev/null; then \ + echo "Un-preparing docs for upload (rebasing cross-references) ..." ; \ + gtkdoc-rebase --html-dir=$(builddir)/html ; \ + fi; \ + echo Done + +@ENABLE_GTK_DOC_TRUE@all-local: html-build.stamp + +#### setup #### + +@ENABLE_GTK_DOC_TRUE@setup-build.stamp: $(content_files) +@ENABLE_GTK_DOC_TRUE@ -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ +@ENABLE_GTK_DOC_TRUE@ echo ' DOC Preparing build'; \ +@ENABLE_GTK_DOC_TRUE@ files=`echo $(DOC_MAIN_SGML_FILE) $(DOC_OVERRIDES) $(DOC_MODULE)-sections.txt $(DOC_MODULE).types $(content_files)`; \ +@ENABLE_GTK_DOC_TRUE@ if test "x$$files" != "x" ; then \ +@ENABLE_GTK_DOC_TRUE@ for file in $$files ; do \ +@ENABLE_GTK_DOC_TRUE@ test -f $(abs_srcdir)/$$file && \ +@ENABLE_GTK_DOC_TRUE@ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ +@ENABLE_GTK_DOC_TRUE@ done; \ +@ENABLE_GTK_DOC_TRUE@ fi; \ +@ENABLE_GTK_DOC_TRUE@ fi +@ENABLE_GTK_DOC_TRUE@ @touch setup-build.stamp + +#### scan #### + +# in the case of non-srcdir builds, the built gst directory gets added +# to gtk-doc scanning; but only then, to avoid duplicates +@ENABLE_GTK_DOC_TRUE@scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) +@ENABLE_GTK_DOC_TRUE@ @echo ' DOC Scanning header files' +@ENABLE_GTK_DOC_TRUE@ @_source_dir='' ; \ +@ENABLE_GTK_DOC_TRUE@ for i in $(DOC_SOURCE_DIR) ; do \ +@ENABLE_GTK_DOC_TRUE@ _source_dir="$${_source_dir} --source-dir=$$i" ; \ +@ENABLE_GTK_DOC_TRUE@ done ; \ +@ENABLE_GTK_DOC_TRUE@ gtkdoc-scan \ +@ENABLE_GTK_DOC_TRUE@ $(SCAN_OPTIONS) $(EXTRA_HFILES) \ +@ENABLE_GTK_DOC_TRUE@ --module=$(DOC_MODULE) \ +@ENABLE_GTK_DOC_TRUE@ $${_source_dir} \ +@ENABLE_GTK_DOC_TRUE@ --ignore-headers="$(IGNORE_HFILES)" +@ENABLE_GTK_DOC_TRUE@ @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null; then \ +@ENABLE_GTK_DOC_TRUE@ echo " DOC Introspecting gobjects"; \ +@ENABLE_GTK_DOC_TRUE@ GST_PLUGIN_SYSTEM_PATH_1_0=`cd $(top_builddir) && pwd` \ +@ENABLE_GTK_DOC_TRUE@ GST_PLUGIN_PATH_1_0= \ +@ENABLE_GTK_DOC_TRUE@ GST_REGISTRY_1_0=doc-registry.xml \ +@ENABLE_GTK_DOC_TRUE@ $(GTKDOC_EXTRA_ENVIRONMENT) \ +@ENABLE_GTK_DOC_TRUE@ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \ +@ENABLE_GTK_DOC_TRUE@ CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \ +@ENABLE_GTK_DOC_TRUE@ LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ +@ENABLE_GTK_DOC_TRUE@ gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \ +@ENABLE_GTK_DOC_TRUE@ --module=$(DOC_MODULE) ; \ +@ENABLE_GTK_DOC_TRUE@ else \ +@ENABLE_GTK_DOC_TRUE@ for i in $(SCANOBJ_FILES) ; do \ +@ENABLE_GTK_DOC_TRUE@ test -f $$i || touch $$i ; \ +@ENABLE_GTK_DOC_TRUE@ done \ +@ENABLE_GTK_DOC_TRUE@ fi +@ENABLE_GTK_DOC_TRUE@ @touch scan-build.stamp + +@ENABLE_GTK_DOC_TRUE@$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp +@ENABLE_GTK_DOC_TRUE@ @true + +#### xml #### + +@ENABLE_GTK_DOC_TRUE@sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files) +@ENABLE_GTK_DOC_TRUE@ @echo ' DOC Building XML' +@ENABLE_GTK_DOC_TRUE@ @gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) +@ENABLE_GTK_DOC_TRUE@ @cp ../version.entities xml +@ENABLE_GTK_DOC_TRUE@ @touch sgml-build.stamp + +@ENABLE_GTK_DOC_TRUE@sgml.stamp: sgml-build.stamp +@ENABLE_GTK_DOC_TRUE@ @true + +#### html #### + +@ENABLE_GTK_DOC_TRUE@html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) +@ENABLE_GTK_DOC_TRUE@ @echo ' DOC Building HTML' +@ENABLE_GTK_DOC_TRUE@ @rm -rf html +@ENABLE_GTK_DOC_TRUE@ @mkdir html +@ENABLE_GTK_DOC_TRUE@ @cp -pr xml html +@ENABLE_GTK_DOC_TRUE@ @cp ../version.entities ./ +@ENABLE_GTK_DOC_TRUE@ @mkhtml_options=""; \ +@ENABLE_GTK_DOC_TRUE@ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ +@ENABLE_GTK_DOC_TRUE@ if test "$(?)" = "0"; then \ +@ENABLE_GTK_DOC_TRUE@ if test "x$(V)" = "x1"; then \ +@ENABLE_GTK_DOC_TRUE@ mkhtml_options="$$mkhtml_options --verbose"; \ +@ENABLE_GTK_DOC_TRUE@ fi; \ +@ENABLE_GTK_DOC_TRUE@ fi; \ +@ENABLE_GTK_DOC_TRUE@ @gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ +@ENABLE_GTK_DOC_TRUE@ if test "$(?)" = "0"; then \ +@ENABLE_GTK_DOC_TRUE@ mkhtml_options=--path="$(abs_srcdir)"; \ +@ENABLE_GTK_DOC_TRUE@ fi; \ +@ENABLE_GTK_DOC_TRUE@ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE)-@GST_API_VERSION@ ../$(DOC_MAIN_SGML_FILE) +@ENABLE_GTK_DOC_TRUE@ @rm -rf html/xml +@ENABLE_GTK_DOC_TRUE@ @rm -f version.entities +@ENABLE_GTK_DOC_TRUE@ @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html ) +@ENABLE_GTK_DOC_TRUE@ @echo ' DOC Fixing cross-references' +@ENABLE_GTK_DOC_TRUE@ @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) +@ENABLE_GTK_DOC_TRUE@ @touch html-build.stamp + +@ENABLE_GTK_DOC_TRUE@clean-local-gtkdoc: +@ENABLE_GTK_DOC_TRUE@ @rm -rf xml tmpl html +# clean files copied for nonsrcdir templates build +@ENABLE_GTK_DOC_TRUE@ @if test x"$(srcdir)" != x. ; then \ +@ENABLE_GTK_DOC_TRUE@ rm -rf $(DOC_MODULE).types; \ +@ENABLE_GTK_DOC_TRUE@ fi +@ENABLE_GTK_DOC_FALSE@all-local: +@ENABLE_GTK_DOC_FALSE@clean-local-gtkdoc: + +clean-local: clean-local-gtkdoc + @rm -f *~ *.bak + @rm -rf .libs + +distclean-local: + @rm -f $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @rm -rf tmpl/*.sgml.bak + @rm -f $(DOC_MODULE).hierarchy + @rm -f *.stamp || true + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(DOC_MAIN_SGML_FILE) ; \ + rm -f $(DOC_OVERRIDES) ; \ + rm -f $(DOC_MODULE).types ; \ + rm -f $(DOC_MODULE).interfaces ; \ + rm -f $(DOC_MODULE).prerequisites ; \ + rm -f $(DOC_MODULE)-sections.txt ; \ + rm -f $(content_files) ; \ + rm -rf tmpl/*.sgml ; \ + fi + @rm -rf *.o + +maintainer-clean-local: clean + @cd $(srcdir) && rm -rf html \ + xml $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +# thomas: make docs parallel installable; devhelp requires majorminor too +install-data-local: + (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \ + if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \ + then echo '-- Nothing to install' ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2' ; \ + if test -e $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; then \ + $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2 \ + $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ + fi) +uninstall-local: + if test -d $(DESTDIR)$(TARGET_DIR); then \ + rm -rf $(DESTDIR)$(TARGET_DIR)/*; \ + rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \ + else \ + echo '-- Nothing to uninstall' ; \ + fi; + +# +# Require gtk-doc when making dist +# +@ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: +@ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: +@ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" +@ENABLE_GTK_DOC_FALSE@ @false + +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/html + cp html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs + +# avoid spurious build errors when distchecking with -jN +.NOTPARALLEL: + +# 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: diff --git a/docs/libs/gst-rtsp-server-docs.sgml b/docs/libs/gst-rtsp-server-docs.sgml new file mode 100644 index 0000000..06141f8 --- /dev/null +++ b/docs/libs/gst-rtsp-server-docs.sgml @@ -0,0 +1,49 @@ + + +%version-entities; +]> + + + + GStreamer RTSP Server Reference Manual + + for GStreamer RTSP Server &GST_VERSION; + + + + + + + + + + + + + + + + + + + + + + + + + + + Object Hierarchy + + + + + API Index + + + + + diff --git a/docs/libs/gst-rtsp-server-overrides.txt b/docs/libs/gst-rtsp-server-overrides.txt new file mode 100644 index 0000000..e69de29 diff --git a/docs/libs/gst-rtsp-server-sections.txt b/docs/libs/gst-rtsp-server-sections.txt new file mode 100644 index 0000000..e832c4e --- /dev/null +++ b/docs/libs/gst-rtsp-server-sections.txt @@ -0,0 +1,697 @@ +
+rtsp-address-pool +GstRTSPAddressPool + + +GST_RTSP_ADDRESS_POOL_ANY_IPV4 +GST_RTSP_ADDRESS_POOL_ANY_IPV6 +GstRTSPAddress +GstRTSPAddressFlags +gst_rtsp_address_copy +gst_rtsp_address_free + + +GstRTSPAddressPool +GstRTSPAddressPoolClass +GstRTSPAddressPoolResult +gst_rtsp_address_pool_new +gst_rtsp_address_pool_clear +gst_rtsp_address_pool_dump +gst_rtsp_address_pool_add_range +gst_rtsp_address_pool_has_unicast_addresses +gst_rtsp_address_pool_acquire_address +gst_rtsp_address_pool_reserve_address + +GST_RTSP_ADDRESS_POOL_CAST +GST_RTSP_ADDRESS_POOL_CLASS_CAST +GST_IS_RTSP_ADDRESS_POOL +GST_IS_RTSP_ADDRESS_POOL_CLASS +GST_RTSP_ADDRESS_POOL +GST_RTSP_ADDRESS_POOL_CLASS +GST_RTSP_ADDRESS_POOL_GET_CLASS +GST_TYPE_RTSP_ADDRESS_POOL +GstRTSPAddressPoolPrivate +gst_rtsp_address_get_type +gst_rtsp_address_pool_get_type +
+ +
+rtsp-auth +GstRTSPAuth +GstRTSPAuth +GstRTSPAuthClass +gst_rtsp_auth_new + +gst_rtsp_auth_get_tls_certificate +gst_rtsp_auth_set_tls_certificate +gst_rtsp_auth_make_basic +gst_rtsp_auth_add_basic +gst_rtsp_auth_remove_basic +gst_rtsp_auth_check +gst_rtsp_auth_get_default_token +gst_rtsp_auth_set_default_token + + +GST_RTSP_AUTH_CHECK_CONNECT +GST_RTSP_AUTH_CHECK_URL +GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS +GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT +GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS + + +GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE +GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS + + +GST_RTSP_PERM_MEDIA_FACTORY_ACCESS +GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT + +GST_RTSP_AUTH_CAST +GST_RTSP_AUTH_CLASS_CAST +GST_IS_RTSP_AUTH +GST_IS_RTSP_AUTH_CLASS +GST_RTSP_AUTH +GST_RTSP_AUTH_CLASS +GST_RTSP_AUTH_GET_CLASS +GST_TYPE_RTSP_AUTH +GstRTSPAuthPrivate +gst_rtsp_auth_get_type +
+ +
+rtsp-client +GstRTSPClient + +GstRTSPClient +GstRTSPClientClass + +gst_rtsp_client_new +gst_rtsp_client_close + +gst_rtsp_client_get_session_pool +gst_rtsp_client_set_session_pool + +gst_rtsp_client_get_mount_points +gst_rtsp_client_set_mount_points + +gst_rtsp_client_get_auth +gst_rtsp_client_set_auth + +gst_rtsp_client_get_thread_pool +gst_rtsp_client_set_thread_pool + +gst_rtsp_client_get_connection +gst_rtsp_client_set_connection + +gst_rtsp_client_attach + +GstRTSPClientSendFunc +gst_rtsp_client_set_send_func + +gst_rtsp_client_handle_message +gst_rtsp_client_send_message + +GstRTSPClientSessionFilterFunc +gst_rtsp_client_session_filter + +GST_RTSP_CLIENT_CAST +GST_RTSP_CLIENT_CLASS_CAST +GST_IS_RTSP_CLIENT +GST_IS_RTSP_CLIENT_CLASS +GST_RTSP_CLIENT +GST_RTSP_CLIENT_CLASS +GST_RTSP_CLIENT_GET_CLASS +GST_TYPE_RTSP_CLIENT +GstRTSPClientPrivate +gst_rtsp_client_get_type +
+ +
+rtsp-context +GstRTSPContext +GstRTSPContext +gst_rtsp_context_get_current +gst_rtsp_context_push_current +gst_rtsp_context_pop_current + +GST_TYPE_RTSP_CONTEXT +gst_rtsp_context_get_type +
+ +
+rtsp-media +GstRTSPMedia +GstRTSPMedia +GstRTSPMediaClass +gst_rtsp_media_new +gst_rtsp_media_get_element +gst_rtsp_media_take_pipeline + +gst_rtsp_media_set_permissions +gst_rtsp_media_get_permissions + +gst_rtsp_media_set_shared +gst_rtsp_media_is_shared + +gst_rtsp_media_set_reusable +gst_rtsp_media_is_reusable + +gst_rtsp_media_set_profiles +gst_rtsp_media_get_profiles + +gst_rtsp_media_set_protocols +gst_rtsp_media_get_protocols + +gst_rtsp_media_set_eos_shutdown +gst_rtsp_media_is_eos_shutdown + +gst_rtsp_media_set_address_pool +gst_rtsp_media_get_address_pool + +gst_rtsp_media_set_buffer_size +gst_rtsp_media_get_buffer_size + +gst_rtsp_media_setup_sdp + + +gst_rtsp_media_prepare +gst_rtsp_media_unprepare +GstRTSPMediaStatus +gst_rtsp_media_get_status + + +gst_rtsp_media_set_suspend_mode +gst_rtsp_media_get_suspend_mode + +GstRTSPSuspendMode +gst_rtsp_media_suspend +gst_rtsp_media_unsuspend + + +gst_rtsp_media_collect_streams +gst_rtsp_media_create_stream +gst_rtsp_media_n_streams +gst_rtsp_media_get_stream +gst_rtsp_media_find_stream + + +gst_rtsp_media_seek +gst_rtsp_media_get_range_string + +gst_rtsp_media_set_state +gst_rtsp_media_set_pipeline_state + + +gst_rtsp_media_get_clock +gst_rtsp_media_get_base_time +gst_rtsp_media_use_time_provider +gst_rtsp_media_is_time_provider +gst_rtsp_media_get_time_provider + +GST_RTSP_MEDIA_CAST +GST_RTSP_MEDIA_CLASS_CAST +GST_IS_RTSP_MEDIA +GST_IS_RTSP_MEDIA_CLASS +GST_RTSP_MEDIA +GST_RTSP_MEDIA_CLASS +GST_RTSP_MEDIA_GET_CLASS +GST_TYPE_RTSP_MEDIA +GstRTSPMediaPrivate +gst_rtsp_media_get_type +GST_TYPE_RTSP_SUSPEND_MODE +gst_rtsp_suspend_mode_get_type +
+ +
+rtsp-media-factory +GstRTSPMediaFactory +GstRTSPMediaFactory +GstRTSPMediaFactoryClass +gst_rtsp_media_factory_new + +gst_rtsp_media_factory_get_launch +gst_rtsp_media_factory_set_launch + +gst_rtsp_media_factory_get_permissions +gst_rtsp_media_factory_set_permissions +gst_rtsp_media_factory_add_role + +gst_rtsp_media_factory_set_shared +gst_rtsp_media_factory_is_shared + +gst_rtsp_media_factory_is_eos_shutdown +gst_rtsp_media_factory_set_eos_shutdown + +gst_rtsp_media_factory_get_protocols +gst_rtsp_media_factory_set_protocols + +gst_rtsp_media_factory_set_profiles +gst_rtsp_media_factory_get_profiles + +gst_rtsp_media_factory_get_address_pool +gst_rtsp_media_factory_set_address_pool + +gst_rtsp_media_factory_get_buffer_size +gst_rtsp_media_factory_set_buffer_size + +gst_rtsp_media_factory_get_suspend_mode +gst_rtsp_media_factory_set_suspend_mode + +gst_rtsp_media_factory_construct +gst_rtsp_media_factory_create_element + + +GST_RTSP_MEDIA_FACTORY_CAST +GST_RTSP_MEDIA_FACTORY_CLASS_CAST +GST_IS_RTSP_MEDIA_FACTORY +GST_IS_RTSP_MEDIA_FACTORY_CLASS +GST_RTSP_MEDIA_FACTORY +GST_RTSP_MEDIA_FACTORY_CLASS +GST_RTSP_MEDIA_FACTORY_GET_CLASS +GST_TYPE_RTSP_MEDIA_FACTORY +GstRTSPMediaFactoryPrivate +gst_rtsp_media_factory_get_type +
+ +
+rtsp-media-factory-uri +GstRTSPMediaFactoryURI +GstRTSPMediaFactoryURI +GstRTSPMediaFactoryURIClass +gst_rtsp_media_factory_uri_new +gst_rtsp_media_factory_uri_set_uri +gst_rtsp_media_factory_uri_get_uri + +GST_RTSP_MEDIA_FACTORY_URI_CAST +GST_RTSP_MEDIA_FACTORY_URI_CLASS_CAST +GST_IS_RTSP_MEDIA_FACTORY_URI +GST_IS_RTSP_MEDIA_FACTORY_URI_CLASS +GST_RTSP_MEDIA_FACTORY_URI +GST_RTSP_MEDIA_FACTORY_URI_CLASS +GST_RTSP_MEDIA_FACTORY_URI_GET_CLASS +GST_TYPE_RTSP_MEDIA_FACTORY_URI +GstRTSPMediaFactoryURIPrivate +gst_rtsp_media_factory_uri_get_type +
+ +
+rtsp-mount-points +GstRTSPMountPoints +GstRTSPMountPoints +GstRTSPMountPointsClass +gst_rtsp_mount_points_new +gst_rtsp_mount_points_add_factory +gst_rtsp_mount_points_remove_factory +gst_rtsp_mount_points_match +gst_rtsp_mount_points_make_path + +GST_RTSP_MOUNT_POINTS_CAST +GST_RTSP_MOUNT_POINTS_CLASS_CAST +GST_IS_RTSP_MOUNT_POINTS +GST_IS_RTSP_MOUNT_POINTS_CLASS +GST_RTSP_MOUNT_POINTS +GST_RTSP_MOUNT_POINTS_CLASS +GST_RTSP_MOUNT_POINTS_GET_CLASS +GST_TYPE_RTSP_MOUNT_POINTS +GstRTSPMountPointsPrivate +gst_rtsp_mount_points_get_type +
+ +
+rtsp-params +GstRTSPParams +gst_rtsp_params_get +gst_rtsp_params_set +
+ +
+rtsp-permissions +GstRTSPPermissions +GstRTSPPermissions +gst_rtsp_permissions_new +gst_rtsp_permissions_ref +gst_rtsp_permissions_unref +gst_rtsp_permissions_add_role +gst_rtsp_permissions_add_role_valist +gst_rtsp_permissions_remove_role +gst_rtsp_permissions_get_role +gst_rtsp_permissions_is_allowed + +GST_RTSP_PERMISSIONS_CAST +GST_IS_RTSP_PERMISSIONS +GST_RTSP_PERMISSIONS +GST_TYPE_RTSP_PERMISSIONS +gst_rtsp_permissions_get_type +
+ +
+rtsp-sdp +GstRTSPSdp +GstSDPInfo +gst_rtsp_sdp_from_media +
+ +
+rtsp-server +GstRTSPServer +GstRTSPServer +GstRTSPServerClass + +gst_rtsp_server_new + +gst_rtsp_server_get_address +gst_rtsp_server_set_address + +gst_rtsp_server_get_service +gst_rtsp_server_set_service + +gst_rtsp_server_get_backlog +gst_rtsp_server_set_backlog + +gst_rtsp_server_get_bound_port + +gst_rtsp_server_get_mount_points +gst_rtsp_server_set_mount_points + +gst_rtsp_server_get_session_pool +gst_rtsp_server_set_session_pool + +gst_rtsp_server_get_thread_pool +gst_rtsp_server_set_thread_pool + +gst_rtsp_server_get_auth +gst_rtsp_server_set_auth + +gst_rtsp_server_transfer_connection +gst_rtsp_server_io_func +gst_rtsp_server_create_socket +gst_rtsp_server_create_source +gst_rtsp_server_attach + +GstRTSPServerClientFilterFunc +gst_rtsp_server_client_filter + + +GST_IS_RTSP_SERVER +GST_RTSP_SERVER_CAST +GST_RTSP_SERVER_CLASS_CAST +GST_IS_RTSP_SERVER_CLASS +GST_RTSP_SERVER +GST_RTSP_SERVER_CLASS +GST_RTSP_SERVER_GET_CLASS +GST_TYPE_RTSP_SERVER +GstRTSPServerPrivate +gst_rtsp_server_get_type +
+ +
+rtsp-session +GstRTSPSession +GstRTSPSession +GstRTSPSessionClass + +gst_rtsp_session_new +gst_rtsp_session_get_sessionid + +gst_rtsp_session_get_header + +gst_rtsp_session_set_timeout +gst_rtsp_session_get_timeout + +gst_rtsp_session_touch +gst_rtsp_session_prevent_expire +gst_rtsp_session_allow_expire +gst_rtsp_session_next_timeout +gst_rtsp_session_is_expired + +gst_rtsp_session_manage_media +gst_rtsp_session_release_media + +gst_rtsp_session_get_media + +GstRTSPFilterResult +GstRTSPSessionFilterFunc +gst_rtsp_session_filter + +GST_RTSP_SESSION_CAST +GST_RTSP_SESSION_CLASS_CAST +GST_IS_RTSP_SESSION +GST_IS_RTSP_SESSION_CLASS +GST_RTSP_SESSION +GST_RTSP_SESSION_CLASS +GST_RTSP_SESSION_GET_CLASS +GST_TYPE_RTSP_SESSION +GstRTSPSessionPrivate +gst_rtsp_session_get_type +
+ +
+rtsp-session-media +GstRTSPSessionMedia +GstRTSPSessionMedia +GstRTSPSessionMediaClass +gst_rtsp_session_media_new +gst_rtsp_session_media_matches + +gst_rtsp_session_media_get_media +gst_rtsp_session_media_get_base_time +gst_rtsp_session_media_get_rtpinfo + +gst_rtsp_session_media_set_state + +gst_rtsp_session_media_get_rtsp_state +gst_rtsp_session_media_set_rtsp_state + +gst_rtsp_session_media_get_transport +gst_rtsp_session_media_set_transport + +gst_rtsp_session_media_alloc_channels + +GST_RTSP_SESSION_MEDIA_CAST +GST_RTSP_SESSION_MEDIA_CLASS_CAST +GST_IS_RTSP_SESSION_MEDIA +GST_IS_RTSP_SESSION_MEDIA_CLASS +GST_RTSP_SESSION_MEDIA +GST_RTSP_SESSION_MEDIA_CLASS +GST_RTSP_SESSION_MEDIA_GET_CLASS +GST_TYPE_RTSP_SESSION_MEDIA +GstRTSPSessionMediaPrivate +gst_rtsp_session_media_get_type +
+ +
+rtsp-session-pool +GstRTSPSessionPool +GstRTSPSessionPool +GstRTSPSessionPoolClass +gst_rtsp_session_pool_new + +gst_rtsp_session_pool_get_max_sessions +gst_rtsp_session_pool_set_max_sessions + +gst_rtsp_session_pool_get_n_sessions + +gst_rtsp_session_pool_create +gst_rtsp_session_pool_find +gst_rtsp_session_pool_remove + +gst_rtsp_session_pool_cleanup + +GstRTSPSessionPoolFunc +gst_rtsp_session_pool_create_watch + +GstRTSPSessionPoolFilterFunc +gst_rtsp_session_pool_filter + +GST_RTSP_SESSION_POOL_CAST +GST_RTSP_SESSION_POOL_CLASS_CAST +GST_IS_RTSP_SESSION_POOL +GST_IS_RTSP_SESSION_POOL_CLASS +GST_RTSP_SESSION_POOL +GST_RTSP_SESSION_POOL_CLASS +GST_RTSP_SESSION_POOL_GET_CLASS +GST_TYPE_RTSP_SESSION_POOL +GstRTSPSessionPoolPrivate +gst_rtsp_session_pool_get_type +
+ +
+rtsp-stream +GstRTSPStream +GstRTSPStream +GstRTSPStreamClass +gst_rtsp_stream_new + +gst_rtsp_stream_get_index +gst_rtsp_stream_get_srcpad + +gst_rtsp_stream_get_control +gst_rtsp_stream_set_control +gst_rtsp_stream_has_control + +gst_rtsp_stream_get_mtu +gst_rtsp_stream_set_mtu + +gst_rtsp_stream_get_dscp_qos +gst_rtsp_stream_set_dscp_qos + +gst_rtsp_stream_set_profiles +gst_rtsp_stream_get_profiles + +gst_rtsp_stream_get_protocols +gst_rtsp_stream_set_protocols + +gst_rtsp_stream_is_transport_supported + +gst_rtsp_stream_get_address_pool +gst_rtsp_stream_set_address_pool +gst_rtsp_stream_reserve_address + +gst_rtsp_stream_join_bin +gst_rtsp_stream_leave_bin + +gst_rtsp_stream_get_server_port +gst_rtsp_stream_get_multicast_address +gst_rtsp_stream_get_rtpsession +gst_rtsp_stream_get_ssrc +gst_rtsp_stream_get_rtpinfo +gst_rtsp_stream_get_caps +gst_rtsp_stream_get_pt + +gst_rtsp_stream_recv_rtcp +gst_rtsp_stream_recv_rtp + +gst_rtsp_stream_add_transport +gst_rtsp_stream_remove_transport + +gst_rtsp_stream_get_rtp_socket +gst_rtsp_stream_get_rtcp_socket + +gst_rtsp_stream_set_blocked +gst_rtsp_stream_is_blocking + +gst_rtsp_stream_update_crypto + +GstRTSPStreamTransportFilterFunc +gst_rtsp_stream_transport_filter + + +GST_RTSP_STREAM_CAST +GST_RTSP_STREAM_CLASS_CAST +GST_IS_RTSP_STREAM +GST_IS_RTSP_STREAM_CLASS +GST_RTSP_STREAM +GST_RTSP_STREAM_CLASS +GST_RTSP_STREAM_GET_CLASS +GST_TYPE_RTSP_STREAM +GstRTSPStreamPrivate +gst_rtsp_stream_get_type +
+ +
+rtsp-stream-transport +GstRTSPStreamTransport +GstRTSPStreamTransport +GstRTSPStreamTransportClass +gst_rtsp_stream_transport_new + +gst_rtsp_stream_transport_get_stream + +gst_rtsp_stream_transport_get_transport +gst_rtsp_stream_transport_set_transport + +gst_rtsp_stream_transport_get_url +gst_rtsp_stream_transport_set_url + +gst_rtsp_stream_transport_get_rtpinfo + +GstRTSPSendFunc +gst_rtsp_stream_transport_set_callbacks + +GstRTSPKeepAliveFunc +gst_rtsp_stream_transport_set_keepalive +gst_rtsp_stream_transport_keep_alive + +gst_rtsp_stream_transport_set_active + +gst_rtsp_stream_transport_set_timed_out +gst_rtsp_stream_transport_is_timed_out + +gst_rtsp_stream_transport_send_rtcp +gst_rtsp_stream_transport_send_rtp + + +GST_RTSP_STREAM_TRANSPORT_CAST +GST_RTSP_STREAM_TRANSPORT_CLASS_CAST +GST_IS_RTSP_STREAM_TRANSPORT +GST_IS_RTSP_STREAM_TRANSPORT_CLASS +GST_RTSP_STREAM_TRANSPORT +GST_RTSP_STREAM_TRANSPORT_CLASS +GST_RTSP_STREAM_TRANSPORT_GET_CLASS +GST_TYPE_RTSP_STREAM_TRANSPORT +GstRTSPStreamTransportPrivate +gst_rtsp_stream_transport_get_type +
+ +
+rtsp-thread-pool +GstRTSPThreadPool + +GstRTSPThreadType +GstRTSPThread + +gst_rtsp_thread_new +gst_rtsp_thread_ref +gst_rtsp_thread_unref +gst_rtsp_thread_reuse +gst_rtsp_thread_stop + + +GstRTSPThreadPool +GstRTSPThreadPoolClass +gst_rtsp_thread_pool_new + +gst_rtsp_thread_pool_get_max_threads +gst_rtsp_thread_pool_set_max_threads + +gst_rtsp_thread_pool_get_thread +gst_rtsp_thread_pool_cleanup + +GST_RTSP_THREAD_CAST +GST_RTSP_THREAD_POOL_CAST +GST_RTSP_THREAD_POOL_CLASS_CAST +GST_IS_RTSP_THREAD +GST_IS_RTSP_THREAD_POOL +GST_IS_RTSP_THREAD_POOL_CLASS +GST_RTSP_THREAD +GST_RTSP_THREAD_POOL +GST_RTSP_THREAD_POOL_CLASS +GST_RTSP_THREAD_POOL_GET_CLASS +GST_TYPE_RTSP_THREAD +GST_TYPE_RTSP_THREAD_POOL +GstRTSPThreadPoolPrivate +gst_rtsp_thread_get_type +gst_rtsp_thread_pool_get_type +
+ +
+rtsp-token +GstRTSPToken +GstRTSPToken +gst_rtsp_token_new_empty +gst_rtsp_token_new +gst_rtsp_token_new_valist +gst_rtsp_token_ref +gst_rtsp_token_unref +gst_rtsp_token_get_structure +gst_rtsp_token_writable_structure +gst_rtsp_token_get_string +gst_rtsp_token_is_allowed + +GST_RTSP_TOKEN_CAST +GST_IS_RTSP_TOKEN +GST_RTSP_TOKEN +GST_TYPE_RTSP_TOKEN +gst_rtsp_token_get_type +
+ diff --git a/docs/libs/gst-rtsp-server.types b/docs/libs/gst-rtsp-server.types new file mode 100644 index 0000000..f4476f2 --- /dev/null +++ b/docs/libs/gst-rtsp-server.types @@ -0,0 +1,25 @@ +#include + +#include +gst_rtsp_auth_get_type + +#include +gst_rtsp_mount_points_get_type + +#include +gst_rtsp_media_factory_get_type + +#include +gst_rtsp_media_get_type + +#include +gst_rtsp_server_get_type + +#include +gst_rtsp_session_pool_get_type + +#include +gst_rtsp_session_get_type + +#include +gst_rtsp_client_get_type diff --git a/docs/libs/html/GstRTSPAuth.html b/docs/libs/html/GstRTSPAuth.html new file mode 100644 index 0000000..1b1fc1b --- /dev/null +++ b/docs/libs/html/GstRTSPAuth.html @@ -0,0 +1,613 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPAuth + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPAuth

+

GstRTSPAuth — Authentication and authorization

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPAuth * + +gst_rtsp_auth_new () +
+GTlsCertificate * + +gst_rtsp_auth_get_tls_certificate () +
+void + +gst_rtsp_auth_set_tls_certificate () +
+gchar * + +gst_rtsp_auth_make_basic () +
+void + +gst_rtsp_auth_add_basic () +
+void + +gst_rtsp_auth_remove_basic () +
+gboolean + +gst_rtsp_auth_check () +
+GstRTSPToken * + +gst_rtsp_auth_get_default_token () +
+void + +gst_rtsp_auth_set_default_token () +
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── GstRTSPAuth
+
+
+
+

Description

+

The GstRTSPAuth object is responsible for checking if the current user is +allowed to perform requested actions. The default implementation has some +reasonable checks but subclasses can implement custom security policies.

+

A new auth object is made with gst_rtsp_auth_new(). It is usually configured +on the GstRTSPServer object.

+

The RTSP server will call gst_rtsp_auth_check() with a string describing the +check to perform. The possible checks are prefixed with +GST_RTSP_AUTH_CHECK_*. Depending on the check, the default implementation +will use the current GstRTSPToken, GstRTSPContext and +GstRTSPPermissions on the object to check if an operation is allowed.

+

The default GstRTSPAuth object has support for basic authentication. With +gst_rtsp_auth_add_basic() you can add a basic authentication string together +with the GstRTSPToken that will become active when successfully +authenticated.

+

When a TLS certificate has been set with gst_rtsp_auth_set_tls_certificate(), +the default auth object will require the client to connect with a TLS +connection.

+

Last reviewed on 2013-07-16 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_auth_new ()

+
GstRTSPAuth *
+gst_rtsp_auth_new (void);
+

Create a new GstRTSPAuth instance.

+
+

Returns

+

a new GstRTSPAuth.

+

[transfer full]

+
+
+
+
+

gst_rtsp_auth_get_tls_certificate ()

+
GTlsCertificate *
+gst_rtsp_auth_get_tls_certificate (GstRTSPAuth *auth);
+

Get the GTlsCertificate used for negotiating TLS auth +.

+
+

Parameters

+
+++++ + + + + + +

auth

a GstRTSPAuth

 
+
+
+

Returns

+

the GTlsCertificate of auth +. g_object_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_auth_set_tls_certificate ()

+
void
+gst_rtsp_auth_set_tls_certificate (GstRTSPAuth *auth,
+                                   GTlsCertificate *cert);
+

Set the TLS certificate for the auth. Client connections will only +be accepted when TLS is negotiated.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

auth

a GstRTSPAuth

 

cert

a GTlsCertificate.

[transfer none][allow-none]
+
+
+
+
+

gst_rtsp_auth_make_basic ()

+
gchar *
+gst_rtsp_auth_make_basic (const gchar *user,
+                          const gchar *pass);
+

Construct a Basic authorisation token from user + and pass +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

user

a userid

 

pass

a password

 
+
+
+

Returns

+

the base64 encoding of the string user +:pass +. +g_free() after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_auth_add_basic ()

+
void
+gst_rtsp_auth_add_basic (GstRTSPAuth *auth,
+                         const gchar *basic,
+                         GstRTSPToken *token);
+

Add a basic token for the default authentication algorithm that +enables the client with privileges listed in token +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

auth

a GstRTSPAuth

 

basic

the basic token

 

token

authorisation token.

[transfer none]
+
+
+
+
+

gst_rtsp_auth_remove_basic ()

+
void
+gst_rtsp_auth_remove_basic (GstRTSPAuth *auth,
+                            const gchar *basic);
+

Add a basic token for the default authentication algorithm that +enables the client with privileges from authgroup +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

auth

a GstRTSPAuth

 

basic

the basic token.

[transfer none]
+
+
+
+
+

gst_rtsp_auth_check ()

+
gboolean
+gst_rtsp_auth_check (const gchar *check);
+

Check if check + is allowed in the current context.

+
+

Parameters

+
+++++ + + + + + +

check

the item to check

 
+
+
+

Returns

+

FALSE if check failed.

+

+
+
+
+
+

gst_rtsp_auth_get_default_token ()

+
GstRTSPToken *
+gst_rtsp_auth_get_default_token (GstRTSPAuth *auth);
+

Get the default token for auth +. This token will be used for unauthenticated +users.

+
+

Parameters

+
+++++ + + + + + +

auth

a GstRTSPAuth

 
+
+
+

Returns

+

the GstRTSPToken of auth +. gst_rtsp_token_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_auth_set_default_token ()

+
void
+gst_rtsp_auth_set_default_token (GstRTSPAuth *auth,
+                                 GstRTSPToken *token);
+

Set the default GstRTSPToken to token + in auth +. The default token will +be used for unauthenticated users.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

auth

a GstRTSPAuth

 

token

a GstRTSPToken.

[transfer none][allow-none]
+
+
+
+
+

Types and Values

+
+

struct GstRTSPAuth

+
struct GstRTSPAuth;
+

The authentication structure.

+
+
+
+

struct GstRTSPAuthClass

+
struct GstRTSPAuthClass {
+  GObjectClass  parent_class;
+
+  gboolean           (*authenticate) (GstRTSPAuth *auth, GstRTSPContext *ctx);
+  gboolean           (*check)        (GstRTSPAuth *auth, GstRTSPContext *ctx,
+                                      const gchar *check);
+};
+
+

The authentication class.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GObjectClass parent_class;

  

authenticate ()

check the authentication of a client. The default implementation +checks if the authentication in the header matches one of the basic +authentication tokens. This function should set the authgroup field +in the context.

 

check ()

check if a resource can be accessed. this function should +call authenticate to authenticate the client when needed. The method +should also construct and send an appropriate response message on +error.

 
+
+
+
+
+

GST_RTSP_AUTH_CHECK_CONNECT

+
#define GST_RTSP_AUTH_CHECK_CONNECT                  "auth.check.connect"
+
+

Check a new connection

+
+
+
+

GST_RTSP_AUTH_CHECK_URL

+
#define GST_RTSP_AUTH_CHECK_URL                      "auth.check.url"
+
+

Check the URL and methods

+
+
+
+

GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS

+
#define GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS     "auth.check.media.factory.access"
+
+

Check if access is allowed to a factory. +When access is not allowed an 404 Not Found is sent in the response.

+
+
+
+

GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT

+
#define GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT  "auth.check.media.factory.construct"
+
+

Check if media can be constructed from a media factory +A response should be sent on error.

+
+
+
+

GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS

+
#define GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS  "auth.check.transport.client-settings"
+
+

Check if the client can specify TTL, destination and +port pair in multicast. No response is sent when the check returns +FALSE.

+
+
+
+

GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE

+
#define GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE      "media.factory.role"
+
+

G_TYPE_STRING, the role to use when dealing with media factories

+

The default GstRTSPAuth object uses this string in the token to find the +role of the media factory. It will then retrieve the GstRTSPPermissions of +the media factory and retrieve the role with the same name.

+
+
+
+

GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS

+
#define GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS   "transport.client-settings"
+
+

G_TYPE_BOOLEAN, TRUE if the client can specify TTL, destination and + port pair in multicast.

+
+
+
+

GST_RTSP_PERM_MEDIA_FACTORY_ACCESS

+
#define GST_RTSP_PERM_MEDIA_FACTORY_ACCESS      "media.factory.access"
+
+

G_TYPE_BOOLEAN, TRUE if the media can be accessed, FALSE will +return a 404 Not Found error when trying to access the media.

+
+
+
+

GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT

+
#define GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT   "media.factory.construct"
+
+

G_TYPE_BOOLEAN, TRUE if the media can be constructed, FALSE will +return a 404 Not Found error when trying to access the media.

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/GstRTSPClient.html b/docs/libs/html/GstRTSPClient.html new file mode 100644 index 0000000..e02e8a7 --- /dev/null +++ b/docs/libs/html/GstRTSPClient.html @@ -0,0 +1,1371 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPClient + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPClient

+

GstRTSPClient — A client connection state

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPClient * + +gst_rtsp_client_new () +
+void + +gst_rtsp_client_close () +
+GstRTSPSessionPool * + +gst_rtsp_client_get_session_pool () +
+void + +gst_rtsp_client_set_session_pool () +
+GstRTSPMountPoints * + +gst_rtsp_client_get_mount_points () +
+void + +gst_rtsp_client_set_mount_points () +
+GstRTSPAuth * + +gst_rtsp_client_get_auth () +
+void + +gst_rtsp_client_set_auth () +
+GstRTSPThreadPool * + +gst_rtsp_client_get_thread_pool () +
+void + +gst_rtsp_client_set_thread_pool () +
+GstRTSPConnection * + +gst_rtsp_client_get_connection () +
+gboolean + +gst_rtsp_client_set_connection () +
+guint + +gst_rtsp_client_attach () +
+gboolean + +(*GstRTSPClientSendFunc) () +
+void + +gst_rtsp_client_set_send_func () +
+GstRTSPResult + +gst_rtsp_client_handle_message () +
+GstRTSPResult + +gst_rtsp_client_send_message () +
+GstRTSPFilterResult + +(*GstRTSPClientSessionFilterFunc) () +
+GList * + +gst_rtsp_client_session_filter () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
gbooleandrop-backlogRead / Write
+GstRTSPMountPoints *mount-pointsRead / Write
+GstRTSPSessionPool *session-poolRead / Write
+
+
+

Signals

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
voidclosedRun Last
voiddescribe-requestRun Last
voidget-parameter-requestRun Last
voidhandle-responseRun Last
voidnew-sessionRun Last
voidoptions-requestRun Last
voidpause-requestRun Last
voidplay-requestRun Last
voidsend-messageRun Last
voidset-parameter-requestRun Last
voidsetup-requestRun Last
voidteardown-requestRun Last
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
structGstRTSPClient
structGstRTSPClientClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GstRTSPClient
+
+
+
+

Description

+

The client object handles the connection with a client for as long as a TCP +connection is open.

+

A GstRTSPClient is created by GstRTSPServer when a new connection is +accepted and it inherits the GstRTSPMountPoints, GstRTSPSessionPool, +GstRTSPAuth and GstRTSPThreadPool from the server.

+

The client connection should be configured with the GstRTSPConnection using +gst_rtsp_client_set_connection() before it can be attached to a GMainContext +using gst_rtsp_client_attach(). From then on the client will handle requests +on the connection.

+

Use gst_rtsp_client_session_filter() to iterate or modify all the +GstRTSPSession objects managed by the client object.

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_client_new ()

+
GstRTSPClient *
+gst_rtsp_client_new (void);
+

Create a new GstRTSPClient instance.

+
+

Returns

+

a new GstRTSPClient.

+

[transfer full]

+
+
+
+
+

gst_rtsp_client_close ()

+
void
+gst_rtsp_client_close (GstRTSPClient *client);
+

Close the connection of client + and remove all media it was managing.

+
+

Parameters

+
+++++ + + + + + +

client

a GstRTSPClient

 
+
+

Since 1.4

+
+
+
+

gst_rtsp_client_get_session_pool ()

+
GstRTSPSessionPool *
+gst_rtsp_client_get_session_pool (GstRTSPClient *client);
+

Get the GstRTSPSessionPool object that client + uses to manage its sessions.

+
+

Parameters

+
+++++ + + + + + +

client

a GstRTSPClient

 
+
+
+

Returns

+

a GstRTSPSessionPool, unref after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_client_set_session_pool ()

+
void
+gst_rtsp_client_set_session_pool (GstRTSPClient *client,
+                                  GstRTSPSessionPool *pool);
+

Set pool + as the sessionpool for client + which it will use to find +or allocate sessions. the sessionpool is usually inherited from the server +that created the client but can be overridden later.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

client

a GstRTSPClient

 

pool

a GstRTSPSessionPool.

[transfer none]
+
+
+
+
+

gst_rtsp_client_get_mount_points ()

+
GstRTSPMountPoints *
+gst_rtsp_client_get_mount_points (GstRTSPClient *client);
+

Get the GstRTSPMountPoints object that client + uses to manage its sessions.

+
+

Parameters

+
+++++ + + + + + +

client

a GstRTSPClient

 
+
+
+

Returns

+

a GstRTSPMountPoints, unref after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_client_set_mount_points ()

+
void
+gst_rtsp_client_set_mount_points (GstRTSPClient *client,
+                                  GstRTSPMountPoints *mounts);
+

Set mounts + as the mount points for client + which it will use to map urls +to media streams. These mount points are usually inherited from the server that +created the client but can be overriden later.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

client

a GstRTSPClient

 

mounts

a GstRTSPMountPoints.

[transfer none]
+
+
+
+
+

gst_rtsp_client_get_auth ()

+
GstRTSPAuth *
+gst_rtsp_client_get_auth (GstRTSPClient *client);
+

Get the GstRTSPAuth used as the authentication manager of client +.

+
+

Parameters

+
+++++ + + + + + +

client

a GstRTSPClient

 
+
+
+

Returns

+

the GstRTSPAuth of client +. g_object_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_client_set_auth ()

+
void
+gst_rtsp_client_set_auth (GstRTSPClient *client,
+                          GstRTSPAuth *auth);
+

configure auth + to be used as the authentication manager of client +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

client

a GstRTSPClient

 

auth

a GstRTSPAuth.

[transfer none]
+
+
+
+
+

gst_rtsp_client_get_thread_pool ()

+
GstRTSPThreadPool *
+gst_rtsp_client_get_thread_pool (GstRTSPClient *client);
+

Get the GstRTSPThreadPool used as the thread pool of client +.

+
+

Parameters

+
+++++ + + + + + +

client

a GstRTSPClient

 
+
+
+

Returns

+

the GstRTSPThreadPool of client +. g_object_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_client_set_thread_pool ()

+
void
+gst_rtsp_client_set_thread_pool (GstRTSPClient *client,
+                                 GstRTSPThreadPool *pool);
+

configure pool + to be used as the thread pool of client +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

client

a GstRTSPClient

 

pool

a GstRTSPThreadPool.

[transfer none]
+
+
+
+
+

gst_rtsp_client_get_connection ()

+
GstRTSPConnection *
+gst_rtsp_client_get_connection (GstRTSPClient *client);
+

Get the GstRTSPConnection of client +.

+
+

Parameters

+
+++++ + + + + + +

client

a GstRTSPClient

 
+
+
+

Returns

+

the GstRTSPConnection of client +. +The connection object returned remains valid until the client is freed.

+

[transfer none]

+
+
+
+
+

gst_rtsp_client_set_connection ()

+
gboolean
+gst_rtsp_client_set_connection (GstRTSPClient *client,
+                                GstRTSPConnection *conn);
+

Set the GstRTSPConnection of client +. This function takes ownership of +conn +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

client

a GstRTSPClient

 

conn

a GstRTSPConnection.

[transfer full]
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

gst_rtsp_client_attach ()

+
guint
+gst_rtsp_client_attach (GstRTSPClient *client,
+                        GMainContext *context);
+

Attaches client + to context +. When the mainloop for context + is run, the +client will be dispatched. When context + is NULL, the default context will be +used).

+

This function should be called when the client properties and urls are fully +configured and the client is ready to start.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

client

a GstRTSPClient

 

context

a GMainContext.

[allow-none]
+
+
+

Returns

+

the ID (greater than 0) for the source within the GMainContext.

+

+
+
+
+
+

GstRTSPClientSendFunc ()

+
gboolean
+(*GstRTSPClientSendFunc) (GstRTSPClient *client,
+                          GstRTSPMessage *message,
+                          gboolean close,
+                          gpointer user_data);
+

This callback is called when client + wants to send message +. When close + is +TRUE, the connection should be closed when the message has been sent.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

client

a GstRTSPClient

 

message

a GstRTSPMessage

 

close

close the connection

 

user_data

user data when registering the callback

 
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

gst_rtsp_client_set_send_func ()

+
void
+gst_rtsp_client_set_send_func (GstRTSPClient *client,
+                               GstRTSPClientSendFunc func,
+                               gpointer user_data,
+                               GDestroyNotify notify);
+

Set func + as the callback that will be called when a new message needs to be +sent to the client. user_data + is passed to func + and notify + is called when +user_data + is no longer in use.

+

By default, the client will send the messages on the GstRTSPConnection that +was configured with gst_rtsp_client_attach() was called.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

client

a GstRTSPClient

 

func

a GstRTSPClientSendFunc.

[scope notified]

user_data

user data passed to func +.

[closure]

notify

called when user_data +is no longer in use.

[allow-none]
+
+
+
+
+

gst_rtsp_client_handle_message ()

+
GstRTSPResult
+gst_rtsp_client_handle_message (GstRTSPClient *client,
+                                GstRTSPMessage *message);
+

Let the client handle message +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

client

a GstRTSPClient

 

message

an GstRTSPMessage.

[transfer none]
+
+
+

Returns

+

a GstRTSPResult.

+

+
+
+
+
+

gst_rtsp_client_send_message ()

+
GstRTSPResult
+gst_rtsp_client_send_message (GstRTSPClient *client,
+                              GstRTSPSession *session,
+                              GstRTSPMessage *message);
+

Send a message message to the remote end. message + must be a +GST_RTSP_MESSAGE_REQUEST or a GST_RTSP_MESSAGE_RESPONSE.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

client

a GstRTSPClient

 

session

a GstRTSPSession to send +the message to or NULL.

[allow-none][transfer none]

message

The GstRTSPMessage to send.

[transfer none]
+
+
+
+
+

GstRTSPClientSessionFilterFunc ()

+
GstRTSPFilterResult
+(*GstRTSPClientSessionFilterFunc) (GstRTSPClient *client,
+                                   GstRTSPSession *sess,
+                                   gpointer user_data);
+

This function will be called by the gst_rtsp_client_session_filter(). An +implementation should return a value of GstRTSPFilterResult.

+

When this function returns GST_RTSP_FILTER_REMOVE, sess + will be removed +from client +.

+

A return value of GST_RTSP_FILTER_KEEP will leave sess + untouched in +client +.

+

A value of GST_RTSP_FILTER_REF will add sess + to the result GList of +gst_rtsp_client_session_filter().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

client

a GstRTSPClient object

 

sess

a GstRTSPSession in client +

 

user_data

user data that has been given to gst_rtsp_client_session_filter()

 
+
+
+

Returns

+

a GstRTSPFilterResult.

+

+
+
+
+
+

gst_rtsp_client_session_filter ()

+
GList *
+gst_rtsp_client_session_filter (GstRTSPClient *client,
+                                GstRTSPClientSessionFilterFunc func,
+                                gpointer user_data);
+

Call func + for each session managed by client +. The result value of func + +determines what happens to the session. func + will be called with client + +locked so no further actions on client + can be performed from func +.

+

If func + returns GST_RTSP_FILTER_REMOVE, the session will be removed from +client +.

+

If func + returns GST_RTSP_FILTER_KEEP, the session will remain in client +.

+

If func + returns GST_RTSP_FILTER_REF, the session will remain in client + but +will also be added with an additional ref to the result GList of this +function..

+

When func + is NULL, GST_RTSP_FILTER_REF will be assumed for each session.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

client

a GstRTSPClient

 

func

a callback.

[scope call][allow-none]

user_data

user data passed to func +

 
+
+
+

Returns

+

a GList with all +sessions for which func +returned GST_RTSP_FILTER_REF. After usage, each +element in the GList should be unreffed before the list is freed.

+

[element-type GstRTSPSession][transfer full]

+
+
+
+
+

Types and Values

+
+

struct GstRTSPClient

+
struct GstRTSPClient;
+

The client object represents the connection and its state with a client.

+
+
+
+

struct GstRTSPClientClass

+
struct GstRTSPClientClass {
+  GObjectClass  parent_class;
+
+  GstSDPMessage * (*create_sdp) (GstRTSPClient *client, GstRTSPMedia *media);
+  gboolean        (*configure_client_media)     (GstRTSPClient * client,
+                                                 GstRTSPMedia * media, GstRTSPStream * stream,
+                                                 GstRTSPContext * ctx);
+  gboolean        (*configure_client_transport) (GstRTSPClient * client,
+                                                 GstRTSPContext * ctx,
+                                                 GstRTSPTransport * ct);
+  GstRTSPResult   (*params_set) (GstRTSPClient *client, GstRTSPContext *ctx);
+  GstRTSPResult   (*params_get) (GstRTSPClient *client, GstRTSPContext *ctx);
+  gchar *         (*make_path_from_uri) (GstRTSPClient *client, const GstRTSPUrl *uri);
+
+  /* signals */
+  void     (*closed)                  (GstRTSPClient *client);
+  void     (*new_session)             (GstRTSPClient *client, GstRTSPSession *session);
+  void     (*options_request)         (GstRTSPClient *client, GstRTSPContext *ctx);
+  void     (*describe_request)        (GstRTSPClient *client, GstRTSPContext *ctx);
+  void     (*setup_request)           (GstRTSPClient *client, GstRTSPContext *ctx);
+  void     (*play_request)            (GstRTSPClient *client, GstRTSPContext *ctx);
+  void     (*pause_request)           (GstRTSPClient *client, GstRTSPContext *ctx);
+  void     (*teardown_request)        (GstRTSPClient *client, GstRTSPContext *ctx);
+  void     (*set_parameter_request)   (GstRTSPClient *client, GstRTSPContext *ctx);
+  void     (*get_parameter_request)   (GstRTSPClient *client, GstRTSPContext *ctx);
+  void     (*handle_response)         (GstRTSPClient *client, GstRTSPContext *ctx);
+
+  void     (*tunnel_http_response)    (GstRTSPClient * client, GstRTSPMessage * request,
+                                       GstRTSPMessage * response);
+};
+
+

The client class structure.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GObjectClass parent_class;

  

create_sdp ()

called when the SDP needs to be created for media.

 

configure_client_media ()

called when the stream in media needs to be configured. +The default implementation will configure the blocksize on the payloader when +spcified in the request headers.

 

configure_client_transport ()

called when the client transport needs to be +configured.

 

params_set ()

set parameters. This function should also initialize the +RTSP response(ctx->response) via a call to gst_rtsp_message_init_response()

 

params_get ()

get parameters. This function should also initialize the +RTSP response(ctx->response) via a call to gst_rtsp_message_init_response()

 

make_path_from_uri ()

  

closed ()

  

new_session ()

  

options_request ()

  

describe_request ()

  

setup_request ()

  

play_request ()

  

pause_request ()

  

teardown_request ()

  

set_parameter_request ()

  

get_parameter_request ()

  

handle_response ()

  

tunnel_http_response ()

called when a response to the GET request is about to +be sent for a tunneled connection. The response can be modified. Since 1.4

 
+
+
+
+
+

Property Details

+
+

The “drop-backlog” property

+
  “drop-backlog”             gboolean
+

Drop data when the backlog queue is full.

+

Flags: Read / Write

+

Default value: TRUE

+
+
+
+

The “mount-points” property

+
  “mount-points”             GstRTSPMountPoints *
+

The mount points to use for client session.

+

Flags: Read / Write

+
+
+
+

The “session-pool” property

+
  “session-pool”             GstRTSPSessionPool *
+

The session pool to use for client session.

+

Flags: Read / Write

+
+
+
+

Signal Details

+
+

The “closed” signal

+
void
+user_function (GstRTSPClient *gstrtspclient,
+               gpointer       user_data)
+

Flags: Run Last

+
+
+
+

The “describe-request” signal

+
void
+user_function (GstRTSPClient  *gstrtspclient,
+               GstRTSPContext *arg1,
+               gpointer        user_data)
+

Flags: Run Last

+
+
+
+

The “get-parameter-request” signal

+
void
+user_function (GstRTSPClient  *gstrtspclient,
+               GstRTSPContext *arg1,
+               gpointer        user_data)
+

Flags: Run Last

+
+
+
+

The “handle-response” signal

+
void
+user_function (GstRTSPClient  *gstrtspclient,
+               GstRTSPContext *arg1,
+               gpointer        user_data)
+

Flags: Run Last

+
+
+
+

The “new-session” signal

+
void
+user_function (GstRTSPClient  *gstrtspclient,
+               GstRTSPSession *arg1,
+               gpointer        user_data)
+

Flags: Run Last

+
+
+
+

The “options-request” signal

+
void
+user_function (GstRTSPClient  *gstrtspclient,
+               GstRTSPContext *arg1,
+               gpointer        user_data)
+

Flags: Run Last

+
+
+
+

The “pause-request” signal

+
void
+user_function (GstRTSPClient  *gstrtspclient,
+               GstRTSPContext *arg1,
+               gpointer        user_data)
+

Flags: Run Last

+
+
+
+

The “play-request” signal

+
void
+user_function (GstRTSPClient  *gstrtspclient,
+               GstRTSPContext *arg1,
+               gpointer        user_data)
+

Flags: Run Last

+
+
+
+

The “send-message” signal

+
void
+user_function (GstRTSPClient  *client,
+               GstRTSPContext *session,
+               gpointer        message,
+               gpointer        user_data)
+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

client

The RTSP client

 

session

The session.

[type GstRtspServer.RTSPSession]

message

The message.

[type GstRtsp.RTSPMessage]

user_data

user data set when the signal handler was connected.

 
+
+

Flags: Run Last

+
+
+
+

The “set-parameter-request” signal

+
void
+user_function (GstRTSPClient  *gstrtspclient,
+               GstRTSPContext *arg1,
+               gpointer        user_data)
+

Flags: Run Last

+
+
+
+

The “setup-request” signal

+
void
+user_function (GstRTSPClient  *gstrtspclient,
+               GstRTSPContext *arg1,
+               gpointer        user_data)
+

Flags: Run Last

+
+
+
+

The “teardown-request” signal

+
void
+user_function (GstRTSPClient  *gstrtspclient,
+               GstRTSPContext *arg1,
+               gpointer        user_data)
+

Flags: Run Last

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/GstRTSPMedia.html b/docs/libs/html/GstRTSPMedia.html new file mode 100644 index 0000000..83c5721 --- /dev/null +++ b/docs/libs/html/GstRTSPMedia.html @@ -0,0 +1,2286 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPMedia + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPMedia

+

GstRTSPMedia — The media pipeline

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPMedia * + +gst_rtsp_media_new () +
+GstElement * + +gst_rtsp_media_get_element () +
+void + +gst_rtsp_media_take_pipeline () +
+void + +gst_rtsp_media_set_permissions () +
+GstRTSPPermissions * + +gst_rtsp_media_get_permissions () +
+void + +gst_rtsp_media_set_shared () +
+gboolean + +gst_rtsp_media_is_shared () +
+void + +gst_rtsp_media_set_reusable () +
+gboolean + +gst_rtsp_media_is_reusable () +
+void + +gst_rtsp_media_set_profiles () +
+GstRTSPProfile + +gst_rtsp_media_get_profiles () +
+void + +gst_rtsp_media_set_protocols () +
+GstRTSPLowerTrans + +gst_rtsp_media_get_protocols () +
+void + +gst_rtsp_media_set_eos_shutdown () +
+gboolean + +gst_rtsp_media_is_eos_shutdown () +
+void + +gst_rtsp_media_set_address_pool () +
+GstRTSPAddressPool * + +gst_rtsp_media_get_address_pool () +
+void + +gst_rtsp_media_set_buffer_size () +
+guint + +gst_rtsp_media_get_buffer_size () +
+gboolean + +gst_rtsp_media_setup_sdp () +
+gboolean + +gst_rtsp_media_prepare () +
+gboolean + +gst_rtsp_media_unprepare () +
+GstRTSPMediaStatus + +gst_rtsp_media_get_status () +
+void + +gst_rtsp_media_set_suspend_mode () +
+GstRTSPSuspendMode + +gst_rtsp_media_get_suspend_mode () +
+gboolean + +gst_rtsp_media_suspend () +
+gboolean + +gst_rtsp_media_unsuspend () +
+void + +gst_rtsp_media_collect_streams () +
+GstRTSPStream * + +gst_rtsp_media_create_stream () +
+guint + +gst_rtsp_media_n_streams () +
+GstRTSPStream * + +gst_rtsp_media_get_stream () +
+GstRTSPStream * + +gst_rtsp_media_find_stream () +
+gboolean + +gst_rtsp_media_seek () +
+gchar * + +gst_rtsp_media_get_range_string () +
+gboolean + +gst_rtsp_media_set_state () +
+void + +gst_rtsp_media_set_pipeline_state () +
+GstClock * + +gst_rtsp_media_get_clock () +
+GstClockTime + +gst_rtsp_media_get_base_time () +
+void + +gst_rtsp_media_use_time_provider () +
+gboolean + +gst_rtsp_media_is_time_provider () +
+GstNetTimeProvider * + +gst_rtsp_media_get_time_provider () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
guintbuffer-sizeRead / Write
+GstElement *elementRead / Write / Construct Only
gbooleaneos-shutdownRead / Write
GstRTSPProfileprofilesRead / Write
GstRTSPLowerTransprotocolsRead / Write
gbooleanreusableRead / Write
gbooleansharedRead / Write
GstRTSPSuspendModesuspend-modeRead / Write
gbooleantime-providerRead / Write
+
+
+

Signals

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
voidnew-stateRun Last
voidnew-streamRun Last
voidpreparedRun Last
voidremoved-streamRun Last
voidtarget-stateRun Last
voidunpreparedRun Last
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + +
structGstRTSPMedia
structGstRTSPMediaClass
enumGstRTSPMediaStatus
enumGstRTSPSuspendMode
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GstRTSPMedia
+
+
+
+

Description

+

a GstRTSPMedia contains the complete GStreamer pipeline to manage the +streaming to the clients. The actual data transfer is done by the +GstRTSPStream objects that are created and exposed by the GstRTSPMedia.

+

The GstRTSPMedia is usually created from a GstRTSPMediaFactory when the +client does a DESCRIBE or SETUP of a resource.

+

A media is created with gst_rtsp_media_new() that takes the element that will +provide the streaming elements. For each of the streams, a new GstRTSPStream +object needs to be made with the gst_rtsp_media_create_stream() which takes +the payloader element and the source pad that produces the RTP stream.

+

The pipeline of the media is set to PAUSED with gst_rtsp_media_prepare(). The +prepare method will add rtpbin and sinks and sources to send and receive RTP +and RTCP packets from the clients. Each stream srcpad is connected to an +input into the internal rtpbin.

+

It is also possible to dynamically create GstRTSPStream objects during the +prepare phase. With gst_rtsp_media_get_status() you can check the status of +the prepare phase.

+

After the media is prepared, it is ready for streaming. It will usually be +managed in a session with gst_rtsp_session_manage_media(). See +GstRTSPSession and GstRTSPSessionMedia.

+

The state of the media can be controlled with gst_rtsp_media_set_state(). +Seeking can be done with gst_rtsp_media_seek().

+

With gst_rtsp_media_unprepare() the pipeline is stopped and shut down. When +gst_rtsp_media_set_eos_shutdown() an EOS will be sent to the pipeline to +cleanly shut down.

+

With gst_rtsp_media_set_shared(), the media can be shared between multiple +clients. With gst_rtsp_media_set_reusable() you can control if the pipeline +can be prepared again after an unprepare.

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_media_new ()

+
GstRTSPMedia *
+gst_rtsp_media_new (GstElement *element);
+

Create a new GstRTSPMedia instance. element + is the bin element that +provides the different streams. The GstRTSPMedia object contains the +element to produce RTP data for one or more related (audio/video/..) +streams.

+

Ownership is taken of element +.

+
+

Parameters

+
+++++ + + + + + +

element

a GstElement.

[transfer full]
+
+
+

Returns

+

a new GstRTSPMedia object.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_get_element ()

+
GstElement *
+gst_rtsp_media_get_element (GstRTSPMedia *media);
+

Get the element that was used when constructing media +.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

a GstElement. Unref after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_take_pipeline ()

+
void
+gst_rtsp_media_take_pipeline (GstRTSPMedia *media,
+                              GstPipeline *pipeline);
+

Set pipeline + as the GstPipeline for media +. Ownership is +taken of pipeline +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

pipeline

a GstPipeline.

[transfer full]
+
+
+
+
+

gst_rtsp_media_set_permissions ()

+
void
+gst_rtsp_media_set_permissions (GstRTSPMedia *media,
+                                GstRTSPPermissions *permissions);
+

Set permissions + on media +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

permissions

a GstRTSPPermissions.

[transfer none]
+
+
+
+
+

gst_rtsp_media_get_permissions ()

+
GstRTSPPermissions *
+gst_rtsp_media_get_permissions (GstRTSPMedia *media);
+

Get the permissions object from media +.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

a GstRTSPPermissions object, unref after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_set_shared ()

+
void
+gst_rtsp_media_set_shared (GstRTSPMedia *media,
+                           gboolean shared);
+

Set or unset if the pipeline for media + can be shared will multiple clients. +When shared + is TRUE, client requests for this media will share the media +pipeline.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

shared

the new value

 
+
+
+
+
+

gst_rtsp_media_is_shared ()

+
gboolean
+gst_rtsp_media_is_shared (GstRTSPMedia *media);
+

Check if the pipeline for media + can be shared between multiple clients.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

TRUE if the media can be shared between clients.

+

+
+
+
+
+

gst_rtsp_media_set_reusable ()

+
void
+gst_rtsp_media_set_reusable (GstRTSPMedia *media,
+                             gboolean reusable);
+

Set or unset if the pipeline for media + can be reused after the pipeline has +been unprepared.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

reusable

the new value

 
+
+
+
+
+

gst_rtsp_media_is_reusable ()

+
gboolean
+gst_rtsp_media_is_reusable (GstRTSPMedia *media);
+

Check if the pipeline for media + can be reused after an unprepare.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

TRUE if the media can be reused

+

+
+
+
+
+

gst_rtsp_media_set_profiles ()

+
void
+gst_rtsp_media_set_profiles (GstRTSPMedia *media,
+                             GstRTSPProfile profiles);
+

Configure the allowed lower transport for media +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

profiles

the new flags

 
+
+
+
+
+

gst_rtsp_media_get_profiles ()

+
GstRTSPProfile
+gst_rtsp_media_get_profiles (GstRTSPMedia *media);
+

Get the allowed profiles of media +.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

a GstRTSPProfile

+

+
+
+
+
+

gst_rtsp_media_set_protocols ()

+
void
+gst_rtsp_media_set_protocols (GstRTSPMedia *media,
+                              GstRTSPLowerTrans protocols);
+

Configure the allowed lower transport for media +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

protocols

the new flags

 
+
+
+
+
+

gst_rtsp_media_get_protocols ()

+
GstRTSPLowerTrans
+gst_rtsp_media_get_protocols (GstRTSPMedia *media);
+

Get the allowed protocols of media +.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

a GstRTSPLowerTrans

+

+
+
+
+
+

gst_rtsp_media_set_eos_shutdown ()

+
void
+gst_rtsp_media_set_eos_shutdown (GstRTSPMedia *media,
+                                 gboolean eos_shutdown);
+

Set or unset if an EOS event will be sent to the pipeline for media + before +it is unprepared.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

eos_shutdown

the new value

 
+
+
+
+
+

gst_rtsp_media_is_eos_shutdown ()

+
gboolean
+gst_rtsp_media_is_eos_shutdown (GstRTSPMedia *media);
+

Check if the pipeline for media + will send an EOS down the pipeline before +unpreparing.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

TRUE if the media will send EOS before unpreparing.

+

+
+
+
+
+

gst_rtsp_media_set_address_pool ()

+
void
+gst_rtsp_media_set_address_pool (GstRTSPMedia *media,
+                                 GstRTSPAddressPool *pool);
+

configure pool + to be used as the address pool of media +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

pool

a GstRTSPAddressPool.

[transfer none]
+
+
+
+
+

gst_rtsp_media_get_address_pool ()

+
GstRTSPAddressPool *
+gst_rtsp_media_get_address_pool (GstRTSPMedia *media);
+

Get the GstRTSPAddressPool used as the address pool of media +.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

the GstRTSPAddressPool of media +. g_object_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_set_buffer_size ()

+
void
+gst_rtsp_media_set_buffer_size (GstRTSPMedia *media,
+                                guint size);
+

Set the kernel UDP buffer size.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

size

the new value

 
+
+
+
+
+

gst_rtsp_media_get_buffer_size ()

+
guint
+gst_rtsp_media_get_buffer_size (GstRTSPMedia *media);
+

Get the kernel UDP buffer size.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

the kernel UDP buffer size.

+

+
+
+
+
+

gst_rtsp_media_setup_sdp ()

+
gboolean
+gst_rtsp_media_setup_sdp (GstRTSPMedia *media,
+                          GstSDPMessage *sdp,
+                          GstSDPInfo *info);
+

Add media + specific info to sdp +. info + is used to configure the connection +information in the SDP.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

media

a GstRTSPMedia

 

sdp

a GstSDPMessage.

[transfer none]

info

a GstSDPInfo.

[transfer none]
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

gst_rtsp_media_prepare ()

+
gboolean
+gst_rtsp_media_prepare (GstRTSPMedia *media,
+                        GstRTSPThread *thread);
+

Prepare media + for streaming. This function will create the objects +to manage the streaming. A pipeline must have been set on media + with +gst_rtsp_media_take_pipeline().

+

It will preroll the pipeline and collect vital information about the streams +such as the duration.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

thread

a GstRTSPThread to run the +bus handler or NULL.

[transfer full][allow-none]
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

gst_rtsp_media_unprepare ()

+
gboolean
+gst_rtsp_media_unprepare (GstRTSPMedia *media);
+

Unprepare media +. After this call, the media should be prepared again before +it can be used again. If the media is set to be non-reusable, a new instance +must be created.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

gst_rtsp_media_get_status ()

+
GstRTSPMediaStatus
+gst_rtsp_media_get_status (GstRTSPMedia *media);
+

Get the status of media +. When media + is busy preparing, this function waits +until media + is prepared or in error.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

the status of media +.

+

+
+
+
+
+

gst_rtsp_media_set_suspend_mode ()

+
void
+gst_rtsp_media_set_suspend_mode (GstRTSPMedia *media,
+                                 GstRTSPSuspendMode mode);
+

Control how @ media will be suspended after the SDP has been generated and +after a PAUSE request has been performed.

+

Media must be unprepared when setting the suspend mode.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

mode

the new GstRTSPSuspendMode

 
+
+
+
+
+

gst_rtsp_media_get_suspend_mode ()

+
GstRTSPSuspendMode
+gst_rtsp_media_get_suspend_mode (GstRTSPMedia *media);
+

Get how media + will be suspended.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

GstRTSPSuspendMode.

+

+
+
+
+
+

gst_rtsp_media_suspend ()

+
gboolean
+gst_rtsp_media_suspend (GstRTSPMedia *media);
+

Suspend media +. The state of the pipeline managed by media + is set to +GST_STATE_NULL but all streams are kept. media + can be prepared again +with gst_rtsp_media_unsuspend()

+

media + must be prepared with gst_rtsp_media_prepare();

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

gst_rtsp_media_unsuspend ()

+
gboolean
+gst_rtsp_media_unsuspend (GstRTSPMedia *media);
+

Unsuspend media + if it was in a suspended state. This method does nothing +when the media was not in the suspended state.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

gst_rtsp_media_collect_streams ()

+
void
+gst_rtsp_media_collect_streams (GstRTSPMedia *media);
+

Find all payloader elements, they should be named pay%d in the +element of media +, and create GstRTSPStreams for them.

+

Collect all dynamic elements, named dynpay%d, and add them to +the list of dynamic elements.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+
+
+

gst_rtsp_media_create_stream ()

+
GstRTSPStream *
+gst_rtsp_media_create_stream (GstRTSPMedia *media,
+                              GstElement *payloader,
+                              GstPad *srcpad);
+

Create a new stream in media + that provides RTP data on srcpad +. +srcpad + should be a pad of an element inside media->element +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

media

a GstRTSPMedia

 

payloader

a GstElement

 

srcpad

a source GstPad

 
+
+
+

Returns

+

a new GstRTSPStream that remains valid for as long +as media +exists.

+

[transfer none]

+
+
+
+
+

gst_rtsp_media_n_streams ()

+
guint
+gst_rtsp_media_n_streams (GstRTSPMedia *media);
+

Get the number of streams in this media.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

The number of streams.

+

+
+
+
+
+

gst_rtsp_media_get_stream ()

+
GstRTSPStream *
+gst_rtsp_media_get_stream (GstRTSPMedia *media,
+                           guint idx);
+

Retrieve the stream with index idx + from media +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

idx

the stream index

 
+
+
+

Returns

+

the GstRTSPStream at index +idx +or NULL when a stream with that index did not exist.

+

[nullable][transfer none]

+
+
+
+
+

gst_rtsp_media_find_stream ()

+
GstRTSPStream *
+gst_rtsp_media_find_stream (GstRTSPMedia *media,
+                            const gchar *control);
+

Find a stream in media + with control + as the control uri.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

control

the control of the stream

 
+
+
+

Returns

+

the GstRTSPStream with +control uri control +or NULL when a stream with that control did +not exist.

+

[nullable][transfer none]

+
+
+
+
+

gst_rtsp_media_seek ()

+
gboolean
+gst_rtsp_media_seek (GstRTSPMedia *media,
+                     GstRTSPTimeRange *range);
+

Seek the pipeline of media + to range +. media + must be prepared with +gst_rtsp_media_prepare().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

range

a GstRTSPTimeRange.

[transfer none]
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

gst_rtsp_media_get_range_string ()

+
gchar *
+gst_rtsp_media_get_range_string (GstRTSPMedia *media,
+                                 gboolean play,
+                                 GstRTSPRangeUnit unit);
+

Get the current range as a string. media + must be prepared with +gst_rtsp_media_prepare().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

media

a GstRTSPMedia

 

play

for the PLAY request

 

unit

the unit to use for the string

 
+
+
+

Returns

+

The range as a string, g_free() after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_set_state ()

+
gboolean
+gst_rtsp_media_set_state (GstRTSPMedia *media,
+                          GstState state,
+                          GPtrArray *transports);
+

Set the state of media + to state + and for the transports in transports +.

+

media + must be prepared with gst_rtsp_media_prepare();

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

media

a GstRTSPMedia

 

state

the target state of the media

 

transports

a GPtrArray of GstRTSPStreamTransport pointers.

[transfer none][element-type GstRtspServer.RTSPStreamTransport]
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

gst_rtsp_media_set_pipeline_state ()

+
void
+gst_rtsp_media_set_pipeline_state (GstRTSPMedia *media,
+                                   GstState state);
+

Set the state of the pipeline managed by media + to state +

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

state

the target state of the pipeline

 
+
+
+
+
+

gst_rtsp_media_get_clock ()

+
GstClock *
+gst_rtsp_media_get_clock (GstRTSPMedia *media);
+

Get the clock that is used by the pipeline in media +.

+

media + must be prepared before this method returns a valid clock object.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

the GstClock used by media +. unref after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_get_base_time ()

+
GstClockTime
+gst_rtsp_media_get_base_time (GstRTSPMedia *media);
+

Get the base_time that is used by the pipeline in media +.

+

media + must be prepared before this method returns a valid base_time.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

the base_time used by media +.

+

+
+
+
+
+

gst_rtsp_media_use_time_provider ()

+
void
+gst_rtsp_media_use_time_provider (GstRTSPMedia *media,
+                                  gboolean time_provider);
+

Set media + to provide a GstNetTimeProvider.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPMedia

 

time_provider

if a GstNetTimeProvider should be used

 
+
+
+
+
+

gst_rtsp_media_is_time_provider ()

+
gboolean
+gst_rtsp_media_is_time_provider (GstRTSPMedia *media);
+

Check if media + can provide a GstNetTimeProvider for its pipeline clock.

+

Use gst_rtsp_media_get_time_provider() to get the network clock.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPMedia

 
+
+
+

Returns

+

TRUE if media +can provide a GstNetTimeProvider.

+

+
+
+
+
+

gst_rtsp_media_get_time_provider ()

+
GstNetTimeProvider *
+gst_rtsp_media_get_time_provider (GstRTSPMedia *media,
+                                  const gchar *address,
+                                  guint16 port);
+

Get the GstNetTimeProvider for the clock used by media +. The time provider +will listen on address + and port + for client time requests.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

media

a GstRTSPMedia

 

address

an address or NULL.

[allow-none]

port

a port or 0

 
+
+
+

Returns

+

the GstNetTimeProvider of media +.

+

[transfer full]

+
+
+
+
+

Types and Values

+
+

struct GstRTSPMedia

+
struct GstRTSPMedia;
+

A class that contains the GStreamer element along with a list of +GstRTSPStream objects that can produce data.

+

This object is usually created from a GstRTSPMediaFactory.

+
+
+
+

struct GstRTSPMediaClass

+
struct GstRTSPMediaClass {
+  GObjectClass  parent_class;
+
+  /* vmethods */
+  gboolean        (*handle_message)  (GstRTSPMedia *media, GstMessage *message);
+  gboolean        (*prepare)         (GstRTSPMedia *media, GstRTSPThread *thread);
+  gboolean        (*unprepare)       (GstRTSPMedia *media);
+  gboolean        (*suspend)         (GstRTSPMedia *media);
+  gboolean        (*unsuspend)       (GstRTSPMedia *media);
+  gboolean        (*convert_range)   (GstRTSPMedia *media, GstRTSPTimeRange *range,
+                                      GstRTSPRangeUnit unit);
+  gboolean        (*query_position)  (GstRTSPMedia *media, gint64 *position);
+  gboolean        (*query_stop)      (GstRTSPMedia *media, gint64 *stop);
+  GstElement *    (*create_rtpbin)   (GstRTSPMedia *media);
+  gboolean        (*setup_rtpbin)    (GstRTSPMedia *media, GstElement *rtpbin);
+  gboolean        (*setup_sdp)       (GstRTSPMedia *media, GstSDPMessage *sdp, GstSDPInfo *info);
+
+  /* signals */
+  void            (*new_stream)      (GstRTSPMedia *media, GstRTSPStream * stream);
+  void            (*removed_stream)  (GstRTSPMedia *media, GstRTSPStream * stream);
+
+  void            (*prepared)        (GstRTSPMedia *media);
+  void            (*unprepared)      (GstRTSPMedia *media);
+
+  void            (*target_state)    (GstRTSPMedia *media, GstState state);
+  void            (*new_state)       (GstRTSPMedia *media, GstState state);
+};
+
+

The RTSP media class

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GObjectClass parent_class;

  

handle_message ()

handle a message

 

prepare ()

the default implementation adds all elements and sets the +pipeline's state to GST_STATE_PAUSED (or GST_STATE_PLAYING +in case of NO_PREROLL elements).

 

unprepare ()

the default implementation sets the pipeline's state +to GST_STATE_NULL and removes all elements.

 

suspend ()

the default implementation sets the pipeline's state to +GST_STATE_NULL GST_STATE_PAUSED depending on the selected +suspend mode.

 

unsuspend ()

the default implementation reverts the suspend operation. +The pipeline will be prerolled again if it's state was +set to GST_STATE_NULL in suspend.

 

convert_range ()

convert a range to the given unit

 

query_position ()

query the current position in the pipeline

 

query_stop ()

query when playback will stop

 

create_rtpbin ()

  

setup_rtpbin ()

  

setup_sdp ()

  

new_stream ()

  

removed_stream ()

  

prepared ()

  

unprepared ()

  

target_state ()

  

new_state ()

  
+
+
+
+
+

enum GstRTSPMediaStatus

+

The state of the media pipeline.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GST_RTSP_MEDIA_STATUS_UNPREPARED

+

media pipeline not prerolled

+
 

GST_RTSP_MEDIA_STATUS_UNPREPARING

+

media pipeline is busy doing a clean + shutdown.

+
 

GST_RTSP_MEDIA_STATUS_PREPARING

+

media pipeline is prerolling

+
 

GST_RTSP_MEDIA_STATUS_PREPARED

+

media pipeline is prerolled

+
 

GST_RTSP_MEDIA_STATUS_SUSPENDED

+

media is suspended

+
 

GST_RTSP_MEDIA_STATUS_ERROR

+

media pipeline is in error

+
 
+
+
+
+
+

enum GstRTSPSuspendMode

+

The suspend mode of the media pipeline. A media pipeline is suspended right +after creating the SDP and when the client performs a PAUSED request.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GST_RTSP_SUSPEND_MODE_NONE

+

Media is not suspended

+
 

GST_RTSP_SUSPEND_MODE_PAUSE

+

Media is PAUSED in suspend

+
 

GST_RTSP_SUSPEND_MODE_RESET

+

The media is set to NULL when suspended

+
 
+
+
+
+
+

Property Details

+
+

The “buffer-size” property

+
  “buffer-size”              guint
+

The kernel UDP buffer size to use.

+

Flags: Read / Write

+

Default value: 524288

+
+
+
+

The “element” property

+
  “element”                  GstElement *
+

The GstBin to use for streaming the media.

+

Flags: Read / Write / Construct Only

+
+
+
+

The “eos-shutdown” property

+
  “eos-shutdown”             gboolean
+

Send an EOS event to the pipeline before unpreparing.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “profiles” property

+
  “profiles”                 GstRTSPProfile
+

Allowed transfer profiles.

+

Flags: Read / Write

+

Default value: GST_RTSP_PROFILE_AVP

+
+
+
+

The “protocols” property

+
  “protocols”                GstRTSPLowerTrans
+

Allowed lower transport protocols.

+

Flags: Read / Write

+

Default value: GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_UDP_MCAST | GST_RTSP_LOWER_TRANS_TCP

+
+
+
+

The “reusable” property

+
  “reusable”                 gboolean
+

If this media pipeline can be reused after an unprepare.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “shared” property

+
  “shared”                   gboolean
+

If this media pipeline can be shared.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “suspend-mode” property

+
  “suspend-mode”             GstRTSPSuspendMode
+

How to suspend the media in PAUSED.

+

Flags: Read / Write

+

Default value: GST_RTSP_SUSPEND_MODE_NONE

+
+
+
+

The “time-provider” property

+
  “time-provider”            gboolean
+

Use a NetTimeProvider for clients.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

Signal Details

+
+

The “new-state” signal

+
void
+user_function (GstRTSPMedia *gstrtspmedia,
+               gint          arg1,
+               gpointer      user_data)
+

Flags: Run Last

+
+
+
+

The “new-stream” signal

+
void
+user_function (GstRTSPMedia  *gstrtspmedia,
+               GstRTSPStream *arg1,
+               gpointer       user_data)
+

Flags: Run Last

+
+
+
+

The “prepared” signal

+
void
+user_function (GstRTSPMedia *gstrtspmedia,
+               gpointer      user_data)
+

Flags: Run Last

+
+
+
+

The “removed-stream” signal

+
void
+user_function (GstRTSPMedia  *gstrtspmedia,
+               GstRTSPStream *arg1,
+               gpointer       user_data)
+

Flags: Run Last

+
+
+
+

The “target-state” signal

+
void
+user_function (GstRTSPMedia *gstrtspmedia,
+               gint          arg1,
+               gpointer      user_data)
+

Flags: Run Last

+
+
+
+

The “unprepared” signal

+
void
+user_function (GstRTSPMedia *gstrtspmedia,
+               gpointer      user_data)
+

Flags: Run Last

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/GstRTSPMediaFactory.html b/docs/libs/html/GstRTSPMediaFactory.html new file mode 100644 index 0000000..8ea1709 --- /dev/null +++ b/docs/libs/html/GstRTSPMediaFactory.html @@ -0,0 +1,1201 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPMediaFactory + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPMediaFactory

+

GstRTSPMediaFactory — A factory for media pipelines

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPMediaFactory * + +gst_rtsp_media_factory_new () +
+gchar * + +gst_rtsp_media_factory_get_launch () +
+void + +gst_rtsp_media_factory_set_launch () +
+GstRTSPPermissions * + +gst_rtsp_media_factory_get_permissions () +
+void + +gst_rtsp_media_factory_set_permissions () +
+void + +gst_rtsp_media_factory_add_role () +
+void + +gst_rtsp_media_factory_set_shared () +
+gboolean + +gst_rtsp_media_factory_is_shared () +
+gboolean + +gst_rtsp_media_factory_is_eos_shutdown () +
+void + +gst_rtsp_media_factory_set_eos_shutdown () +
+GstRTSPLowerTrans + +gst_rtsp_media_factory_get_protocols () +
+void + +gst_rtsp_media_factory_set_protocols () +
+void + +gst_rtsp_media_factory_set_profiles () +
+GstRTSPProfile + +gst_rtsp_media_factory_get_profiles () +
+GstRTSPAddressPool * + +gst_rtsp_media_factory_get_address_pool () +
+void + +gst_rtsp_media_factory_set_address_pool () +
+guint + +gst_rtsp_media_factory_get_buffer_size () +
+void + +gst_rtsp_media_factory_set_buffer_size () +
+GstRTSPSuspendMode + +gst_rtsp_media_factory_get_suspend_mode () +
+void + +gst_rtsp_media_factory_set_suspend_mode () +
+GstRTSPMedia * + +gst_rtsp_media_factory_construct () +
+GstElement * + +gst_rtsp_media_factory_create_element () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
guintbuffer-sizeRead / Write
gbooleaneos-shutdownRead / Write
+gchar *launchRead / Write
GstRTSPProfileprofilesRead / Write
GstRTSPLowerTransprotocolsRead / Write
gbooleansharedRead / Write
GstRTSPSuspendModesuspend-modeRead / Write
+
+
+

Signals

+
+++++ + + + + + + + + + + + + +
voidmedia-configureRun Last
voidmedia-constructedRun Last
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
structGstRTSPMediaFactory
structGstRTSPMediaFactoryClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GstRTSPMediaFactory
+
+
+
+

Description

+

The GstRTSPMediaFactory is responsible for creating or recycling +GstRTSPMedia objects based on the passed URL.

+

The default implementation of the object can create GstRTSPMedia objects +containing a pipeline created from a launch description set with +gst_rtsp_media_factory_set_launch().

+

Media from a factory can be shared by setting the shared flag with +gst_rtsp_media_factory_set_shared(). When a factory is shared, +gst_rtsp_media_factory_construct() will return the same GstRTSPMedia when +the url matches.

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_media_factory_new ()

+
GstRTSPMediaFactory *
+gst_rtsp_media_factory_new (void);
+

Create a new GstRTSPMediaFactory instance.

+
+

Returns

+

a new GstRTSPMediaFactory object.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_factory_get_launch ()

+
gchar *
+gst_rtsp_media_factory_get_launch (GstRTSPMediaFactory *factory);
+

Get the gst_parse_launch() pipeline description that will be used in the +default prepare vmethod.

+
+

Parameters

+
+++++ + + + + + +

factory

a GstRTSPMediaFactory

 
+
+
+

Returns

+

the configured launch description. g_free() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_factory_set_launch ()

+
void
+gst_rtsp_media_factory_set_launch (GstRTSPMediaFactory *factory,
+                                   const gchar *launch);
+

The gst_parse_launch() line to use for constructing the pipeline in the +default prepare vmethod.

+

The pipeline description should return a GstBin as the toplevel element +which can be accomplished by enclosing the dscription with brackets '(' +')'.

+

The description should return a pipeline with payloaders named pay0, pay1, +etc.. Each of the payloaders will result in a stream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

launch

the launch description

 
+
+
+
+
+

gst_rtsp_media_factory_get_permissions ()

+
GstRTSPPermissions *
+gst_rtsp_media_factory_get_permissions
+                               (GstRTSPMediaFactory *factory);
+

Get the permissions object from factory +.

+
+

Parameters

+
+++++ + + + + + +

factory

a GstRTSPMediaFactory

 
+
+
+

Returns

+

a GstRTSPPermissions object, unref after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_factory_set_permissions ()

+
void
+gst_rtsp_media_factory_set_permissions
+                               (GstRTSPMediaFactory *factory,
+                                GstRTSPPermissions *permissions);
+

Set permissions + on factory +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

permissions

a GstRTSPPermissions.

[transfer none]
+
+
+
+
+

gst_rtsp_media_factory_add_role ()

+
void
+gst_rtsp_media_factory_add_role (GstRTSPMediaFactory *factory,
+                                 const gchar *role,
+                                 const gchar *fieldname,
+                                 ...);
+

A convenience method to add role + with fieldname + and additional arguments to +the permissions of factory +. If factory + had no permissions, new permissions +will be created and the role will be added to it.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

role

a role

 

fieldname

the first field name

 

...

additional arguments

 
+
+
+
+
+

gst_rtsp_media_factory_set_shared ()

+
void
+gst_rtsp_media_factory_set_shared (GstRTSPMediaFactory *factory,
+                                   gboolean shared);
+

Configure if media created from this factory can be shared between clients.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

shared

the new value

 
+
+
+
+
+

gst_rtsp_media_factory_is_shared ()

+
gboolean
+gst_rtsp_media_factory_is_shared (GstRTSPMediaFactory *factory);
+

Get if media created from this factory can be shared between clients.

+
+

Parameters

+
+++++ + + + + + +

factory

a GstRTSPMediaFactory

 
+
+
+

Returns

+

TRUE if the media will be shared between clients.

+

+
+
+
+
+

gst_rtsp_media_factory_is_eos_shutdown ()

+
gboolean
+gst_rtsp_media_factory_is_eos_shutdown
+                               (GstRTSPMediaFactory *factory);
+

Get if media created from this factory will have an EOS event sent to the +pipeline before shutdown.

+
+

Parameters

+
+++++ + + + + + +

factory

a GstRTSPMediaFactory

 
+
+
+

Returns

+

TRUE if the media will receive EOS before shutdown.

+

+
+
+
+
+

gst_rtsp_media_factory_set_eos_shutdown ()

+
void
+gst_rtsp_media_factory_set_eos_shutdown
+                               (GstRTSPMediaFactory *factory,
+                                gboolean eos_shutdown);
+

Configure if media created from this factory will have an EOS sent to the +pipeline before shutdown.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

eos_shutdown

the new value

 
+
+
+
+
+

gst_rtsp_media_factory_get_protocols ()

+
GstRTSPLowerTrans
+gst_rtsp_media_factory_get_protocols (GstRTSPMediaFactory *factory);
+

Get the allowed protocols of factory +.

+
+

Parameters

+
+++++ + + + + + +

factory

a GstRTSPMediaFactory

 
+
+
+

Returns

+

a GstRTSPLowerTrans

+

+
+
+
+
+

gst_rtsp_media_factory_set_protocols ()

+
void
+gst_rtsp_media_factory_set_protocols (GstRTSPMediaFactory *factory,
+                                      GstRTSPLowerTrans protocols);
+

Configure the allowed lower transport for factory +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

protocols

the new flags

 
+
+
+
+
+

gst_rtsp_media_factory_set_profiles ()

+
void
+gst_rtsp_media_factory_set_profiles (GstRTSPMediaFactory *factory,
+                                     GstRTSPProfile profiles);
+

Configure the allowed profiles for factory +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

profiles

the new flags

 
+
+
+
+
+

gst_rtsp_media_factory_get_profiles ()

+
GstRTSPProfile
+gst_rtsp_media_factory_get_profiles (GstRTSPMediaFactory *factory);
+

Get the allowed profiles of factory +.

+
+

Parameters

+
+++++ + + + + + +

factory

a GstRTSPMediaFactory

 
+
+
+

Returns

+

a GstRTSPProfile

+

+
+
+
+
+

gst_rtsp_media_factory_get_address_pool ()

+
GstRTSPAddressPool *
+gst_rtsp_media_factory_get_address_pool
+                               (GstRTSPMediaFactory *factory);
+

Get the GstRTSPAddressPool used as the address pool of factory +.

+
+

Parameters

+
+++++ + + + + + +

factory

a GstRTSPMediaFactory

 
+
+
+

Returns

+

the GstRTSPAddressPool of factory +. g_object_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_factory_set_address_pool ()

+
void
+gst_rtsp_media_factory_set_address_pool
+                               (GstRTSPMediaFactory *factory,
+                                GstRTSPAddressPool *pool);
+

configure pool + to be used as the address pool of factory +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

pool

a GstRTSPAddressPool.

[transfer none]
+
+
+
+
+

gst_rtsp_media_factory_get_buffer_size ()

+
guint
+gst_rtsp_media_factory_get_buffer_size
+                               (GstRTSPMediaFactory *factory);
+

Get the kernel UDP buffer size.

+
+

Parameters

+
+++++ + + + + + +

factory

a GstRTSPMedia

 
+
+
+

Returns

+

the kernel UDP buffer size.

+

+
+
+
+
+

gst_rtsp_media_factory_set_buffer_size ()

+
void
+gst_rtsp_media_factory_set_buffer_size
+                               (GstRTSPMediaFactory *factory,
+                                guint size);
+

Set the kernel UDP buffer size.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMedia

 

size

the new value

 
+
+
+
+
+

gst_rtsp_media_factory_get_suspend_mode ()

+
GstRTSPSuspendMode
+gst_rtsp_media_factory_get_suspend_mode
+                               (GstRTSPMediaFactory *factory);
+

Get how media created from this factory will be suspended.

+
+

Parameters

+
+++++ + + + + + +

factory

a GstRTSPMediaFactory

 
+
+
+

Returns

+

a GstRTSPSuspendMode.

+

+
+
+
+
+

gst_rtsp_media_factory_set_suspend_mode ()

+
void
+gst_rtsp_media_factory_set_suspend_mode
+                               (GstRTSPMediaFactory *factory,
+                                GstRTSPSuspendMode mode);
+

Configure how media created from this factory will be suspended.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

mode

the new GstRTSPSuspendMode

 
+
+
+
+
+

gst_rtsp_media_factory_construct ()

+
GstRTSPMedia *
+gst_rtsp_media_factory_construct (GstRTSPMediaFactory *factory,
+                                  const GstRTSPUrl *url);
+

Construct the media object and create its streams. Implementations +should create the needed gstreamer elements and add them to the result +object. No state changes should be performed on them yet.

+

One or more GstRTSPStream objects should be created from the result +with gst_rtsp_media_create_stream().

+

After the media is constructed, it can be configured and then prepared +with gst_rtsp_media_prepare().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

url

the url used

 
+
+
+

Returns

+

a new GstRTSPMedia if the media could be prepared.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_factory_create_element ()

+
GstElement *
+gst_rtsp_media_factory_create_element (GstRTSPMediaFactory *factory,
+                                       const GstRTSPUrl *url);
+

Construct and return a GstElement that is a GstBin containing +the elements to use for streaming the media.

+

The bin should contain payloaders pay%d for each stream. The default +implementation of this function returns the bin created from the +launch parameter.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

url

the url used

 
+
+
+

Returns

+

a new GstElement.

+

[transfer floating]

+
+
+
+
+

Types and Values

+
+

struct GstRTSPMediaFactory

+
struct GstRTSPMediaFactory;
+

The definition and logic for constructing the pipeline for a media. The media +can contain multiple streams like audio and video.

+
+
+
+

struct GstRTSPMediaFactoryClass

+
struct GstRTSPMediaFactoryClass {
+  GObjectClass  parent_class;
+
+  gchar *         (*gen_key)            (GstRTSPMediaFactory *factory, const GstRTSPUrl *url);
+
+  GstElement *    (*create_element)     (GstRTSPMediaFactory *factory, const GstRTSPUrl *url);
+  GstRTSPMedia *  (*construct)          (GstRTSPMediaFactory *factory, const GstRTSPUrl *url);
+  GstElement *    (*create_pipeline)    (GstRTSPMediaFactory *factory, GstRTSPMedia *media);
+  void            (*configure)          (GstRTSPMediaFactory *factory, GstRTSPMedia *media);
+
+  /* signals */
+  void            (*media_constructed)  (GstRTSPMediaFactory *factory, GstRTSPMedia *media);
+  void            (*media_configure)    (GstRTSPMediaFactory *factory, GstRTSPMedia *media);
+};
+
+

The GstRTSPMediaFactory class structure.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GObjectClass parent_class;

  

gen_key ()

convert url +to a key for caching shared GstRTSPMedia objects. +The default implementation of this function will use the complete URL +including the query parameters to return a key.

 

create_element ()

Construct and return a GstElement that is a GstBin containing +the elements to use for streaming the media. The bin should contain +payloaders pay%d for each stream. The default implementation of this +function returns the bin created from the launch parameter.

 

construct ()

the vmethod that will be called when the factory has to create the +GstRTSPMedia for url +. The default implementation of this +function calls create_element to retrieve an element and then looks for +pay%d to create the streams.

 

create_pipeline ()

create a new pipeline or re-use an existing one and +add the GstRTSPMedia's element created by construct +to the pipeline.

 

configure ()

configure the media created with construct +. The default +implementation will configure the 'shared' property of the media.

 

media_constructed ()

signal emited when a media was constructed

 

media_configure ()

signal emited when a media should be configured

 
+
+
+
+
+

Property Details

+
+

The “buffer-size” property

+
  “buffer-size”              guint
+

The kernel UDP buffer size to use.

+

Flags: Read / Write

+

Default value: 524288

+
+
+
+

The “eos-shutdown” property

+
  “eos-shutdown”             gboolean
+

Send EOS down the pipeline before shutting down.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “launch” property

+
  “launch”                   gchar *
+

A launch description of the pipeline.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “profiles” property

+
  “profiles”                 GstRTSPProfile
+

Allowed transfer profiles.

+

Flags: Read / Write

+

Default value: GST_RTSP_PROFILE_AVP

+
+
+
+

The “protocols” property

+
  “protocols”                GstRTSPLowerTrans
+

Allowed lower transport protocols.

+

Flags: Read / Write

+

Default value: GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_UDP_MCAST | GST_RTSP_LOWER_TRANS_TCP

+
+
+
+

The “shared” property

+
  “shared”                   gboolean
+

If media from this factory is shared.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+
+

The “suspend-mode” property

+
  “suspend-mode”             GstRTSPSuspendMode
+

Control how media will be suspended.

+

Flags: Read / Write

+

Default value: GST_RTSP_SUSPEND_MODE_NONE

+
+
+
+

Signal Details

+
+

The “media-configure” signal

+
void
+user_function (GstRTSPMediaFactory *gstrtspmediafactory,
+               GstRTSPMedia        *arg1,
+               gpointer             user_data)
+

Flags: Run Last

+
+
+
+

The “media-constructed” signal

+
void
+user_function (GstRTSPMediaFactory *gstrtspmediafactory,
+               GstRTSPMedia        *arg1,
+               gpointer             user_data)
+

Flags: Run Last

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/GstRTSPMountPoints.html b/docs/libs/html/GstRTSPMountPoints.html new file mode 100644 index 0000000..838066e --- /dev/null +++ b/docs/libs/html/GstRTSPMountPoints.html @@ -0,0 +1,353 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPMountPoints + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPMountPoints

+

GstRTSPMountPoints — Map a path to media

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPMountPoints * + +gst_rtsp_mount_points_new () +
+void + +gst_rtsp_mount_points_add_factory () +
+void + +gst_rtsp_mount_points_remove_factory () +
+GstRTSPMediaFactory * + +gst_rtsp_mount_points_match () +
+gchar * + +gst_rtsp_mount_points_make_path () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
structGstRTSPMountPoints
structGstRTSPMountPointsClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GstRTSPMountPoints
+
+
+
+

Description

+

A GstRTSPMountPoints object maintains a relation between paths +and GstRTSPMediaFactory objects. This object is usually given to +GstRTSPClient and used to find the media attached to a path.

+

With gst_rtsp_mount_points_add_factory() and +gst_rtsp_mount_points_remove_factory(), factories can be added and +removed.

+

With gst_rtsp_mount_points_match() you can find the GstRTSPMediaFactory +object that completely matches the given path.

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_mount_points_new ()

+
GstRTSPMountPoints *
+gst_rtsp_mount_points_new (void);
+

Make a new mount points object.

+
+

Returns

+

a new GstRTSPMountPoints.

+

[transfer full]

+
+
+
+
+

gst_rtsp_mount_points_add_factory ()

+
void
+gst_rtsp_mount_points_add_factory (GstRTSPMountPoints *mounts,
+                                   const gchar *path,
+                                   GstRTSPMediaFactory *factory);
+

Attach factory + to the mount point path + in mounts +.

+

path + is of the form (/node)+. Any previous mount point will be freed.

+

Ownership is taken of the reference on factory + so that factory + should not be +used after calling this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

mounts

a GstRTSPMountPoints

 

path

a mount point

 

factory

a GstRTSPMediaFactory.

[transfer full]
+
+
+
+
+

gst_rtsp_mount_points_remove_factory ()

+
void
+gst_rtsp_mount_points_remove_factory (GstRTSPMountPoints *mounts,
+                                      const gchar *path);
+

Remove the GstRTSPMediaFactory associated with path + in mounts +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

mounts

a GstRTSPMountPoints

 

path

a mount point

 
+
+
+
+
+

gst_rtsp_mount_points_match ()

+
GstRTSPMediaFactory *
+gst_rtsp_mount_points_match (GstRTSPMountPoints *mounts,
+                             const gchar *path,
+                             gint *matched);
+

Find the factory in mounts + that has the longest match with path +.

+

If matched + is NULL, path + will match the factory exactly otherwise +the amount of characters that matched is returned in matched +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

mounts

a GstRTSPMountPoints

 

path

a mount point

 

matched

the amount of path +matched.

[out][allow-none]
+
+
+

Returns

+

the GstRTSPMediaFactory for path +. +g_object_unref() after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_mount_points_make_path ()

+
gchar *
+gst_rtsp_mount_points_make_path (GstRTSPMountPoints *mounts,
+                                 const GstRTSPUrl *url);
+

Make a path string from url +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

mounts

a GstRTSPMountPoints

 

url

a GstRTSPUrl

 
+
+
+

Returns

+

a path string for url +, g_free() after usage.

+

[transfer full]

+
+
+
+
+

Types and Values

+
+

struct GstRTSPMountPoints

+
struct GstRTSPMountPoints;
+

Creates a GstRTSPMediaFactory object for a given url.

+
+
+
+

struct GstRTSPMountPointsClass

+
struct GstRTSPMountPointsClass {
+  GObjectClass  parent_class;
+
+  gchar * (*make_path) (GstRTSPMountPoints *mounts,
+                        const GstRTSPUrl *url);
+};
+
+

The class for the media mounts object.

+
+

Members

+
+++++ + + + + + + + + + + + + +

GObjectClass parent_class;

  

make_path ()

make a path from the given url.

 
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/GstRTSPServer.html b/docs/libs/html/GstRTSPServer.html new file mode 100644 index 0000000..435205c --- /dev/null +++ b/docs/libs/html/GstRTSPServer.html @@ -0,0 +1,1302 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPServer + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPServer

+

GstRTSPServer — The main server object

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPServer * + +gst_rtsp_server_new () +
+gchar * + +gst_rtsp_server_get_address () +
+void + +gst_rtsp_server_set_address () +
+gchar * + +gst_rtsp_server_get_service () +
+void + +gst_rtsp_server_set_service () +
+gint + +gst_rtsp_server_get_backlog () +
+void + +gst_rtsp_server_set_backlog () +
+int + +gst_rtsp_server_get_bound_port () +
+GstRTSPMountPoints * + +gst_rtsp_server_get_mount_points () +
+void + +gst_rtsp_server_set_mount_points () +
+GstRTSPSessionPool * + +gst_rtsp_server_get_session_pool () +
+void + +gst_rtsp_server_set_session_pool () +
+GstRTSPThreadPool * + +gst_rtsp_server_get_thread_pool () +
+void + +gst_rtsp_server_set_thread_pool () +
+GstRTSPAuth * + +gst_rtsp_server_get_auth () +
+void + +gst_rtsp_server_set_auth () +
+gboolean + +gst_rtsp_server_transfer_connection () +
+gboolean + +gst_rtsp_server_io_func () +
+GSocket * + +gst_rtsp_server_create_socket () +
+GSource * + +gst_rtsp_server_create_source () +
+guint + +gst_rtsp_server_attach () +
+GstRTSPFilterResult + +(*GstRTSPServerClientFilterFunc) () +
+GList * + +gst_rtsp_server_client_filter () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *addressRead / Write
gintbacklogRead / Write
gintbound-portRead
+GstRTSPMountPoints *mount-pointsRead / Write
+gchar *serviceRead / Write
+GstRTSPSessionPool *session-poolRead / Write
+
+
+

Signals

+
+++++ + + + + + +
voidclient-connectedRun Last
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
structGstRTSPServer
structGstRTSPServerClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GstRTSPServer
+
+
+
+

Description

+

The server object is the object listening for connections on a port and +creating GstRTSPClient objects to handle those connections.

+

The server will listen on the address set with gst_rtsp_server_set_address() +and the port or service configured with gst_rtsp_server_set_service(). +Use gst_rtsp_server_set_backlog() to configure the amount of pending requests +that the server will keep. By default the server listens on the current +network (0.0.0.0) and port 8554.

+

The server will require an SSL connection when a TLS certificate has been +set in the auth object with gst_rtsp_auth_set_tls_certificate().

+

To start the server, use gst_rtsp_server_attach() to attach it to a +GMainContext. For more control, gst_rtsp_server_create_source() and +gst_rtsp_server_create_socket() can be used to get a GSource and GSocket +respectively.

+

gst_rtsp_server_transfer_connection() can be used to transfer an existing +socket to the RTSP server, for example from an HTTP server.

+

Once the server socket is attached to a mainloop, it will start accepting +connections. When a new connection is received, a new GstRTSPClient object +is created to handle the connection. The new client will be configured with +the server GstRTSPAuth, GstRTSPMountPoints, GstRTSPSessionPool and +GstRTSPThreadPool.

+

The server uses the configured GstRTSPThreadPool object to handle the +remainder of the communication with this client.

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_server_new ()

+
GstRTSPServer *
+gst_rtsp_server_new (void);
+

Create a new GstRTSPServer instance.

+
+

Returns

+

a new GstRTSPServer.

+

[transfer full]

+
+
+
+
+

gst_rtsp_server_get_address ()

+
gchar *
+gst_rtsp_server_get_address (GstRTSPServer *server);
+

Get the address on which the server will accept connections.

+
+

Parameters

+
+++++ + + + + + +

server

a GstRTSPServer

 
+
+
+

Returns

+

the server address. g_free() after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_server_set_address ()

+
void
+gst_rtsp_server_set_address (GstRTSPServer *server,
+                             const gchar *address);
+

Configure server + to accept connections on the given address.

+

This function must be called before the server is bound.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a GstRTSPServer

 

address

the address

 
+
+
+
+
+

gst_rtsp_server_get_service ()

+
gchar *
+gst_rtsp_server_get_service (GstRTSPServer *server);
+

Get the service on which the server will accept connections.

+
+

Parameters

+
+++++ + + + + + +

server

a GstRTSPServer

 
+
+
+

Returns

+

the service. use g_free() after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_server_set_service ()

+
void
+gst_rtsp_server_set_service (GstRTSPServer *server,
+                             const gchar *service);
+

Configure server + to accept connections on the given service. +service + should be a string containing the service name (see services(5)) or +a string containing a port number between 1 and 65535.

+

When service + is set to "0", the server will listen on a random free +port. The actual used port can be retrieved with +gst_rtsp_server_get_bound_port().

+

This function must be called before the server is bound.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a GstRTSPServer

 

service

the service

 
+
+
+
+
+

gst_rtsp_server_get_backlog ()

+
gint
+gst_rtsp_server_get_backlog (GstRTSPServer *server);
+

The maximum amount of queued requests for the server.

+
+

Parameters

+
+++++ + + + + + +

server

a GstRTSPServer

 
+
+
+

Returns

+

the server backlog.

+

+
+
+
+
+

gst_rtsp_server_set_backlog ()

+
void
+gst_rtsp_server_set_backlog (GstRTSPServer *server,
+                             gint backlog);
+

configure the maximum amount of requests that may be queued for the +server.

+

This function must be called before the server is bound.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a GstRTSPServer

 

backlog

the backlog

 
+
+
+
+
+

gst_rtsp_server_get_bound_port ()

+
int
+gst_rtsp_server_get_bound_port (GstRTSPServer *server);
+

Get the port number where the server was bound to.

+
+

Parameters

+
+++++ + + + + + +

server

a GstRTSPServer

 
+
+
+

Returns

+

the port number

+

+
+
+
+
+

gst_rtsp_server_get_mount_points ()

+
GstRTSPMountPoints *
+gst_rtsp_server_get_mount_points (GstRTSPServer *server);
+

Get the GstRTSPMountPoints used as the mount points of server +.

+
+

Parameters

+
+++++ + + + + + +

server

a GstRTSPServer

 
+
+
+

Returns

+

the GstRTSPMountPoints of server +. g_object_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_server_set_mount_points ()

+
void
+gst_rtsp_server_set_mount_points (GstRTSPServer *server,
+                                  GstRTSPMountPoints *mounts);
+

configure mounts + to be used as the mount points of server +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a GstRTSPServer

 

mounts

a GstRTSPMountPoints.

[transfer none]
+
+
+
+
+

gst_rtsp_server_get_session_pool ()

+
GstRTSPSessionPool *
+gst_rtsp_server_get_session_pool (GstRTSPServer *server);
+

Get the GstRTSPSessionPool used as the session pool of server +.

+
+

Parameters

+
+++++ + + + + + +

server

a GstRTSPServer

 
+
+
+

Returns

+

the GstRTSPSessionPool used for sessions. g_object_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_server_set_session_pool ()

+
void
+gst_rtsp_server_set_session_pool (GstRTSPServer *server,
+                                  GstRTSPSessionPool *pool);
+

configure pool + to be used as the session pool of server +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a GstRTSPServer

 

pool

a GstRTSPSessionPool.

[transfer none]
+
+
+
+
+

gst_rtsp_server_get_thread_pool ()

+
GstRTSPThreadPool *
+gst_rtsp_server_get_thread_pool (GstRTSPServer *server);
+

Get the GstRTSPThreadPool used as the thread pool of server +.

+
+

Parameters

+
+++++ + + + + + +

server

a GstRTSPServer

 
+
+
+

Returns

+

the GstRTSPThreadPool of server +. g_object_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_server_set_thread_pool ()

+
void
+gst_rtsp_server_set_thread_pool (GstRTSPServer *server,
+                                 GstRTSPThreadPool *pool);
+

configure pool + to be used as the thread pool of server +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a GstRTSPServer

 

pool

a GstRTSPThreadPool.

[transfer none]
+
+
+
+
+

gst_rtsp_server_get_auth ()

+
GstRTSPAuth *
+gst_rtsp_server_get_auth (GstRTSPServer *server);
+

Get the GstRTSPAuth used as the authentication manager of server +.

+
+

Parameters

+
+++++ + + + + + +

server

a GstRTSPServer

 
+
+
+

Returns

+

the GstRTSPAuth of server +. g_object_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_server_set_auth ()

+
void
+gst_rtsp_server_set_auth (GstRTSPServer *server,
+                          GstRTSPAuth *auth);
+

configure auth + to be used as the authentication manager of server +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a GstRTSPServer

 

auth

a GstRTSPAuth.

[transfer none]
+
+
+
+
+

gst_rtsp_server_transfer_connection ()

+
gboolean
+gst_rtsp_server_transfer_connection (GstRTSPServer *server,
+                                     GSocket *socket,
+                                     const gchar *ip,
+                                     gint port,
+                                     const gchar *initial_buffer);
+

Take an existing network socket and use it for an RTSP connection. This +is used when transferring a socket from an HTTP server which should be used +as an RTSP over HTTP tunnel. The initial_buffer + contains any remaining data +that the HTTP server read from the socket while parsing the HTTP header.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

server

a GstRTSPServer

 

socket

a network socket.

[transfer full]

ip

the IP address of the remote client

 

port

the port used by the other end

 

initial_buffer

any initial data that was already read from the socket

 
+
+
+

Returns

+

TRUE if all was ok, FALSE if an error occurred.

+

+
+
+
+
+

gst_rtsp_server_io_func ()

+
gboolean
+gst_rtsp_server_io_func (GSocket *socket,
+                         GIOCondition condition,
+                         GstRTSPServer *server);
+

A default GSocketSourceFunc that creates a new GstRTSPClient to accept and handle a +new connection on socket + or server +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

socket

a GSocket

 

condition

the condition on source +

 

server

a GstRTSPServer.

[transfer none]
+
+
+

Returns

+

TRUE if the source could be connected, FALSE if an error occurred.

+

+
+
+
+
+

gst_rtsp_server_create_socket ()

+
GSocket *
+gst_rtsp_server_create_socket (GstRTSPServer *server,
+                               GCancellable *cancellable,
+                               GError **error);
+

Create a GSocket for server +. The socket will listen on the +configured service.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

server

a GstRTSPServer

 

cancellable

a GCancellable.

[allow-none]

error

a GError.

[out]
+
+
+

Returns

+

the GSocket for server +or NULL when an error +occurred.

+

[transfer full]

+
+
+
+
+

gst_rtsp_server_create_source ()

+
GSource *
+gst_rtsp_server_create_source (GstRTSPServer *server,
+                               GCancellable *cancellable,
+                               GError **error);
+

Create a GSource for server +. The new source will have a default +GSocketSourceFunc of gst_rtsp_server_io_func().

+

cancellable + if not NULL can be used to cancel the source, which will cause +the source to trigger, reporting the current condition (which is likely 0 +unless cancellation happened at the same time as a condition change). You can +check for this in the callback using g_cancellable_is_cancelled().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

server

a GstRTSPServer

 

cancellable

a GCancellable or NULL.

[allow-none]

error

a GError.

[out]
+
+
+

Returns

+

the GSource for server +or NULL when an error +occurred. Free with g_source_unref().

+

[transfer full]

+
+
+
+
+

gst_rtsp_server_attach ()

+
guint
+gst_rtsp_server_attach (GstRTSPServer *server,
+                        GMainContext *context);
+

Attaches server + to context +. When the mainloop for context + is run, the +server will be dispatched. When context + is NULL, the default context will be +used).

+

This function should be called when the server properties and urls are fully +configured and the server is ready to start.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

server

a GstRTSPServer

 

context

a GMainContext.

[allow-none]
+
+
+

Returns

+

the ID (greater than 0) for the source within the GMainContext.

+

+
+
+
+
+

GstRTSPServerClientFilterFunc ()

+
GstRTSPFilterResult
+(*GstRTSPServerClientFilterFunc) (GstRTSPServer *server,
+                                  GstRTSPClient *client,
+                                  gpointer user_data);
+

This function will be called by the gst_rtsp_server_client_filter(). An +implementation should return a value of GstRTSPFilterResult.

+

When this function returns GST_RTSP_FILTER_REMOVE, client + will be removed +from server +.

+

A return value of GST_RTSP_FILTER_KEEP will leave client + untouched in +server +.

+

A value of GST_RTSP_FILTER_REF will add client + to the result GList of +gst_rtsp_server_client_filter().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

server

a GstRTSPServer object

 

client

a GstRTSPClient in server +

 

user_data

user data that has been given to gst_rtsp_server_client_filter()

 
+
+
+

Returns

+

a GstRTSPFilterResult.

+

+
+
+
+
+

gst_rtsp_server_client_filter ()

+
GList *
+gst_rtsp_server_client_filter (GstRTSPServer *server,
+                               GstRTSPServerClientFilterFunc func,
+                               gpointer user_data);
+

Call func + for each client managed by server +. The result value of func + +determines what happens to the client. func + will be called with server + +locked so no further actions on server + can be performed from func +.

+

If func + returns GST_RTSP_FILTER_REMOVE, the client will be removed from +server +.

+

If func + returns GST_RTSP_FILTER_KEEP, the client will remain in server +.

+

If func + returns GST_RTSP_FILTER_REF, the client will remain in server + but +will also be added with an additional ref to the result GList of this +function..

+

When func + is NULL, GST_RTSP_FILTER_REF will be assumed for each client.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

server

a GstRTSPServer

 

func

a callback.

[scope call][allow-none]

user_data

user data passed to func +

 
+
+
+

Returns

+

a GList with all +clients for which func +returned GST_RTSP_FILTER_REF. After usage, each +element in the GList should be unreffed before the list is freed.

+

[element-type GstRTSPClient][transfer full]

+
+
+
+
+

Types and Values

+
+

struct GstRTSPServer

+
struct GstRTSPServer;
+

This object listens on a port, creates and manages the clients connected to +it.

+
+
+
+

struct GstRTSPServerClass

+
struct GstRTSPServerClass {
+  GObjectClass  parent_class;
+
+  GstRTSPClient * (*create_client)      (GstRTSPServer *server);
+
+  /* signals */
+  void            (*client_connected)   (GstRTSPServer *server, GstRTSPClient *client);
+};
+
+

The RTSP server class structure

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GObjectClass parent_class;

  

create_client ()

Create, configure a new GstRTSPClient +object that handles the new connection on socket +. The default +implementation will create a GstRTSPClient and will configure the +mount-points, auth, session-pool and thread-pool on the client.

 

client_connected ()

emited when a new client connected.

 
+
+
+
+
+

Property Details

+
+

The “address” property

+
  “address”                  gchar *
+

The address the server uses to listen on.

+

Flags: Read / Write

+

Default value: "0.0.0.0"

+
+
+
+

The “backlog” property

+
  “backlog”                  gint
+

The maximum length to which the queue of pending connections may grow.

+

Flags: Read / Write

+

Allowed values: >= 0

+

Default value: 5

+
+
+
+

The “bound-port” property

+
  “bound-port”               gint
+

The port number the server is listening on.

+

Flags: Read

+

Allowed values: [-1,65535]

+

Default value: -1

+
+
+
+

The “mount-points” property

+
  “mount-points”             GstRTSPMountPoints *
+

The mount points to use for client session.

+

Flags: Read / Write

+
+
+
+

The “service” property

+
  “service”                  gchar *
+

The service or port number the server uses to listen on.

+

Flags: Read / Write

+

Default value: "8554"

+
+
+
+

The “session-pool” property

+
  “session-pool”             GstRTSPSessionPool *
+

The session pool to use for client session.

+

Flags: Read / Write

+
+
+
+

Signal Details

+
+

The “client-connected” signal

+
void
+user_function (GstRTSPServer *gstrtspserver,
+               GstRTSPClient *arg1,
+               gpointer       user_data)
+

Flags: Run Last

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/GstRTSPSession.html b/docs/libs/html/GstRTSPSession.html new file mode 100644 index 0000000..e61e4a9 --- /dev/null +++ b/docs/libs/html/GstRTSPSession.html @@ -0,0 +1,881 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPSession + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPSession

+

GstRTSPSession — An object to manage media

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPSession * + +gst_rtsp_session_new () +
const gchar * + +gst_rtsp_session_get_sessionid () +
+gchar * + +gst_rtsp_session_get_header () +
+void + +gst_rtsp_session_set_timeout () +
+guint + +gst_rtsp_session_get_timeout () +
+void + +gst_rtsp_session_touch () +
+void + +gst_rtsp_session_prevent_expire () +
+void + +gst_rtsp_session_allow_expire () +
+gint + +gst_rtsp_session_next_timeout () +
+gboolean + +gst_rtsp_session_is_expired () +
+GstRTSPSessionMedia * + +gst_rtsp_session_manage_media () +
+gboolean + +gst_rtsp_session_release_media () +
+GstRTSPSessionMedia * + +gst_rtsp_session_get_media () +
+GstRTSPFilterResult + +(*GstRTSPSessionFilterFunc) () +
+GList * + +gst_rtsp_session_filter () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+gchar *sessionidRead / Write / Construct Only
guinttimeoutRead / Write
gbooleantimeout-always-visibleRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
structGstRTSPSession
structGstRTSPSessionClass
enumGstRTSPFilterResult
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GstRTSPSession
+
+
+
+

Description

+

The GstRTSPSession is identified by an id, unique in the +GstRTSPSessionPool that created the session and manages media and its +configuration.

+

A GstRTSPSession has a timeout that can be retrieved with +gst_rtsp_session_get_timeout(). You can check if the sessions is expired with +gst_rtsp_session_is_expired(). gst_rtsp_session_touch() will reset the +expiration counter of the session.

+

When a client configures a media with SETUP, a session will be created to +keep track of the configuration of that media. With +gst_rtsp_session_manage_media(), the media is added to the managed media +in the session. With gst_rtsp_session_release_media() the media can be +released again from the session. Managed media is identified in the sessions +with a url. Use gst_rtsp_session_get_media() to get the media that matches +(part of) the given url.

+

The media in a session can be iterated with gst_rtsp_session_filter().

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_session_new ()

+
GstRTSPSession *
+gst_rtsp_session_new (const gchar *sessionid);
+

Create a new GstRTSPSession instance with sessionid +.

+
+

Parameters

+
+++++ + + + + + +

sessionid

a session id

 
+
+
+

Returns

+

a new GstRTSPSession.

+

[transfer full]

+
+
+
+
+

gst_rtsp_session_get_sessionid ()

+
const gchar *
+gst_rtsp_session_get_sessionid (GstRTSPSession *session);
+

Get the sessionid of session +.

+
+

Parameters

+
+++++ + + + + + +

session

a GstRTSPSession

 
+
+
+

Returns

+

the sessionid of session +. The value remains valid +as long as session +is alive.

+

[transfer none]

+
+
+
+
+

gst_rtsp_session_get_header ()

+
gchar *
+gst_rtsp_session_get_header (GstRTSPSession *session);
+

Get the string that can be placed in the Session header field.

+
+

Parameters

+
+++++ + + + + + +

session

a GstRTSPSession

 
+
+
+

Returns

+

the Session header of session +. g_free() after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_session_set_timeout ()

+
void
+gst_rtsp_session_set_timeout (GstRTSPSession *session,
+                              guint timeout);
+

Configure session + for a timeout of timeout + seconds. The session will be +cleaned up when there is no activity for timeout + seconds.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

session

a GstRTSPSession

 

timeout

the new timeout

 
+
+
+
+
+

gst_rtsp_session_get_timeout ()

+
guint
+gst_rtsp_session_get_timeout (GstRTSPSession *session);
+

Get the timeout value of session +.

+
+

Parameters

+
+++++ + + + + + +

session

a GstRTSPSession

 
+
+
+

Returns

+

the timeout of session +in seconds.

+

+
+
+
+
+

gst_rtsp_session_touch ()

+
void
+gst_rtsp_session_touch (GstRTSPSession *session);
+

Update the last_access time of the session to the current time.

+
+

Parameters

+
+++++ + + + + + +

session

a GstRTSPSession

 
+
+
+
+
+

gst_rtsp_session_prevent_expire ()

+
void
+gst_rtsp_session_prevent_expire (GstRTSPSession *session);
+

Prevent session + from expiring.

+
+

Parameters

+
+++++ + + + + + +

session

a GstRTSPSession

 
+
+
+
+
+

gst_rtsp_session_allow_expire ()

+
void
+gst_rtsp_session_allow_expire (GstRTSPSession *session);
+

Allow session + to expire. This method must be called an equal +amount of time as gst_rtsp_session_prevent_expire().

+
+

Parameters

+
+++++ + + + + + +

session

a GstRTSPSession

 
+
+
+
+
+

gst_rtsp_session_next_timeout ()

+
gint
+gst_rtsp_session_next_timeout (GstRTSPSession *session,
+                               GTimeVal *now);
+

Get the amount of milliseconds till the session will expire.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

session

a GstRTSPSession

 

now

the current system time.

[transfer none]
+
+
+

Returns

+

the amount of milliseconds since the session will time out.

+

+
+
+
+
+

gst_rtsp_session_is_expired ()

+
gboolean
+gst_rtsp_session_is_expired (GstRTSPSession *session,
+                             GTimeVal *now);
+

Check if session + timeout out.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

session

a GstRTSPSession

 

now

the current system time.

[transfer none]
+
+
+

Returns

+

TRUE if session +timed out

+

+
+
+
+
+

gst_rtsp_session_manage_media ()

+
GstRTSPSessionMedia *
+gst_rtsp_session_manage_media (GstRTSPSession *sess,
+                               const gchar *path,
+                               GstRTSPMedia *media);
+

Manage the media object obj + in sess +. path + will be used to retrieve this +media from the session with gst_rtsp_session_get_media().

+

Ownership is taken from media +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

sess

a GstRTSPSession

 

path

the path for the media

 

media

a GstRTSPMedia.

[transfer full]
+
+
+

Returns

+

a new GstRTSPSessionMedia +object.

+

[transfer none]

+
+
+
+
+

gst_rtsp_session_release_media ()

+
gboolean
+gst_rtsp_session_release_media (GstRTSPSession *sess,
+                                GstRTSPSessionMedia *media);
+

Release the managed media + in sess +, freeing the memory allocated by it.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

sess

a GstRTSPSession

 

media

a GstRTSPMedia.

[transfer none]
+
+
+

Returns

+

TRUE if there are more media session left in sess +.

+

+
+
+
+
+

gst_rtsp_session_get_media ()

+
GstRTSPSessionMedia *
+gst_rtsp_session_get_media (GstRTSPSession *sess,
+                            const gchar *path,
+                            gint *matched);
+

Get the session media for path +. matched + will contain the number of matched +characters of path +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

sess

a GstRTSPSession

 

path

the path for the media

 

matched

the amount of matched characters.

[out]
+
+
+

Returns

+

the configuration for path +in sess +.

+

[transfer none]

+
+
+
+
+

GstRTSPSessionFilterFunc ()

+
GstRTSPFilterResult
+(*GstRTSPSessionFilterFunc) (GstRTSPSession *sess,
+                             GstRTSPSessionMedia *media,
+                             gpointer user_data);
+

This function will be called by the gst_rtsp_session_filter(). An +implementation should return a value of GstRTSPFilterResult.

+

When this function returns GST_RTSP_FILTER_REMOVE, media + will be removed +from sess +.

+

A return value of GST_RTSP_FILTER_KEEP will leave media + untouched in +sess +.

+

A value of GST_RTSP_FILTER_REF will add media + to the result GList of +gst_rtsp_session_filter().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

sess

a GstRTSPSession object

 

media

a GstRTSPSessionMedia in sess +

 

user_data

user data that has been given to gst_rtsp_session_filter()

 
+
+
+

Returns

+

a GstRTSPFilterResult.

+

+
+
+
+
+

gst_rtsp_session_filter ()

+
GList *
+gst_rtsp_session_filter (GstRTSPSession *sess,
+                         GstRTSPSessionFilterFunc func,
+                         gpointer user_data);
+

Call func + for each media in sess +. The result value of func + determines +what happens to the media. func + will be called with sess + +locked so no further actions on sess + can be performed from func +.

+

If func + returns GST_RTSP_FILTER_REMOVE, the media will be removed from +sess +.

+

If func + returns GST_RTSP_FILTER_KEEP, the media will remain in sess +.

+

If func + returns GST_RTSP_FILTER_REF, the media will remain in sess + but +will also be added with an additional ref to the result GList of this +function..

+

When func + is NULL, GST_RTSP_FILTER_REF will be assumed for all media.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

sess

a GstRTSPSession

 

func

a callback.

[scope call][allow-none]

user_data

user data passed to func +.

[closure]
+
+
+

Returns

+

a GList with all +media for which func +returned GST_RTSP_FILTER_REF. After usage, each +element in the GList should be unreffed before the list is freed.

+

[element-type GstRTSPSessionMedia][transfer full]

+
+
+
+
+

Types and Values

+
+

struct GstRTSPSession

+
struct GstRTSPSession;
+

Session information kept by the server for a specific client. +One client session, identified with a session id, can handle multiple medias +identified with the url of a media.

+
+
+
+

struct GstRTSPSessionClass

+
struct GstRTSPSessionClass {
+  GObjectClass  parent_class;
+};
+
+
+
+
+

enum GstRTSPFilterResult

+

Possible return values for gst_rtsp_session_pool_filter().

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

GST_RTSP_FILTER_REMOVE

+

Remove session

+
 

GST_RTSP_FILTER_KEEP

+

Keep session in the pool

+
 

GST_RTSP_FILTER_REF

+

Ref session in the result list

+
 
+
+
+
+
+

Property Details

+
+

The “sessionid” property

+
  “sessionid”                gchar *
+

the session id.

+

Flags: Read / Write / Construct Only

+

Default value: NULL

+
+
+
+

The “timeout” property

+
  “timeout”                  guint
+

the timeout of the session (0 = never).

+

Flags: Read / Write

+

Default value: 60

+
+
+
+

The “timeout-always-visible” property

+
  “timeout-always-visible”   gboolean
+

timeout always visible in header.

+

Flags: Read / Write

+

Default value: FALSE

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/GstRTSPSessionPool.html b/docs/libs/html/GstRTSPSessionPool.html new file mode 100644 index 0000000..a598a0c --- /dev/null +++ b/docs/libs/html/GstRTSPSessionPool.html @@ -0,0 +1,730 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPSessionPool + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPSessionPool

+

GstRTSPSessionPool — An object for managing sessions

+
+
+

Functions

+ +
+
+

Properties

+
+++++ + + + + + +
guintmax-sessionsRead / Write
+
+
+

Signals

+
+++++ + + + + + +
voidsession-removedRun Last
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
structGstRTSPSessionPool
structGstRTSPSessionPoolClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GstRTSPSessionPool
+
+
+
+

Description

+

The GstRTSPSessionPool object manages a list of GstRTSPSession objects.

+

The maximum number of sessions can be configured with +gst_rtsp_session_pool_set_max_sessions(). The current number of sessions can +be retrieved with gst_rtsp_session_pool_get_n_sessions().

+

Use gst_rtsp_session_pool_create() to create a new GstRTSPSession object. +The session object can be found again with its id and +gst_rtsp_session_pool_find().

+

All sessions can be iterated with gst_rtsp_session_pool_filter().

+

Run gst_rtsp_session_pool_cleanup() periodically to remove timed out sessions +or use gst_rtsp_session_pool_create_watch() to be notified when session +cleanup should be performed.

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_session_pool_new ()

+
GstRTSPSessionPool *
+gst_rtsp_session_pool_new (void);
+

Create a new GstRTSPSessionPool instance.

+
+

Returns

+

A new GstRTSPSessionPool. g_object_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_session_pool_get_max_sessions ()

+
guint
+gst_rtsp_session_pool_get_max_sessions
+                               (GstRTSPSessionPool *pool);
+

Get the maximum allowed number of sessions in pool +. 0 means an unlimited +amount of sessions.

+
+

Parameters

+
+++++ + + + + + +

pool

a GstRTSPSessionPool

 
+
+
+

Returns

+

the maximum allowed number of sessions.

+

+
+
+
+
+

gst_rtsp_session_pool_set_max_sessions ()

+
void
+gst_rtsp_session_pool_set_max_sessions
+                               (GstRTSPSessionPool *pool,
+                                guint max);
+

Configure the maximum allowed number of sessions in pool + to max +. +A value of 0 means an unlimited amount of sessions.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pool

a GstRTSPSessionPool

 

max

the maximum number of sessions

 
+
+
+
+
+

gst_rtsp_session_pool_get_n_sessions ()

+
guint
+gst_rtsp_session_pool_get_n_sessions (GstRTSPSessionPool *pool);
+

Get the amount of active sessions in pool +.

+
+

Parameters

+
+++++ + + + + + +

pool

a GstRTSPSessionPool

 
+
+
+

Returns

+

the amount of active sessions in pool +.

+

+
+
+
+
+

gst_rtsp_session_pool_create ()

+
GstRTSPSession *
+gst_rtsp_session_pool_create (GstRTSPSessionPool *pool);
+

Create a new GstRTSPSession object in pool +.

+
+

Parameters

+
+++++ + + + + + +

pool

a GstRTSPSessionPool

 
+
+
+

Returns

+

a new GstRTSPSession.

+

[transfer full]

+
+
+
+
+

gst_rtsp_session_pool_find ()

+
GstRTSPSession *
+gst_rtsp_session_pool_find (GstRTSPSessionPool *pool,
+                            const gchar *sessionid);
+

Find the session with sessionid + in pool +. The access time of the session +will be updated with gst_rtsp_session_touch().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pool

the pool to search

 

sessionid

the session id

 
+
+
+

Returns

+

the GstRTSPSession with sessionid +or NULL when the session did not exist. g_object_unref() after usage.

+

[transfer full][nullable]

+
+
+
+
+

gst_rtsp_session_pool_remove ()

+
gboolean
+gst_rtsp_session_pool_remove (GstRTSPSessionPool *pool,
+                              GstRTSPSession *sess);
+

Remove sess + from pool +, releasing the ref that the pool has on sess +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pool

a GstRTSPSessionPool

 

sess

a GstRTSPSession.

[transfer none]
+
+
+

Returns

+

TRUE if the session was found and removed.

+

+
+
+
+
+

gst_rtsp_session_pool_cleanup ()

+
guint
+gst_rtsp_session_pool_cleanup (GstRTSPSessionPool *pool);
+

Inspect all the sessions in pool + and remove the sessions that are inactive +for more than their timeout.

+
+

Parameters

+
+++++ + + + + + +

pool

a GstRTSPSessionPool

 
+
+
+

Returns

+

the amount of sessions that got removed.

+

+
+
+
+
+

GstRTSPSessionPoolFunc ()

+
gboolean
+(*GstRTSPSessionPoolFunc) (GstRTSPSessionPool *pool,
+                           gpointer user_data);
+

The function that will be called from the GSource watch on the session pool.

+

The function will be called when the pool must be cleaned up because one or +more sessions timed out.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pool

a GstRTSPSessionPool object

 

user_data

user data that has been given when registering the handler

 
+
+
+

Returns

+

FALSE if the source should be removed.

+

+
+
+
+
+

gst_rtsp_session_pool_create_watch ()

+
GSource *
+gst_rtsp_session_pool_create_watch (GstRTSPSessionPool *pool);
+

Create a GSource that will be dispatched when the session should be cleaned +up.

+
+

Parameters

+
+++++ + + + + + +

pool

a GstRTSPSessionPool

 
+
+
+

Returns

+

a GSource.

+

[transfer full]

+
+
+
+
+

GstRTSPSessionPoolFilterFunc ()

+
GstRTSPFilterResult
+(*GstRTSPSessionPoolFilterFunc) (GstRTSPSessionPool *pool,
+                                 GstRTSPSession *session,
+                                 gpointer user_data);
+

This function will be called by the gst_rtsp_session_pool_filter(). An +implementation should return a value of GstRTSPFilterResult.

+

When this function returns GST_RTSP_FILTER_REMOVE, session + will be removed +from pool +.

+

A return value of GST_RTSP_FILTER_KEEP will leave session + untouched in +pool +.

+

A value of GST_RTSP_FILTER_REF will add session + to the result GList of +gst_rtsp_session_pool_filter().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

pool

a GstRTSPSessionPool object

 

session

a GstRTSPSession in pool +

 

user_data

user data that has been given to gst_rtsp_session_pool_filter()

 
+
+
+

Returns

+

a GstRTSPFilterResult.

+

+
+
+
+
+

gst_rtsp_session_pool_filter ()

+
GList *
+gst_rtsp_session_pool_filter (GstRTSPSessionPool *pool,
+                              GstRTSPSessionPoolFilterFunc func,
+                              gpointer user_data);
+

Call func + for each session in pool +. The result value of func + determines +what happens to the session. func + will be called with the session pool +locked so no further actions on pool + can be performed from func +.

+

If func + returns GST_RTSP_FILTER_REMOVE, the session will be set to the +expired state with gst_rtsp_session_set_expired() and removed from +pool +.

+

If func + returns GST_RTSP_FILTER_KEEP, the session will remain in pool +.

+

If func + returns GST_RTSP_FILTER_REF, the session will remain in pool + but +will also be added with an additional ref to the result GList of this +function..

+

When func + is NULL, GST_RTSP_FILTER_REF will be assumed for all sessions.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

pool

a GstRTSPSessionPool

 

func

a callback.

[scope call][allow-none]

user_data

user data passed to func +.

[closure]
+
+
+

Returns

+

a GList with all +sessions for which func +returned GST_RTSP_FILTER_REF. After usage, each +element in the GList should be unreffed before the list is freed.

+

[element-type GstRTSPSession][transfer full]

+
+
+
+
+

Types and Values

+
+

struct GstRTSPSessionPool

+
struct GstRTSPSessionPool;
+

An object that keeps track of the active sessions. This object is usually +attached to a GstRTSPServer object to manage the sessions in that server.

+
+
+
+

struct GstRTSPSessionPoolClass

+
struct GstRTSPSessionPoolClass {
+  GObjectClass  parent_class;
+
+  gchar *          (*create_session_id)   (GstRTSPSessionPool *pool);
+  GstRTSPSession * (*create_session)      (GstRTSPSessionPool *pool, const gchar *id);
+
+  /* signals */
+  void             (*session_removed)     (GstRTSPSessionPool *pool,
+                                           GstRTSPSession *session);
+};
+
+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

GObjectClass parent_class;

  

create_session_id ()

create a new random session id. Subclasses can create +custom session ids and should not check if the session exists.

 

create_session ()

make a new session object.

 

session_removed ()

a session was removed from the pool

 
+
+
+
+
+

Property Details

+
+

The “max-sessions” property

+
  “max-sessions”             guint
+

the maximum amount of sessions (0 = unlimited).

+

Flags: Read / Write

+

Default value: 0

+
+
+
+

Signal Details

+
+

The “session-removed” signal

+
void
+user_function (GstRTSPSessionPool *gstrtspsessionpool,
+               GstRTSPSession     *arg1,
+               gpointer            user_data)
+

Flags: Run Last

+
+
+
+

See Also

+

GstRTSPSession

+
+
+ + + \ No newline at end of file diff --git a/docs/libs/html/GstRTSPStream.html b/docs/libs/html/GstRTSPStream.html new file mode 100644 index 0000000..fcbe74c --- /dev/null +++ b/docs/libs/html/GstRTSPStream.html @@ -0,0 +1,1832 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPStream + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPStream

+

GstRTSPStream — A media stream

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPStream * + +gst_rtsp_stream_new () +
+guint + +gst_rtsp_stream_get_index () +
+GstPad * + +gst_rtsp_stream_get_srcpad () +
+gchar * + +gst_rtsp_stream_get_control () +
+void + +gst_rtsp_stream_set_control () +
+gboolean + +gst_rtsp_stream_has_control () +
+guint + +gst_rtsp_stream_get_mtu () +
+void + +gst_rtsp_stream_set_mtu () +
+gint + +gst_rtsp_stream_get_dscp_qos () +
+void + +gst_rtsp_stream_set_dscp_qos () +
+void + +gst_rtsp_stream_set_profiles () +
+GstRTSPProfile + +gst_rtsp_stream_get_profiles () +
+GstRTSPLowerTrans + +gst_rtsp_stream_get_protocols () +
+void + +gst_rtsp_stream_set_protocols () +
+gboolean + +gst_rtsp_stream_is_transport_supported () +
+GstRTSPAddressPool * + +gst_rtsp_stream_get_address_pool () +
+void + +gst_rtsp_stream_set_address_pool () +
+GstRTSPAddress * + +gst_rtsp_stream_reserve_address () +
+gboolean + +gst_rtsp_stream_join_bin () +
+gboolean + +gst_rtsp_stream_leave_bin () +
+void + +gst_rtsp_stream_get_server_port () +
+GstRTSPAddress * + +gst_rtsp_stream_get_multicast_address () +
+GObject * + +gst_rtsp_stream_get_rtpsession () +
+void + +gst_rtsp_stream_get_ssrc () +
+gboolean + +gst_rtsp_stream_get_rtpinfo () +
+GstCaps * + +gst_rtsp_stream_get_caps () +
+guint + +gst_rtsp_stream_get_pt () +
+GstFlowReturn + +gst_rtsp_stream_recv_rtcp () +
+GstFlowReturn + +gst_rtsp_stream_recv_rtp () +
+gboolean + +gst_rtsp_stream_add_transport () +
+gboolean + +gst_rtsp_stream_remove_transport () +
+GSocket * + +gst_rtsp_stream_get_rtp_socket () +
+GSocket * + +gst_rtsp_stream_get_rtcp_socket () +
+gboolean + +gst_rtsp_stream_set_blocked () +
+gboolean + +gst_rtsp_stream_is_blocking () +
+gboolean + +gst_rtsp_stream_update_crypto () +
+GstRTSPFilterResult + +(*GstRTSPStreamTransportFilterFunc) () +
+GList * + +gst_rtsp_stream_transport_filter () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
structGstRTSPStream
 GstRTSPStreamClass
+
+
+

Object Hierarchy

+
    GObject
+    ╰── GstRTSPStream
+
+
+
+

Description

+

The GstRTSPStream object manages the data transport for one stream. It +is created from a payloader element and a source pad that produce the RTP +packets for the stream.

+

With gst_rtsp_stream_join_bin() the streaming elements are added to the bin +and rtpbin. gst_rtsp_stream_leave_bin() removes the elements again.

+

The GstRTSPStream will use the configured addresspool, as set with +gst_rtsp_stream_set_address_pool(), to allocate multicast addresses for the +stream. With gst_rtsp_stream_get_multicast_address() you can get the +configured address.

+

With gst_rtsp_stream_get_server_port() you can get the port that the server +will use to receive RTCP. This is the part that the clients will use to send +RTCP to.

+

With gst_rtsp_stream_add_transport() destinations can be added where the +stream should be sent to. Use gst_rtsp_stream_remove_transport() to remove +the destination again.

+

Last reviewed on 2013-07-16 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_stream_new ()

+
GstRTSPStream *
+gst_rtsp_stream_new (guint idx,
+                     GstElement *payloader,
+                     GstPad *srcpad);
+

Create a new media stream with index idx + that handles RTP data on +srcpad + and has a payloader element payloader +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

idx

an index

 

srcpad

a GstPad

 

payloader

a GstElement

 
+
+
+

Returns

+

a new GstRTSPStream.

+

[transfer full]

+
+
+
+
+

gst_rtsp_stream_get_index ()

+
guint
+gst_rtsp_stream_get_index (GstRTSPStream *stream);
+

Get the stream index.

+

Return: the stream index.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+
+
+

gst_rtsp_stream_get_srcpad ()

+
GstPad *
+gst_rtsp_stream_get_srcpad (GstRTSPStream *stream);
+

Get the srcpad associated with stream +.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+

Returns

+

the srcpad. Unref after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_stream_get_control ()

+
gchar *
+gst_rtsp_stream_get_control (GstRTSPStream *stream);
+

Get the control string to identify this stream.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+

Returns

+

the control string. g_free() after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_stream_set_control ()

+
void
+gst_rtsp_stream_set_control (GstRTSPStream *stream,
+                             const gchar *control);
+

Set the control string in stream +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

control

a control string

 
+
+
+
+
+

gst_rtsp_stream_has_control ()

+
gboolean
+gst_rtsp_stream_has_control (GstRTSPStream *stream,
+                             const gchar *control);
+

Check if stream + has the control string control +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

control

a control string

 
+
+
+

Returns

+

TRUE is stream +has control +as the control string

+

+
+
+
+
+

gst_rtsp_stream_get_mtu ()

+
guint
+gst_rtsp_stream_get_mtu (GstRTSPStream *stream);
+

Get the configured MTU in the payloader of stream +.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+

Returns

+

the MTU of the payloader.

+

+
+
+
+
+

gst_rtsp_stream_set_mtu ()

+
void
+gst_rtsp_stream_set_mtu (GstRTSPStream *stream,
+                         guint mtu);
+

Configure the mtu in the payloader of stream + to mtu +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

mtu

a new MTU

 
+
+
+
+
+

gst_rtsp_stream_get_dscp_qos ()

+
gint
+gst_rtsp_stream_get_dscp_qos (GstRTSPStream *stream);
+

Get the configured DSCP QoS in of the outgoing sockets.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+

Returns

+

the DSCP QoS value of the outgoing sockets, or -1 if disbled.

+

+
+
+
+
+

gst_rtsp_stream_set_dscp_qos ()

+
void
+gst_rtsp_stream_set_dscp_qos (GstRTSPStream *stream,
+                              gint dscp_qos);
+

Configure the dscp qos of the outgoing sockets to dscp_qos +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

dscp_qos

a new dscp qos value (0-63, or -1 to disable)

 
+
+
+
+
+

gst_rtsp_stream_set_profiles ()

+
void
+gst_rtsp_stream_set_profiles (GstRTSPStream *stream,
+                              GstRTSPProfile profiles);
+

Configure the allowed profiles for stream +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

profiles

the new profiles

 
+
+
+
+
+

gst_rtsp_stream_get_profiles ()

+
GstRTSPProfile
+gst_rtsp_stream_get_profiles (GstRTSPStream *stream);
+

Get the allowed profiles of stream +.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+

Returns

+

a GstRTSPProfile

+

+
+
+
+
+

gst_rtsp_stream_get_protocols ()

+
GstRTSPLowerTrans
+gst_rtsp_stream_get_protocols (GstRTSPStream *stream);
+

Get the allowed protocols of stream +.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+

Returns

+

a GstRTSPLowerTrans

+

+
+
+
+
+

gst_rtsp_stream_set_protocols ()

+
void
+gst_rtsp_stream_set_protocols (GstRTSPStream *stream,
+                               GstRTSPLowerTrans protocols);
+

Configure the allowed lower transport for stream +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

protocols

the new flags

 
+
+
+
+
+

gst_rtsp_stream_is_transport_supported ()

+
gboolean
+gst_rtsp_stream_is_transport_supported
+                               (GstRTSPStream *stream,
+                                GstRTSPTransport *transport);
+

Check if transport + can be handled by stream

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

transport

a GstRTSPTransport.

[transfer none]
+
+
+

Returns

+

TRUE if transport +can be handled by stream +.

+

+
+
+
+
+

gst_rtsp_stream_get_address_pool ()

+
GstRTSPAddressPool *
+gst_rtsp_stream_get_address_pool (GstRTSPStream *stream);
+

Get the GstRTSPAddressPool used as the address pool of stream +.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+

Returns

+

the GstRTSPAddressPool of stream +. g_object_unref() after +usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_stream_set_address_pool ()

+
void
+gst_rtsp_stream_set_address_pool (GstRTSPStream *stream,
+                                  GstRTSPAddressPool *pool);
+

configure pool + to be used as the address pool of stream +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

pool

a GstRTSPAddressPool.

[transfer none]
+
+
+
+
+

gst_rtsp_stream_reserve_address ()

+
GstRTSPAddress *
+gst_rtsp_stream_reserve_address (GstRTSPStream *stream,
+                                 const gchar *address,
+                                 guint port,
+                                 guint n_ports,
+                                 guint ttl);
+

Reserve address + and port + as the address and port of stream +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

stream

a GstRTSPStream

 

address

an address

 

port

a port

 

n_ports

n_ports

 

ttl

a TTL

 
+
+
+

Returns

+

the GstRTSPAddress of stream +or NULL when +the address could be reserved. gst_rtsp_address_free() after usage.

+

[nullable]

+
+
+
+
+

gst_rtsp_stream_join_bin ()

+
gboolean
+gst_rtsp_stream_join_bin (GstRTSPStream *stream,
+                          GstBin *bin,
+                          GstElement *rtpbin,
+                          GstState state);
+

Join the GstBin bin + that contains the element rtpbin +.

+

stream + will link to rtpbin +, which must be inside bin +. The elements +added to bin + will be set to the state given in state +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

stream

a GstRTSPStream

 

bin

a GstBin to join.

[transfer none]

rtpbin

a rtpbin element in bin +.

[transfer none]

state

the target state of the new elements

 
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

gst_rtsp_stream_leave_bin ()

+
gboolean
+gst_rtsp_stream_leave_bin (GstRTSPStream *stream,
+                           GstBin *bin,
+                           GstElement *rtpbin);
+

Remove the elements of stream + from bin +.

+

Return: TRUE on success.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

stream

a GstRTSPStream

 

bin

a GstBin.

[transfer none]

rtpbin

a rtpbin GstElement.

[transfer none]
+
+
+
+
+

gst_rtsp_stream_get_server_port ()

+
void
+gst_rtsp_stream_get_server_port (GstRTSPStream *stream,
+                                 GstRTSPRange *server_port,
+                                 GSocketFamily family);
+

Fill server_port + with the port pair used by the server. This function can +only be called when stream + has been joined.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

stream

a GstRTSPStream

 

server_port

result server port.

[out]

family

the port family to get

 
+
+
+
+
+

gst_rtsp_stream_get_multicast_address ()

+
GstRTSPAddress *
+gst_rtsp_stream_get_multicast_address (GstRTSPStream *stream,
+                                       GSocketFamily family);
+

Get the multicast address of stream + for family +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

family

the GSocketFamily

 
+
+
+

Returns

+

the GstRTSPAddress of stream +or NULL when no address could be allocated. gst_rtsp_address_free() +after usage.

+

[transfer full][nullable]

+
+
+
+
+

gst_rtsp_stream_get_rtpsession ()

+
GObject *
+gst_rtsp_stream_get_rtpsession (GstRTSPStream *stream);
+

Get the RTP session of this stream.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+

Returns

+

The RTP session of this stream. Unref after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_stream_get_ssrc ()

+
void
+gst_rtsp_stream_get_ssrc (GstRTSPStream *stream,
+                          guint *ssrc);
+

Get the SSRC used by the RTP session of this stream. This function can only +be called when stream + has been joined.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

ssrc

result ssrc.

[out]
+
+
+
+
+

gst_rtsp_stream_get_rtpinfo ()

+
gboolean
+gst_rtsp_stream_get_rtpinfo (GstRTSPStream *stream,
+                             guint *rtptime,
+                             guint *seq,
+                             guint *clock_rate,
+                             GstClockTime *running_time);
+

Retrieve the current rtptime, seq and running-time. This is used to +construct a RTPInfo reply header.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

stream

a GstRTSPStream

 

rtptime

result RTP timestamp.

[allow-none]

seq

result RTP seqnum.

[allow-none]

clock_rate

the clock rate.

[allow-none]

running_time

result running-time.

[allow-none]
+
+
+

Returns

+

TRUE when rtptime, seq and running-time could be determined.

+

+
+
+
+
+

gst_rtsp_stream_get_caps ()

+
GstCaps *
+gst_rtsp_stream_get_caps (GstRTSPStream *stream);
+

Retrieve the current caps of stream +.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+

Returns

+

the GstCaps of stream +. use gst_caps_unref() +after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_stream_get_pt ()

+
guint
+gst_rtsp_stream_get_pt (GstRTSPStream *stream);
+

Get the stream payload type.

+

Return: the stream payload type.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+
+
+

gst_rtsp_stream_recv_rtcp ()

+
GstFlowReturn
+gst_rtsp_stream_recv_rtcp (GstRTSPStream *stream,
+                           GstBuffer *buffer);
+

Handle an RTCP buffer for the stream. This method is usually called when a +message has been received from a client using the TCP transport.

+

This function takes ownership of buffer +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

buffer

a GstBuffer.

[transfer full]
+
+
+

Returns

+

a GstFlowReturn.

+

+
+
+
+
+

gst_rtsp_stream_recv_rtp ()

+
GstFlowReturn
+gst_rtsp_stream_recv_rtp (GstRTSPStream *stream,
+                          GstBuffer *buffer);
+

Handle an RTP buffer for the stream. This method is usually called when a +message has been received from a client using the TCP transport.

+

This function takes ownership of buffer +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

buffer

a GstBuffer.

[transfer full]
+
+
+

Returns

+

a GstFlowReturn.

+

+
+
+
+
+

gst_rtsp_stream_add_transport ()

+
gboolean
+gst_rtsp_stream_add_transport (GstRTSPStream *stream,
+                               GstRTSPStreamTransport *trans);
+

Add the transport in trans + to stream +. The media of stream + will +then also be send to the values configured in trans +.

+

stream + must be joined to a bin.

+

trans + must contain a valid GstRTSPTransport.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

trans

a GstRTSPStreamTransport.

[transfer none]
+
+
+

Returns

+

TRUE if trans +was added

+

+
+
+
+
+

gst_rtsp_stream_remove_transport ()

+
gboolean
+gst_rtsp_stream_remove_transport (GstRTSPStream *stream,
+                                  GstRTSPStreamTransport *trans);
+

Remove the transport in trans + from stream +. The media of stream + will +not be sent to the values configured in trans +.

+

stream + must be joined to a bin.

+

trans + must contain a valid GstRTSPTransport.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

trans

a GstRTSPStreamTransport.

[transfer none]
+
+
+

Returns

+

TRUE if trans +was removed

+

+
+
+
+
+

gst_rtsp_stream_get_rtp_socket ()

+
GSocket *
+gst_rtsp_stream_get_rtp_socket (GstRTSPStream *stream,
+                                GSocketFamily family);
+

Get the RTP socket from stream + for a family +.

+

stream + must be joined to a bin.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

family

the socket family

 
+
+
+

Returns

+

the RTP socket or NULL if no +socket could be allocated for family +. Unref after usage.

+

[transfer full][nullable]

+
+
+
+
+

gst_rtsp_stream_get_rtcp_socket ()

+
GSocket *
+gst_rtsp_stream_get_rtcp_socket (GstRTSPStream *stream,
+                                 GSocketFamily family);
+

Get the RTCP socket from stream + for a family +.

+

stream + must be joined to a bin.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

family

the socket family

 
+
+
+

Returns

+

the RTCP socket or NULL if no +socket could be allocated for family +. Unref after usage.

+

[transfer full][nullable]

+
+
+
+
+

gst_rtsp_stream_set_blocked ()

+
gboolean
+gst_rtsp_stream_set_blocked (GstRTSPStream *stream,
+                             gboolean blocked);
+

Blocks or unblocks the dataflow on stream +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

blocked

boolean indicating we should block or unblock

 
+
+
+

Returns

+

TRUE on success

+

+
+
+
+
+

gst_rtsp_stream_is_blocking ()

+
gboolean
+gst_rtsp_stream_is_blocking (GstRTSPStream *stream);
+

Check if stream + is blocking on a GstBuffer.

+
+

Parameters

+
+++++ + + + + + +

stream

a GstRTSPStream

 
+
+
+

Returns

+

TRUE if stream +is blocking

+

+
+
+
+
+

gst_rtsp_stream_update_crypto ()

+
gboolean
+gst_rtsp_stream_update_crypto (GstRTSPStream *stream,
+                               guint ssrc,
+                               GstCaps *crypto);
+

Update the new crypto information for ssrc + in stream +. If information +for ssrc + did not exist, it will be added. If information +for ssrc + existed, it will be replaced. If crypto + is NULL, it will +be removed from stream +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

stream

a GstRTSPStream

 

ssrc

the SSRC

 

crypto

a GstCaps with crypto info.

[transfer none][allow-none]
+
+
+

Returns

+

TRUE if crypto +could be updated

+

+
+
+
+
+

GstRTSPStreamTransportFilterFunc ()

+
GstRTSPFilterResult
+(*GstRTSPStreamTransportFilterFunc) (GstRTSPStream *stream,
+                                     GstRTSPStreamTransport *trans,
+                                     gpointer user_data);
+

This function will be called by the gst_rtsp_stream_transport_filter(). An +implementation should return a value of GstRTSPFilterResult.

+

When this function returns GST_RTSP_FILTER_REMOVE, trans + will be removed +from stream +.

+

A return value of GST_RTSP_FILTER_KEEP will leave trans + untouched in +stream +.

+

A value of GST_RTSP_FILTER_REF will add trans + to the result GList of +gst_rtsp_stream_transport_filter().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

stream

a GstRTSPStream object

 

trans

a GstRTSPStreamTransport in stream +

 

user_data

user data that has been given to gst_rtsp_stream_transport_filter()

 
+
+
+

Returns

+

a GstRTSPFilterResult.

+

+
+
+
+
+

gst_rtsp_stream_transport_filter ()

+
GList *
+gst_rtsp_stream_transport_filter (GstRTSPStream *stream,
+                                  GstRTSPStreamTransportFilterFunc func,
+                                  gpointer user_data);
+

Call func + for each transport managed by stream +. The result value of func + +determines what happens to the transport. func + will be called with stream + +locked so no further actions on stream + can be performed from func +.

+

If func + returns GST_RTSP_FILTER_REMOVE, the transport will be removed from +stream +.

+

If func + returns GST_RTSP_FILTER_KEEP, the transport will remain in stream +.

+

If func + returns GST_RTSP_FILTER_REF, the transport will remain in stream + but +will also be added with an additional ref to the result GList of this +function..

+

When func + is NULL, GST_RTSP_FILTER_REF will be assumed for each transport.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

stream

a GstRTSPStream

 

func

a callback.

[scope call][allow-none]

user_data

user data passed to func +.

[closure]
+
+
+

Returns

+

a GList with all +transports for which func +returned GST_RTSP_FILTER_REF. After usage, each +element in the GList should be unreffed before the list is freed.

+

[element-type GstRTSPStreamTransport][transfer full]

+
+
+
+
+

Types and Values

+
+

struct GstRTSPStream

+
struct GstRTSPStream;
+

The definition of a media stream.

+
+
+
+

GstRTSPStreamClass

+
typedef struct _GstRTSPStreamClass GstRTSPStreamClass;
+
+
+
+

See Also

+

GstRTSPMedia

+
+
+ + + \ No newline at end of file diff --git a/docs/libs/html/annotation-glossary.html b/docs/libs/html/annotation-glossary.html new file mode 100644 index 0000000..4326d28 --- /dev/null +++ b/docs/libs/html/annotation-glossary.html @@ -0,0 +1,70 @@ + + + + +GStreamer RTSP Server Reference Manual: Annotation Glossary + + + + + + + + + + + + + + + +
+

+Annotation Glossary

+

A

+
allow-none
+

NULL is OK, both for passing and for returning.

+

C

+
closure
+

This parameter is a 'user_data', for callbacks; many bindings can pass NULL here.

+

E

+
element-type
+

Generics and defining elements of containers and arrays.

+

N

+
nullable
+

NULL may be passed as the value in, out, in-out; or as a return value.

+

O

+
out
+

Parameter for returning results. Default is transfer full.

+

S

+
scope call
+

The callback is valid only during the call to the method.

+
scope notified
+

The callback is valid until the GDestroyNotify argument is called.

+

T

+
transfer floating
+

Alias for transfer none, used for objects with floating refs.

+
transfer full
+

Free data after the code is done.

+
transfer none
+

Don't free data after the code is done.

+
type
+

Override the parsed C type with given type.

+
+ + + \ No newline at end of file diff --git a/docs/libs/html/api-index-full.html b/docs/libs/html/api-index-full.html new file mode 100644 index 0000000..671e5d5 --- /dev/null +++ b/docs/libs/html/api-index-full.html @@ -0,0 +1,1470 @@ + + + + +GStreamer RTSP Server Reference Manual: API Index + + + + + + + + + + + + + + + + +
+

+API Index

+

R

+
+GstRTSPAddress, struct in GstRTSPAddressPool +
+
+
+GstRTSPAddressFlags, enum in GstRTSPAddressPool +
+
+
+GstRTSPAddressPool, struct in GstRTSPAddressPool +
+
+
+GstRTSPAddressPoolClass, struct in GstRTSPAddressPool +
+
+
+GstRTSPAddressPoolResult, enum in GstRTSPAddressPool +
+
+
+GstRTSPAuth, struct in GstRTSPAuth +
+
+
+GstRTSPAuthClass, struct in GstRTSPAuth +
+
+
+GstRTSPClient, struct in GstRTSPClient +
+
+
+GstRTSPClient::closed, object signal in GstRTSPClient +
+
+
+GstRTSPClient::describe-request, object signal in GstRTSPClient +
+
+
+GstRTSPClient::get-parameter-request, object signal in GstRTSPClient +
+
+
+GstRTSPClient::handle-response, object signal in GstRTSPClient +
+
+
+GstRTSPClient::new-session, object signal in GstRTSPClient +
+
+
+GstRTSPClient::options-request, object signal in GstRTSPClient +
+
+
+GstRTSPClient::pause-request, object signal in GstRTSPClient +
+
+
+GstRTSPClient::play-request, object signal in GstRTSPClient +
+
+
+GstRTSPClient::send-message, object signal in GstRTSPClient +
+
+
+GstRTSPClient::set-parameter-request, object signal in GstRTSPClient +
+
+
+GstRTSPClient::setup-request, object signal in GstRTSPClient +
+
+
+GstRTSPClient::teardown-request, object signal in GstRTSPClient +
+
+
+GstRTSPClient:drop-backlog, object property in GstRTSPClient +
+
+
+GstRTSPClient:mount-points, object property in GstRTSPClient +
+
+
+GstRTSPClient:session-pool, object property in GstRTSPClient +
+
+
+GstRTSPClientClass, struct in GstRTSPClient +
+
+
+GstRTSPClientSendFunc, user_function in GstRTSPClient +
+
+
+GstRTSPClientSessionFilterFunc, user_function in GstRTSPClient +
+
+
+GstRTSPContext, struct in GstRTSPContext +
+
+
+GstRTSPFilterResult, enum in GstRTSPSession +
+
+
+GstRTSPKeepAliveFunc, user_function in GstRTSPStreamTransport +
+
+
+GstRTSPMedia, struct in GstRTSPMedia +
+
+
+GstRTSPMedia::new-state, object signal in GstRTSPMedia +
+
+
+GstRTSPMedia::new-stream, object signal in GstRTSPMedia +
+
+
+GstRTSPMedia::prepared, object signal in GstRTSPMedia +
+
+
+GstRTSPMedia::removed-stream, object signal in GstRTSPMedia +
+
+
+GstRTSPMedia::target-state, object signal in GstRTSPMedia +
+
+
+GstRTSPMedia::unprepared, object signal in GstRTSPMedia +
+
+
+GstRTSPMedia:buffer-size, object property in GstRTSPMedia +
+
+
+GstRTSPMedia:element, object property in GstRTSPMedia +
+
+
+GstRTSPMedia:eos-shutdown, object property in GstRTSPMedia +
+
+
+GstRTSPMedia:profiles, object property in GstRTSPMedia +
+
+
+GstRTSPMedia:protocols, object property in GstRTSPMedia +
+
+
+GstRTSPMedia:reusable, object property in GstRTSPMedia +
+
+
+GstRTSPMedia:shared, object property in GstRTSPMedia +
+
+
+GstRTSPMedia:suspend-mode, object property in GstRTSPMedia +
+
+
+GstRTSPMedia:time-provider, object property in GstRTSPMedia +
+
+
+GstRTSPMediaClass, struct in GstRTSPMedia +
+
+
+GstRTSPMediaFactory, struct in GstRTSPMediaFactory +
+
+
+GstRTSPMediaFactory::media-configure, object signal in GstRTSPMediaFactory +
+
+
+GstRTSPMediaFactory::media-constructed, object signal in GstRTSPMediaFactory +
+
+
+GstRTSPMediaFactory:buffer-size, object property in GstRTSPMediaFactory +
+
+
+GstRTSPMediaFactory:eos-shutdown, object property in GstRTSPMediaFactory +
+
+
+GstRTSPMediaFactory:launch, object property in GstRTSPMediaFactory +
+
+
+GstRTSPMediaFactory:profiles, object property in GstRTSPMediaFactory +
+
+
+GstRTSPMediaFactory:protocols, object property in GstRTSPMediaFactory +
+
+
+GstRTSPMediaFactory:shared, object property in GstRTSPMediaFactory +
+
+
+GstRTSPMediaFactory:suspend-mode, object property in GstRTSPMediaFactory +
+
+
+GstRTSPMediaFactoryClass, struct in GstRTSPMediaFactory +
+
+
+GstRTSPMediaFactoryURI, struct in GstRTSPMediaFactoryURI +
+
+
+GstRTSPMediaFactoryURIClass, struct in GstRTSPMediaFactoryURI +
+
+
+GstRTSPMediaStatus, enum in GstRTSPMedia +
+
+
+GstRTSPMountPoints, struct in GstRTSPMountPoints +
+
+
+GstRTSPMountPointsClass, struct in GstRTSPMountPoints +
+
+
+GstRTSPPermissions, struct in GstRTSPPermissions +
+
+
+GstRTSPSendFunc, user_function in GstRTSPStreamTransport +
+
+
+GstRTSPServer, struct in GstRTSPServer +
+
+
+GstRTSPServer::client-connected, object signal in GstRTSPServer +
+
+
+GstRTSPServer:address, object property in GstRTSPServer +
+
+
+GstRTSPServer:backlog, object property in GstRTSPServer +
+
+
+GstRTSPServer:bound-port, object property in GstRTSPServer +
+
+
+GstRTSPServer:mount-points, object property in GstRTSPServer +
+
+
+GstRTSPServer:service, object property in GstRTSPServer +
+
+
+GstRTSPServer:session-pool, object property in GstRTSPServer +
+
+
+GstRTSPServerClass, struct in GstRTSPServer +
+
+
+GstRTSPServerClientFilterFunc, user_function in GstRTSPServer +
+
+
+GstRTSPSession, struct in GstRTSPSession +
+
+
+GstRTSPSession:sessionid, object property in GstRTSPSession +
+
+
+GstRTSPSession:timeout, object property in GstRTSPSession +
+
+
+GstRTSPSession:timeout-always-visible, object property in GstRTSPSession +
+
+
+GstRTSPSessionClass, struct in GstRTSPSession +
+
+
+GstRTSPSessionFilterFunc, user_function in GstRTSPSession +
+
+
+GstRTSPSessionMedia, struct in GstRTSPSessionMedia +
+
+
+GstRTSPSessionMediaClass, struct in GstRTSPSessionMedia +
+
+
+GstRTSPSessionPool, struct in GstRTSPSessionPool +
+
+
+GstRTSPSessionPool::session-removed, object signal in GstRTSPSessionPool +
+
+
+GstRTSPSessionPool:max-sessions, object property in GstRTSPSessionPool +
+
+
+GstRTSPSessionPoolClass, struct in GstRTSPSessionPool +
+
+
+GstRTSPSessionPoolFilterFunc, user_function in GstRTSPSessionPool +
+
+
+GstRTSPSessionPoolFunc, user_function in GstRTSPSessionPool +
+
+
+GstRTSPStream, struct in GstRTSPStream +
+
+
+GstRTSPStreamClass, struct in GstRTSPStream +
+
+
+GstRTSPStreamTransport, struct in GstRTSPStreamTransport +
+
+
+GstRTSPStreamTransportClass, struct in GstRTSPStreamTransport +
+
+
+GstRTSPStreamTransportFilterFunc, user_function in GstRTSPStream +
+
+
+GstRTSPSuspendMode, enum in GstRTSPMedia +
+
+
+GstRTSPThread, struct in GstRTSPThreadPool +
+
+
+GstRTSPThreadPool, struct in GstRTSPThreadPool +
+
+
+GstRTSPThreadPoolClass, struct in GstRTSPThreadPool +
+
+
+GstRTSPThreadType, enum in GstRTSPThreadPool +
+
+
+GstRTSPToken, struct in GstRTSPToken +
+
+
+gst_rtsp_address_copy, function in GstRTSPAddressPool +
+
+
+gst_rtsp_address_free, function in GstRTSPAddressPool +
+
+
+gst_rtsp_address_pool_acquire_address, function in GstRTSPAddressPool +
+
+
+gst_rtsp_address_pool_add_range, function in GstRTSPAddressPool +
+
+
+GST_RTSP_ADDRESS_POOL_ANY_IPV4, macro in GstRTSPAddressPool +
+
+
+GST_RTSP_ADDRESS_POOL_ANY_IPV6, macro in GstRTSPAddressPool +
+
+
+gst_rtsp_address_pool_clear, function in GstRTSPAddressPool +
+
+
+gst_rtsp_address_pool_dump, function in GstRTSPAddressPool +
+
+
+gst_rtsp_address_pool_has_unicast_addresses, function in GstRTSPAddressPool +
+
+
+gst_rtsp_address_pool_new, function in GstRTSPAddressPool +
+
+
+gst_rtsp_address_pool_reserve_address, function in GstRTSPAddressPool +
+
+
+gst_rtsp_auth_add_basic, function in GstRTSPAuth +
+
+
+gst_rtsp_auth_check, function in GstRTSPAuth +
+
+
+GST_RTSP_AUTH_CHECK_CONNECT, macro in GstRTSPAuth +
+
+
+GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS, macro in GstRTSPAuth +
+
+
+GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT, macro in GstRTSPAuth +
+
+
+GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS, macro in GstRTSPAuth +
+
+
+GST_RTSP_AUTH_CHECK_URL, macro in GstRTSPAuth +
+
+
+gst_rtsp_auth_get_default_token, function in GstRTSPAuth +
+
+
+gst_rtsp_auth_get_tls_certificate, function in GstRTSPAuth +
+
+
+gst_rtsp_auth_make_basic, function in GstRTSPAuth +
+
+
+gst_rtsp_auth_new, function in GstRTSPAuth +
+
+
+gst_rtsp_auth_remove_basic, function in GstRTSPAuth +
+
+
+gst_rtsp_auth_set_default_token, function in GstRTSPAuth +
+
+
+gst_rtsp_auth_set_tls_certificate, function in GstRTSPAuth +
+
+
+gst_rtsp_client_attach, function in GstRTSPClient +
+
+
+gst_rtsp_client_close, function in GstRTSPClient +
+
+
+gst_rtsp_client_get_auth, function in GstRTSPClient +
+
+
+gst_rtsp_client_get_connection, function in GstRTSPClient +
+
+
+gst_rtsp_client_get_mount_points, function in GstRTSPClient +
+
+
+gst_rtsp_client_get_session_pool, function in GstRTSPClient +
+
+
+gst_rtsp_client_get_thread_pool, function in GstRTSPClient +
+
+
+gst_rtsp_client_handle_message, function in GstRTSPClient +
+
+
+gst_rtsp_client_new, function in GstRTSPClient +
+
+
+gst_rtsp_client_send_message, function in GstRTSPClient +
+
+
+gst_rtsp_client_session_filter, function in GstRTSPClient +
+
+
+gst_rtsp_client_set_auth, function in GstRTSPClient +
+
+
+gst_rtsp_client_set_connection, function in GstRTSPClient +
+
+
+gst_rtsp_client_set_mount_points, function in GstRTSPClient +
+
+
+gst_rtsp_client_set_send_func, function in GstRTSPClient +
+
+
+gst_rtsp_client_set_session_pool, function in GstRTSPClient +
+
+
+gst_rtsp_client_set_thread_pool, function in GstRTSPClient +
+
+
+gst_rtsp_context_get_current, function in GstRTSPContext +
+
+
+gst_rtsp_context_pop_current, function in GstRTSPContext +
+
+
+gst_rtsp_context_push_current, function in GstRTSPContext +
+
+
+gst_rtsp_media_collect_streams, function in GstRTSPMedia +
+
+
+gst_rtsp_media_create_stream, function in GstRTSPMedia +
+
+
+gst_rtsp_media_factory_add_role, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_construct, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_create_element, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_get_address_pool, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_get_buffer_size, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_get_launch, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_get_permissions, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_get_profiles, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_get_protocols, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_get_suspend_mode, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_is_eos_shutdown, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_is_shared, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_new, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_set_address_pool, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_set_buffer_size, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_set_eos_shutdown, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_set_launch, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_set_permissions, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_set_profiles, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_set_protocols, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_set_shared, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_set_suspend_mode, function in GstRTSPMediaFactory +
+
+
+gst_rtsp_media_factory_uri_get_uri, function in GstRTSPMediaFactoryURI +
+
+
+gst_rtsp_media_factory_uri_new, function in GstRTSPMediaFactoryURI +
+
+
+gst_rtsp_media_factory_uri_set_uri, function in GstRTSPMediaFactoryURI +
+
+
+gst_rtsp_media_find_stream, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_address_pool, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_base_time, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_buffer_size, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_clock, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_element, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_permissions, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_profiles, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_protocols, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_range_string, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_status, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_stream, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_suspend_mode, function in GstRTSPMedia +
+
+
+gst_rtsp_media_get_time_provider, function in GstRTSPMedia +
+
+
+gst_rtsp_media_is_eos_shutdown, function in GstRTSPMedia +
+
+
+gst_rtsp_media_is_reusable, function in GstRTSPMedia +
+
+
+gst_rtsp_media_is_shared, function in GstRTSPMedia +
+
+
+gst_rtsp_media_is_time_provider, function in GstRTSPMedia +
+
+
+gst_rtsp_media_new, function in GstRTSPMedia +
+
+
+gst_rtsp_media_n_streams, function in GstRTSPMedia +
+
+
+gst_rtsp_media_prepare, function in GstRTSPMedia +
+
+
+gst_rtsp_media_seek, function in GstRTSPMedia +
+
+
+gst_rtsp_media_setup_sdp, function in GstRTSPMedia +
+
+
+gst_rtsp_media_set_address_pool, function in GstRTSPMedia +
+
+
+gst_rtsp_media_set_buffer_size, function in GstRTSPMedia +
+
+
+gst_rtsp_media_set_eos_shutdown, function in GstRTSPMedia +
+
+
+gst_rtsp_media_set_permissions, function in GstRTSPMedia +
+
+
+gst_rtsp_media_set_pipeline_state, function in GstRTSPMedia +
+
+
+gst_rtsp_media_set_profiles, function in GstRTSPMedia +
+
+
+gst_rtsp_media_set_protocols, function in GstRTSPMedia +
+
+
+gst_rtsp_media_set_reusable, function in GstRTSPMedia +
+
+
+gst_rtsp_media_set_shared, function in GstRTSPMedia +
+
+
+gst_rtsp_media_set_state, function in GstRTSPMedia +
+
+
+gst_rtsp_media_set_suspend_mode, function in GstRTSPMedia +
+
+
+gst_rtsp_media_suspend, function in GstRTSPMedia +
+
+
+gst_rtsp_media_take_pipeline, function in GstRTSPMedia +
+
+
+gst_rtsp_media_unprepare, function in GstRTSPMedia +
+
+
+gst_rtsp_media_unsuspend, function in GstRTSPMedia +
+
+
+gst_rtsp_media_use_time_provider, function in GstRTSPMedia +
+
+
+gst_rtsp_mount_points_add_factory, function in GstRTSPMountPoints +
+
+
+gst_rtsp_mount_points_make_path, function in GstRTSPMountPoints +
+
+
+gst_rtsp_mount_points_match, function in GstRTSPMountPoints +
+
+
+gst_rtsp_mount_points_new, function in GstRTSPMountPoints +
+
+
+gst_rtsp_mount_points_remove_factory, function in GstRTSPMountPoints +
+
+
+gst_rtsp_params_get, function in GstRTSPParams +
+
+
+gst_rtsp_params_set, function in GstRTSPParams +
+
+
+gst_rtsp_permissions_add_role, function in GstRTSPPermissions +
+
+
+gst_rtsp_permissions_add_role_valist, function in GstRTSPPermissions +
+
+
+gst_rtsp_permissions_get_role, function in GstRTSPPermissions +
+
+
+gst_rtsp_permissions_is_allowed, function in GstRTSPPermissions +
+
+
+gst_rtsp_permissions_new, function in GstRTSPPermissions +
+
+
+gst_rtsp_permissions_ref, function in GstRTSPPermissions +
+
+
+gst_rtsp_permissions_remove_role, function in GstRTSPPermissions +
+
+
+gst_rtsp_permissions_unref, function in GstRTSPPermissions +
+
+
+GST_RTSP_PERM_MEDIA_FACTORY_ACCESS, macro in GstRTSPAuth +
+
+
+GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT, macro in GstRTSPAuth +
+
+
+gst_rtsp_sdp_from_media, function in GstRTSPSdp +
+
+
+gst_rtsp_server_attach, function in GstRTSPServer +
+
+
+gst_rtsp_server_client_filter, function in GstRTSPServer +
+
+
+gst_rtsp_server_create_socket, function in GstRTSPServer +
+
+
+gst_rtsp_server_create_source, function in GstRTSPServer +
+
+
+gst_rtsp_server_get_address, function in GstRTSPServer +
+
+
+gst_rtsp_server_get_auth, function in GstRTSPServer +
+
+
+gst_rtsp_server_get_backlog, function in GstRTSPServer +
+
+
+gst_rtsp_server_get_bound_port, function in GstRTSPServer +
+
+
+gst_rtsp_server_get_mount_points, function in GstRTSPServer +
+
+
+gst_rtsp_server_get_service, function in GstRTSPServer +
+
+
+gst_rtsp_server_get_session_pool, function in GstRTSPServer +
+
+
+gst_rtsp_server_get_thread_pool, function in GstRTSPServer +
+
+
+gst_rtsp_server_io_func, function in GstRTSPServer +
+
+
+gst_rtsp_server_new, function in GstRTSPServer +
+
+
+gst_rtsp_server_set_address, function in GstRTSPServer +
+
+
+gst_rtsp_server_set_auth, function in GstRTSPServer +
+
+
+gst_rtsp_server_set_backlog, function in GstRTSPServer +
+
+
+gst_rtsp_server_set_mount_points, function in GstRTSPServer +
+
+
+gst_rtsp_server_set_service, function in GstRTSPServer +
+
+
+gst_rtsp_server_set_session_pool, function in GstRTSPServer +
+
+
+gst_rtsp_server_set_thread_pool, function in GstRTSPServer +
+
+
+gst_rtsp_server_transfer_connection, function in GstRTSPServer +
+
+
+gst_rtsp_session_allow_expire, function in GstRTSPSession +
+
+
+gst_rtsp_session_filter, function in GstRTSPSession +
+
+
+gst_rtsp_session_get_header, function in GstRTSPSession +
+
+
+gst_rtsp_session_get_media, function in GstRTSPSession +
+
+
+gst_rtsp_session_get_sessionid, function in GstRTSPSession +
+
+
+gst_rtsp_session_get_timeout, function in GstRTSPSession +
+
+
+gst_rtsp_session_is_expired, function in GstRTSPSession +
+
+
+gst_rtsp_session_manage_media, function in GstRTSPSession +
+
+
+gst_rtsp_session_media_alloc_channels, function in GstRTSPSessionMedia +
+
+
+gst_rtsp_session_media_get_base_time, function in GstRTSPSessionMedia +
+
+
+gst_rtsp_session_media_get_media, function in GstRTSPSessionMedia +
+
+
+gst_rtsp_session_media_get_rtpinfo, function in GstRTSPSessionMedia +
+
+
+gst_rtsp_session_media_get_rtsp_state, function in GstRTSPSessionMedia +
+
+
+gst_rtsp_session_media_get_transport, function in GstRTSPSessionMedia +
+
+
+gst_rtsp_session_media_matches, function in GstRTSPSessionMedia +
+
+
+gst_rtsp_session_media_new, function in GstRTSPSessionMedia +
+
+
+gst_rtsp_session_media_set_rtsp_state, function in GstRTSPSessionMedia +
+
+
+gst_rtsp_session_media_set_state, function in GstRTSPSessionMedia +
+
+
+gst_rtsp_session_media_set_transport, function in GstRTSPSessionMedia +
+
+
+gst_rtsp_session_new, function in GstRTSPSession +
+
+
+gst_rtsp_session_next_timeout, function in GstRTSPSession +
+
+
+gst_rtsp_session_pool_cleanup, function in GstRTSPSessionPool +
+
+
+gst_rtsp_session_pool_create, function in GstRTSPSessionPool +
+
+
+gst_rtsp_session_pool_create_watch, function in GstRTSPSessionPool +
+
+
+gst_rtsp_session_pool_filter, function in GstRTSPSessionPool +
+
+
+gst_rtsp_session_pool_find, function in GstRTSPSessionPool +
+
+
+gst_rtsp_session_pool_get_max_sessions, function in GstRTSPSessionPool +
+
+
+gst_rtsp_session_pool_get_n_sessions, function in GstRTSPSessionPool +
+
+
+gst_rtsp_session_pool_new, function in GstRTSPSessionPool +
+
+
+gst_rtsp_session_pool_remove, function in GstRTSPSessionPool +
+
+
+gst_rtsp_session_pool_set_max_sessions, function in GstRTSPSessionPool +
+
+
+gst_rtsp_session_prevent_expire, function in GstRTSPSession +
+
+
+gst_rtsp_session_release_media, function in GstRTSPSession +
+
+
+gst_rtsp_session_set_timeout, function in GstRTSPSession +
+
+
+gst_rtsp_session_touch, function in GstRTSPSession +
+
+
+gst_rtsp_stream_add_transport, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_address_pool, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_caps, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_control, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_dscp_qos, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_index, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_mtu, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_multicast_address, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_profiles, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_protocols, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_pt, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_rtcp_socket, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_rtpinfo, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_rtpsession, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_rtp_socket, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_server_port, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_srcpad, function in GstRTSPStream +
+
+
+gst_rtsp_stream_get_ssrc, function in GstRTSPStream +
+
+
+gst_rtsp_stream_has_control, function in GstRTSPStream +
+
+
+gst_rtsp_stream_is_blocking, function in GstRTSPStream +
+
+
+gst_rtsp_stream_is_transport_supported, function in GstRTSPStream +
+
+
+gst_rtsp_stream_join_bin, function in GstRTSPStream +
+
+
+gst_rtsp_stream_leave_bin, function in GstRTSPStream +
+
+
+gst_rtsp_stream_new, function in GstRTSPStream +
+
+
+gst_rtsp_stream_recv_rtcp, function in GstRTSPStream +
+
+
+gst_rtsp_stream_recv_rtp, function in GstRTSPStream +
+
+
+gst_rtsp_stream_remove_transport, function in GstRTSPStream +
+
+
+gst_rtsp_stream_reserve_address, function in GstRTSPStream +
+
+
+gst_rtsp_stream_set_address_pool, function in GstRTSPStream +
+
+
+gst_rtsp_stream_set_blocked, function in GstRTSPStream +
+
+
+gst_rtsp_stream_set_control, function in GstRTSPStream +
+
+
+gst_rtsp_stream_set_dscp_qos, function in GstRTSPStream +
+
+
+gst_rtsp_stream_set_mtu, function in GstRTSPStream +
+
+
+gst_rtsp_stream_set_profiles, function in GstRTSPStream +
+
+
+gst_rtsp_stream_set_protocols, function in GstRTSPStream +
+
+
+gst_rtsp_stream_transport_filter, function in GstRTSPStream +
+
+
+gst_rtsp_stream_transport_get_rtpinfo, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_get_stream, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_get_transport, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_get_url, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_is_timed_out, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_keep_alive, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_new, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_send_rtcp, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_send_rtp, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_set_active, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_set_callbacks, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_set_keepalive, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_set_timed_out, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_set_transport, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_transport_set_url, function in GstRTSPStreamTransport +
+
+
+gst_rtsp_stream_update_crypto, function in GstRTSPStream +
+
+
+gst_rtsp_thread_new, function in GstRTSPThreadPool +
+
+
+gst_rtsp_thread_pool_cleanup, function in GstRTSPThreadPool +
+
+
+gst_rtsp_thread_pool_get_max_threads, function in GstRTSPThreadPool +
+
+
+gst_rtsp_thread_pool_get_thread, function in GstRTSPThreadPool +
+
+
+gst_rtsp_thread_pool_new, function in GstRTSPThreadPool +
+
+
+gst_rtsp_thread_pool_set_max_threads, function in GstRTSPThreadPool +
+
+
+gst_rtsp_thread_ref, function in GstRTSPThreadPool +
+
+
+gst_rtsp_thread_reuse, function in GstRTSPThreadPool +
+
+
+gst_rtsp_thread_stop, function in GstRTSPThreadPool +
+
+
+gst_rtsp_thread_unref, function in GstRTSPThreadPool +
+
+
+gst_rtsp_token_get_string, function in GstRTSPToken +
+
+
+gst_rtsp_token_get_structure, function in GstRTSPToken +
+
+
+gst_rtsp_token_is_allowed, function in GstRTSPToken +
+
+
+GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, macro in GstRTSPAuth +
+
+
+gst_rtsp_token_new, function in GstRTSPToken +
+
+
+gst_rtsp_token_new_empty, function in GstRTSPToken +
+
+
+gst_rtsp_token_new_valist, function in GstRTSPToken +
+
+
+gst_rtsp_token_ref, function in GstRTSPToken +
+
+
+GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS, macro in GstRTSPAuth +
+
+
+gst_rtsp_token_unref, function in GstRTSPToken +
+
+
+gst_rtsp_token_writable_structure, function in GstRTSPToken +
+
+

S

+
+GstSDPInfo, struct in GstRTSPSdp +
+
+
+ + + \ No newline at end of file diff --git a/docs/libs/html/ch01.html b/docs/libs/html/ch01.html new file mode 100644 index 0000000..0173744 --- /dev/null +++ b/docs/libs/html/ch01.html @@ -0,0 +1,88 @@ + + + + +GStreamer RTSP Server Reference Manual: + + + + + + + + + + + + + + + + +
+
+
+
+GstRTSPServer — The main server object +
+
+GstRTSPClient — A client connection state +
+
+GstRTSPContext — A client request context +
+
+GstRTSPMountPoints — Map a path to media +
+
+GstRTSPMediaFactory — A factory for media pipelines +
+
+GstRTSPMediaFactoryURI — A factory for URI sources +
+
+GstRTSPMedia — The media pipeline +
+
+GstRTSPStream — A media stream +
+
+GstRTSPSessionPool — An object for managing sessions +
+
+GstRTSPSession — An object to manage media +
+
+GstRTSPSessionMedia — Media managed in a session +
+
+GstRTSPStreamTransport — A media stream transport configuration +
+
+GstRTSPSdp — Make SDP messages +
+
+GstRTSPAddressPool — A pool of network addresses +
+
+GstRTSPThreadPool — A pool of threads +
+
+GstRTSPAuth — Authentication and authorization +
+
+GstRTSPToken — Roles and permissions for a client +
+
+GstRTSPPermissions — Roles and associated permissions +
+
+GstRTSPParams — Param get and set implementation +
+
+
+ + + \ No newline at end of file diff --git a/docs/libs/html/gst-rtsp-server-1.0.devhelp2 b/docs/libs/html/gst-rtsp-server-1.0.devhelp2 new file mode 100644 index 0000000..3569b7c --- /dev/null +++ b/docs/libs/html/gst-rtsp-server-1.0.devhelp2 @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPAddressPool.html b/docs/libs/html/gst-rtsp-server-GstRTSPAddressPool.html new file mode 100644 index 0000000..2ba729e --- /dev/null +++ b/docs/libs/html/gst-rtsp-server-GstRTSPAddressPool.html @@ -0,0 +1,734 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPAddressPool + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPAddressPool

+

GstRTSPAddressPool — A pool of network addresses

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPAddress * + +gst_rtsp_address_copy () +
+void + +gst_rtsp_address_free () +
+GstRTSPAddressPool * + +gst_rtsp_address_pool_new () +
+void + +gst_rtsp_address_pool_clear () +
+void + +gst_rtsp_address_pool_dump () +
+gboolean + +gst_rtsp_address_pool_add_range () +
+gboolean + +gst_rtsp_address_pool_has_unicast_addresses () +
+GstRTSPAddress * + +gst_rtsp_address_pool_acquire_address () +
+GstRTSPAddressPoolResult + +gst_rtsp_address_pool_reserve_address () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineGST_RTSP_ADDRESS_POOL_ANY_IPV4
#defineGST_RTSP_ADDRESS_POOL_ANY_IPV6
structGstRTSPAddress
enumGstRTSPAddressFlags
structGstRTSPAddressPool
structGstRTSPAddressPoolClass
enumGstRTSPAddressPoolResult
+
+
+

Description

+

The GstRTSPAddressPool is an object that maintains a collection of network +addresses. It is used to allocate server ports and server multicast addresses +but also to reserve client provided destination addresses.

+

A range of addresses can be added with gst_rtsp_address_pool_add_range(). +Both multicast and unicast addresses can be added.

+

With gst_rtsp_address_pool_acquire_address() an unused address and port range +can be acquired from the pool. With gst_rtsp_address_pool_reserve_address() a +specific address can be retrieved. Both methods return a boxed +GstRTSPAddress that should be freed with gst_rtsp_address_free() after +usage, which brings the address back into the pool.

+

Last reviewed on 2013-07-16 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_address_copy ()

+
GstRTSPAddress *
+gst_rtsp_address_copy (GstRTSPAddress *addr);
+

Make a copy of addr +.

+
+

Parameters

+
+++++ + + + + + +

addr

a GstRTSPAddress

 
+
+
+

Returns

+

a copy of addr +.

+

+
+
+
+
+

gst_rtsp_address_free ()

+
void
+gst_rtsp_address_free (GstRTSPAddress *addr);
+

Free addr + and releasing it back into the pool when owned by a +pool.

+
+

Parameters

+
+++++ + + + + + +

addr

a GstRTSPAddress

 
+
+
+
+
+

gst_rtsp_address_pool_new ()

+
GstRTSPAddressPool *
+gst_rtsp_address_pool_new (void);
+

Make a new GstRTSPAddressPool.

+
+

Returns

+

a new GstRTSPAddressPool.

+

[transfer full]

+
+
+
+
+

gst_rtsp_address_pool_clear ()

+
void
+gst_rtsp_address_pool_clear (GstRTSPAddressPool *pool);
+

Clear all addresses in pool +. There should be no outstanding +allocations.

+
+

Parameters

+
+++++ + + + + + +

pool

a GstRTSPAddressPool

 
+
+
+
+
+

gst_rtsp_address_pool_dump ()

+
void
+gst_rtsp_address_pool_dump (GstRTSPAddressPool *pool);
+

Dump the free and allocated addresses to stdout.

+
+

Parameters

+
+++++ + + + + + +

pool

a GstRTSPAddressPool

 
+
+
+
+
+

gst_rtsp_address_pool_add_range ()

+
gboolean
+gst_rtsp_address_pool_add_range (GstRTSPAddressPool *pool,
+                                 const gchar *min_address,
+                                 const gchar *max_address,
+                                 guint16 min_port,
+                                 guint16 max_port,
+                                 guint8 ttl);
+

Adds the addresses from min_addess + to max_address + (inclusive) +to pool +. The valid port range for the addresses will be from min_port + to +max_port + inclusive.

+

When ttl + is 0, min_address + and max_address + should be unicast addresses. +min_address + and max_address + can be set to +GST_RTSP_ADDRESS_POOL_ANY_IPV4 or GST_RTSP_ADDRESS_POOL_ANY_IPV6 to bind +to all available IPv4 or IPv6 addresses.

+

When ttl + > 0, min_address + and max_address + should be multicast addresses.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

pool

a GstRTSPAddressPool

 

min_address

a minimum address to add

 

max_address

a maximum address to add

 

min_port

the minimum port

 

max_port

the maximum port

 

ttl

a TTL or 0 for unicast addresses

 
+
+
+

Returns

+

TRUE if the addresses could be added.

+

+
+
+
+
+

gst_rtsp_address_pool_has_unicast_addresses ()

+
gboolean
+gst_rtsp_address_pool_has_unicast_addresses
+                               (GstRTSPAddressPool *pool);
+

Used to know if the pool includes any unicast addresses.

+
+

Parameters

+
+++++ + + + + + +

pool

a GstRTSPAddressPool

 
+
+
+

Returns

+

TRUE if the pool includes any unicast addresses, FALSE otherwise

+

+
+
+
+
+

gst_rtsp_address_pool_acquire_address ()

+
GstRTSPAddress *
+gst_rtsp_address_pool_acquire_address (GstRTSPAddressPool *pool,
+                                       GstRTSPAddressFlags flags,
+                                       gint n_ports);
+

Take an address and ports from pool +. flags + can be used to control the +allocation. n_ports + consecutive ports will be allocated of which the first +one can be found in port +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

pool

a GstRTSPAddressPool

 

flags

flags

 

n_ports

the amount of ports

 
+
+
+

Returns

+

a GstRTSPAddress that should be freed with +gst_rtsp_address_free after use or NULL when no address could be +acquired.

+

[nullable]

+
+
+
+
+

gst_rtsp_address_pool_reserve_address ()

+
GstRTSPAddressPoolResult
+gst_rtsp_address_pool_reserve_address (GstRTSPAddressPool *pool,
+                                       const gchar *ip_address,
+                                       guint port,
+                                       guint n_ports,
+                                       guint ttl,
+                                       GstRTSPAddress **address);
+

Take a specific address and ports from pool +. n_ports + consecutive +ports will be allocated of which the first one can be found in +port +.

+

If ttl + is 0, address + should be a unicast address. If ttl + > 0, address + +should be a valid multicast address.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

pool

a GstRTSPAddressPool

 

ip_address

The IP address to reserve

 

port

The first port to reserve

 

n_ports

The number of ports

 

ttl

The requested ttl

 

address

storage for a GstRTSPAddress.

[out]
+
+
+

Returns

+

GST_RTSP_ADDRESS_POOL_OK if an address was reserved. The address +is returned in address +and should be freed with gst_rtsp_address_free +after use.

+

+
+
+
+
+

Types and Values

+
+

GST_RTSP_ADDRESS_POOL_ANY_IPV4

+
#define GST_RTSP_ADDRESS_POOL_ANY_IPV4  "0.0.0.0"
+
+

Used with gst_rtsp_address_pool_add_range() to bind to all +IPv4 addresses

+
+
+
+

GST_RTSP_ADDRESS_POOL_ANY_IPV6

+
#define GST_RTSP_ADDRESS_POOL_ANY_IPV6  "::"
+
+

Used with gst_rtsp_address_pool_add_range() to bind to all +IPv6 addresses

+
+
+
+

struct GstRTSPAddress

+
struct GstRTSPAddress {
+  GstRTSPAddressPool *pool;
+
+  gchar *address;
+  guint16 port;
+  gint n_ports;
+  guint8 ttl;
+};
+
+

An address

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GstRTSPAddressPool *pool;

the GstRTSPAddressPool owner of this address

 

gchar *address;

the address

 

guint16 port;

the port number

 

gint n_ports;

number of ports

 

guint8 ttl;

TTL or 0 for unicast addresses

 
+
+
+
+
+

enum GstRTSPAddressFlags

+

Flags used to control allocation of addresses

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GST_RTSP_ADDRESS_FLAG_NONE

+

no flags

+
 

GST_RTSP_ADDRESS_FLAG_IPV4

+

an IPv4 address

+
 

GST_RTSP_ADDRESS_FLAG_IPV6

+

and IPv6 address

+
 

GST_RTSP_ADDRESS_FLAG_EVEN_PORT

+

address with an even port

+
 

GST_RTSP_ADDRESS_FLAG_MULTICAST

+

a multicast address

+
 

GST_RTSP_ADDRESS_FLAG_UNICAST

+

a unicast address

+
 
+
+
+
+
+

struct GstRTSPAddressPool

+
struct GstRTSPAddressPool {
+  GObject       parent;
+};
+
+

An address pool, all member are private

+
+

Members

+
+++++ + + + + + +

GObject parent;

the parent GObject

 
+
+
+
+
+

struct GstRTSPAddressPoolClass

+
struct GstRTSPAddressPoolClass {
+  GObjectClass  parent_class;
+};
+
+

Opaque Address pool class.

+
+
+
+

enum GstRTSPAddressPoolResult

+

Result codes from RTSP address pool functions.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GST_RTSP_ADDRESS_POOL_OK

+

no error

+
 

GST_RTSP_ADDRESS_POOL_EINVAL

+

invalid arguments were provided to a function

+
 

GST_RTSP_ADDRESS_POOL_ERESERVED

+

the addres has already been reserved

+
 

GST_RTSP_ADDRESS_POOL_ERANGE

+

the address is not in the pool

+
 

GST_RTSP_ADDRESS_POOL_ELAST

+

last error

+
 
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPContext.html b/docs/libs/html/gst-rtsp-server-GstRTSPContext.html new file mode 100644 index 0000000..05b6d41 --- /dev/null +++ b/docs/libs/html/gst-rtsp-server-GstRTSPContext.html @@ -0,0 +1,267 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPContext + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPContext

+

GstRTSPContext — A client request context

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + +
+GstRTSPContext * + +gst_rtsp_context_get_current () +
+void + +gst_rtsp_context_push_current () +
+void + +gst_rtsp_context_pop_current () +
+
+
+

Types and Values

+
++++ + + + + +
structGstRTSPContext
+
+
+

Description

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_context_get_current ()

+
GstRTSPContext *
+gst_rtsp_context_get_current (void);
+

Get the current GstRTSPContext. This object is retrieved from the +current thread that is handling the request for a client.

+
+

Returns

+

a GstRTSPContext

+

+
+
+
+
+

gst_rtsp_context_push_current ()

+
void
+gst_rtsp_context_push_current (GstRTSPContext *ctx);
+

Pushes ctx + onto the context stack. The current +context can then be received using gst_rtsp_context_get_current().

+
+

Parameters

+
+++++ + + + + + +

ctx

a #GstRTSPContext

 
+
+
+
+
+

gst_rtsp_context_pop_current ()

+
void
+gst_rtsp_context_pop_current (GstRTSPContext *ctx);
+

Pops ctx + off the context stack (verifying that ctx + +is on the top of the stack).

+
+

Parameters

+
+++++ + + + + + +

ctx

a GstRTSPContext

 
+
+
+
+
+

Types and Values

+
+

struct GstRTSPContext

+
struct GstRTSPContext {
+  GstRTSPServer       *server;
+  GstRTSPConnection   *conn;
+  GstRTSPClient       *client;
+  GstRTSPMessage      *request;
+  GstRTSPUrl          *uri;
+  GstRTSPMethod        method;
+  GstRTSPAuth         *auth;
+  GstRTSPToken        *token;
+  GstRTSPSession      *session;
+  GstRTSPSessionMedia *sessmedia;
+  GstRTSPMediaFactory *factory;
+  GstRTSPMedia        *media;
+  GstRTSPStream       *stream;
+  GstRTSPMessage      *response;
+};
+
+

Information passed around containing the context of a request.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GstRTSPServer *server;

the server

 

GstRTSPConnection *conn;

the connection

 

GstRTSPClient *client;

the client

 

GstRTSPMessage *request;

the complete request

 

GstRTSPUrl *uri;

the complete url parsed from request +

 

GstRTSPMethod method;

the parsed method of uri +

 

GstRTSPAuth *auth;

the current auth object or NULL

 

GstRTSPToken *token;

authorisation token

 

GstRTSPSession *session;

the session, can be NULL

 

GstRTSPSessionMedia *sessmedia;

the session media for the url can be NULL

 

GstRTSPMediaFactory *factory;

the media factory for the url, can be NULL

 

GstRTSPMedia *media;

the media for the url can be NULL

 

GstRTSPStream *stream;

the stream for the url can be NULL

 

GstRTSPMessage *response;

the response

 
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPMediaFactoryURI.html b/docs/libs/html/gst-rtsp-server-GstRTSPMediaFactoryURI.html new file mode 100644 index 0000000..cf5778e --- /dev/null +++ b/docs/libs/html/gst-rtsp-server-GstRTSPMediaFactoryURI.html @@ -0,0 +1,196 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPMediaFactoryURI + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPMediaFactoryURI

+

GstRTSPMediaFactoryURI — A factory for URI sources

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + +
+GstRTSPMediaFactoryURI * + +gst_rtsp_media_factory_uri_new () +
+void + +gst_rtsp_media_factory_uri_set_uri () +
+gchar * + +gst_rtsp_media_factory_uri_get_uri () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
structGstRTSPMediaFactoryURI
structGstRTSPMediaFactoryURIClass
+
+
+

Description

+

This specialized GstRTSPMediaFactory constructs media pipelines from a URI, +given with gst_rtsp_media_factory_uri_set_uri().

+

It will automatically demux and payload the different streams found in the +media at URL.

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_media_factory_uri_new ()

+
GstRTSPMediaFactoryURI *
+gst_rtsp_media_factory_uri_new (void);
+

Create a new GstRTSPMediaFactoryURI instance.

+
+

Returns

+

a new GstRTSPMediaFactoryURI object.

+

[transfer full]

+
+
+
+
+

gst_rtsp_media_factory_uri_set_uri ()

+
void
+gst_rtsp_media_factory_uri_set_uri (GstRTSPMediaFactoryURI *factory,
+                                    const gchar *uri);
+

Set the URI of the resource that will be streamed by this factory.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

factory

a GstRTSPMediaFactory

 

uri

the uri the stream

 
+
+
+
+
+

gst_rtsp_media_factory_uri_get_uri ()

+
gchar *
+gst_rtsp_media_factory_uri_get_uri (GstRTSPMediaFactoryURI *factory);
+

Get the URI that will provide media for this factory.

+
+

Parameters

+
+++++ + + + + + +

factory

a GstRTSPMediaFactory

 
+
+
+

Returns

+

the configured URI. g_free() after usage.

+

[transfer full]

+
+
+
+
+

Types and Values

+
+

struct GstRTSPMediaFactoryURI

+
struct GstRTSPMediaFactoryURI {
+  GstRTSPMediaFactory   parent;
+};
+
+

A media factory that creates a pipeline to play and uri.

+
+
+
+

struct GstRTSPMediaFactoryURIClass

+
struct GstRTSPMediaFactoryURIClass {
+  GstRTSPMediaFactoryClass  parent_class;
+};
+
+

The GstRTSPMediaFactoryURI class structure.

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPParams.html b/docs/libs/html/gst-rtsp-server-GstRTSPParams.html new file mode 100644 index 0000000..2831087 --- /dev/null +++ b/docs/libs/html/gst-rtsp-server-GstRTSPParams.html @@ -0,0 +1,149 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPParams + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPParams

+

GstRTSPParams — Param get and set implementation

+
+
+

Functions

+
++++ + + + + + + + + + + +
+GstRTSPResult + +gst_rtsp_params_get () +
+GstRTSPResult + +gst_rtsp_params_set () +
+
+
+

Description

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_params_get ()

+
GstRTSPResult
+gst_rtsp_params_get (GstRTSPClient *client,
+                     GstRTSPContext *ctx);
+

Get parameters (not implemented yet)

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

client

a GstRTSPClient

 

ctx

a GstRTSPContext.

[transfer none]
+
+
+

Returns

+

a GstRTSPResult

+

+
+
+
+
+

gst_rtsp_params_set ()

+
GstRTSPResult
+gst_rtsp_params_set (GstRTSPClient *client,
+                     GstRTSPContext *ctx);
+

Set parameters (not implemented yet)

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

client

a GstRTSPClient

 

ctx

a GstRTSPContext.

[transfer none]
+
+
+

Returns

+

a GstRTSPResult

+

+
+
+
+
+

Types and Values

+
+
+

See Also

+

GstRTSPClient

+
+
+ + + \ No newline at end of file diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPPermissions.html b/docs/libs/html/gst-rtsp-server-GstRTSPPermissions.html new file mode 100644 index 0000000..37fb587 --- /dev/null +++ b/docs/libs/html/gst-rtsp-server-GstRTSPPermissions.html @@ -0,0 +1,428 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPPermissions + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPPermissions

+

GstRTSPPermissions — Roles and associated permissions

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPPermissions * + +gst_rtsp_permissions_new () +
+GstRTSPPermissions * + +gst_rtsp_permissions_ref () +
+void + +gst_rtsp_permissions_unref () +
+void + +gst_rtsp_permissions_add_role () +
+void + +gst_rtsp_permissions_add_role_valist () +
+void + +gst_rtsp_permissions_remove_role () +
const GstStructure * + +gst_rtsp_permissions_get_role () +
+gboolean + +gst_rtsp_permissions_is_allowed () +
+
+
+

Types and Values

+
++++ + + + + +
structGstRTSPPermissions
+
+
+

Description

+

The GstRTSPPermissions object contains an array of roles and associated +permissions. The roles are represented with a string and the permissions with +a generic GstStructure.

+

The permissions are deliberately kept generic. The possible values of the +roles and GstStructure keys and values are only determined by the GstRTSPAuth +object that performs the checks on the permissions and the current +GstRTSPToken.

+

As a convenience function, gst_rtsp_permissions_is_allowed() can be used to +check if the permissions contains a role that contains the boolean value +TRUE for the the given key.

+

Last reviewed on 2013-07-15 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_permissions_new ()

+
GstRTSPPermissions *
+gst_rtsp_permissions_new (void);
+

Create a new empty Authorization permissions.

+
+

Returns

+

a new empty authorization permissions.

+

[transfer full]

+
+
+
+
+

gst_rtsp_permissions_ref ()

+
GstRTSPPermissions *
+gst_rtsp_permissions_ref (GstRTSPPermissions *permissions);
+

Increase the refcount of this permissions.

+
+

Parameters

+
+++++ + + + + + +

permissions

The permissions to refcount

 
+
+
+

Returns

+

permissions +(for convenience when doing assignments).

+

[transfer full]

+
+
+
+
+

gst_rtsp_permissions_unref ()

+
void
+gst_rtsp_permissions_unref (GstRTSPPermissions *permissions);
+

Decrease the refcount of an permissions, freeing it if the refcount reaches 0.

+
+

Parameters

+
+++++ + + + + + +

permissions

the permissions to refcount.

[transfer full]
+
+
+
+
+

gst_rtsp_permissions_add_role ()

+
void
+gst_rtsp_permissions_add_role (GstRTSPPermissions *permissions,
+                               const gchar *role,
+                               const gchar *fieldname,
+                               ...);
+

Add a new role + to permissions + with the given variables. The fields +are the same layout as gst_structure_new().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

permissions

a GstRTSPPermissions

 

role

a role

 

fieldname

the first field name

 

...

additional arguments

 
+
+
+
+
+

gst_rtsp_permissions_add_role_valist ()

+
void
+gst_rtsp_permissions_add_role_valist (GstRTSPPermissions *permissions,
+                                      const gchar *role,
+                                      const gchar *fieldname,
+                                      va_list var_args);
+

Add a new role + to permissions + with the given variables. Structure fields +are set according to the varargs in a manner similar to gst_structure_new().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

permissions

a GstRTSPPermissions

 

role

a role

 

fieldname

the first field name

 

var_args

additional fields to add

 
+
+
+
+
+

gst_rtsp_permissions_remove_role ()

+
void
+gst_rtsp_permissions_remove_role (GstRTSPPermissions *permissions,
+                                  const gchar *role);
+

Remove all permissions for role + in permissions +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

permissions

a GstRTSPPermissions

 

role

a role

 
+
+
+
+
+

gst_rtsp_permissions_get_role ()

+
const GstStructure *
+gst_rtsp_permissions_get_role (GstRTSPPermissions *permissions,
+                               const gchar *role);
+

Get all permissions for role + in permissions +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

permissions

a GstRTSPPermissions

 

role

a role

 
+
+
+

Returns

+

the structure with permissions for role +. It +remains valid for as long as permissions +is valid.

+

[transfer none]

+
+
+
+
+

gst_rtsp_permissions_is_allowed ()

+
gboolean
+gst_rtsp_permissions_is_allowed (GstRTSPPermissions *permissions,
+                                 const gchar *role,
+                                 const gchar *permission);
+

Check if role + in permissions + is given permission for permission +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

permissions

a GstRTSPPermissions

 

role

a role

 

permission

a permission

 
+
+
+

Returns

+

TRUE if role +is allowed permission +.

+

+
+
+
+
+

Types and Values

+
+

struct GstRTSPPermissions

+
struct GstRTSPPermissions {
+  GstMiniObject mini_object;
+};
+
+

The opaque permissions structure. It is used to define the permissions +of objects in different roles.

+
+
+
+

See Also

+

GstRTSPToken, GstRTSPAuth

+
+
+ + + \ No newline at end of file diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPSdp.html b/docs/libs/html/gst-rtsp-server-GstRTSPSdp.html new file mode 100644 index 0000000..00d6db7 --- /dev/null +++ b/docs/libs/html/gst-rtsp-server-GstRTSPSdp.html @@ -0,0 +1,135 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPSdp + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPSdp

+

GstRTSPSdp — Make SDP messages

+
+
+

Functions

+
++++ + + + + +
+gboolean + +gst_rtsp_sdp_from_media () +
+
+
+

Types and Values

+
++++ + + + + +
 GstSDPInfo
+
+
+

Description

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_sdp_from_media ()

+
gboolean
+gst_rtsp_sdp_from_media (GstSDPMessage *sdp,
+                         GstSDPInfo *info,
+                         GstRTSPMedia *media);
+

Add media + specific info to sdp +. info + is used to configure the connection +information in the SDP.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

sdp

a GstSDPMessage

 

info

a GstSDPInfo.

[transfer none]

media

a GstRTSPMedia.

[transfer none]
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

Types and Values

+
+

GstSDPInfo

+
typedef struct {
+  gboolean is_ipv6;
+  const gchar *server_ip;
+} GstSDPInfo;
+
+
+
+
+

See Also

+

GstRTSPMedia

+
+
+ + + \ No newline at end of file diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPSessionMedia.html b/docs/libs/html/gst-rtsp-server-GstRTSPSessionMedia.html new file mode 100644 index 0000000..da892d7 --- /dev/null +++ b/docs/libs/html/gst-rtsp-server-GstRTSPSessionMedia.html @@ -0,0 +1,589 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPSessionMedia + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPSessionMedia

+

GstRTSPSessionMedia — Media managed in a session

+
+ +
+

Types and Values

+
++++ + + + + + + + + + + +
structGstRTSPSessionMedia
structGstRTSPSessionMediaClass
+
+
+

Description

+

The GstRTSPSessionMedia object manages a GstRTSPMedia with a given path.

+

With gst_rtsp_session_media_get_transport() and +gst_rtsp_session_media_set_transport() the transports of a GstRTSPStream of +the managed GstRTSPMedia can be retrieved and configured.

+

Use gst_rtsp_session_media_set_state() to control the media state and +transports.

+

Last reviewed on 2013-07-16 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_session_media_new ()

+
GstRTSPSessionMedia *
+gst_rtsp_session_media_new (const gchar *path,
+                            GstRTSPMedia *media);
+

Create a new GstRTSPSessionMedia that manages the streams +in media + for path +. media + should be prepared.

+

Ownership is taken of media +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

path

the path

 

media

the GstRTSPMedia.

[transfer full]
+
+
+

Returns

+

a new GstRTSPSessionMedia.

+

[transfer full]

+
+
+
+
+

gst_rtsp_session_media_matches ()

+
gboolean
+gst_rtsp_session_media_matches (GstRTSPSessionMedia *media,
+                                const gchar *path,
+                                gint *matched);
+

Check if the path of media + matches path +. It path + matches, the amount of +matched characters is returned in matched +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

media

a GstRTSPSessionMedia

 

path

a path

 

matched

the amount of matched characters of path +.

[out]
+
+
+

Returns

+

TRUE when path +matches the path of media +.

+

+
+
+
+
+

gst_rtsp_session_media_get_media ()

+
GstRTSPMedia *
+gst_rtsp_session_media_get_media (GstRTSPSessionMedia *media);
+

Get the GstRTSPMedia that was used when constructing media +

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPSessionMedia

 
+
+
+

Returns

+

the GstRTSPMedia of media +. Remains valid as long +as media +is valid.

+

[transfer none]

+
+
+
+
+

gst_rtsp_session_media_get_base_time ()

+
GstClockTime
+gst_rtsp_session_media_get_base_time (GstRTSPSessionMedia *media);
+

Get the base_time of the GstRTSPMedia in media +

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPSessionMedia

 
+
+
+

Returns

+

the base_time of the media.

+

+
+
+
+
+

gst_rtsp_session_media_get_rtpinfo ()

+
gchar *
+gst_rtsp_session_media_get_rtpinfo (GstRTSPSessionMedia *media);
+

Retrieve the RTP-Info header string for all streams in media + +with configured transports.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPSessionMedia

 
+
+
+

Returns

+

The RTP-Info as a string or +NULL when no RTP-Info could be generated, g_free() after usage.

+

[transfer full][nullable]

+
+
+
+
+

gst_rtsp_session_media_set_state ()

+
gboolean
+gst_rtsp_session_media_set_state (GstRTSPSessionMedia *media,
+                                  GstState state);
+

Tell the media object media + to change to state +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPSessionMedia

 

state

the new state

 
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

gst_rtsp_session_media_get_rtsp_state ()

+
GstRTSPState
+gst_rtsp_session_media_get_rtsp_state (GstRTSPSessionMedia *media);
+

Get the current RTSP state of media +.

+
+

Parameters

+
+++++ + + + + + +

media

a GstRTSPSessionMedia

 
+
+
+

Returns

+

the current RTSP state of media +.

+

+
+
+
+
+

gst_rtsp_session_media_set_rtsp_state ()

+
void
+gst_rtsp_session_media_set_rtsp_state (GstRTSPSessionMedia *media,
+                                       GstRTSPState state);
+

Set the RTSP state of media + to state +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPSessionMedia

 

state

a GstRTSPState

 
+
+
+
+
+

gst_rtsp_session_media_get_transport ()

+
GstRTSPStreamTransport *
+gst_rtsp_session_media_get_transport (GstRTSPSessionMedia *media,
+                                      guint idx);
+

Get a previously created GstRTSPStreamTransport for the stream at idx +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPSessionMedia

 

idx

the stream index

 
+
+
+

Returns

+

a GstRTSPStreamTransport that is valid until the +session of media +is unreffed.

+

[transfer none]

+
+
+
+
+

gst_rtsp_session_media_set_transport ()

+
GstRTSPStreamTransport *
+gst_rtsp_session_media_set_transport (GstRTSPSessionMedia *media,
+                                      GstRTSPStream *stream,
+                                      GstRTSPTransport *tr);
+

Configure the transport for stream + to tr + in media +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

media

a GstRTSPSessionMedia

 

stream

a GstRTSPStream

 

tr

a GstRTSPTransport.

[transfer full]
+
+
+

Returns

+

the new or updated GstRTSPStreamTransport for stream +.

+

[transfer none]

+
+
+
+
+

gst_rtsp_session_media_alloc_channels ()

+
gboolean
+gst_rtsp_session_media_alloc_channels (GstRTSPSessionMedia *media,
+                                       GstRTSPRange *range);
+

Fill range + with the next available min and max channels for +interleaved transport.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

media

a GstRTSPSessionMedia

 

range

a GstRTSPRange.

[out]
+
+
+

Returns

+

TRUE on success.

+

+
+
+
+
+

Types and Values

+
+

struct GstRTSPSessionMedia

+
struct GstRTSPSessionMedia {
+  GObject  parent;
+};
+
+

State of a client session regarding a specific media identified by path.

+
+
+
+

struct GstRTSPSessionMediaClass

+
struct GstRTSPSessionMediaClass {
+  GObjectClass  parent_class;
+};
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPStreamTransport.html b/docs/libs/html/gst-rtsp-server-GstRTSPStreamTransport.html new file mode 100644 index 0000000..e065a93 --- /dev/null +++ b/docs/libs/html/gst-rtsp-server-GstRTSPStreamTransport.html @@ -0,0 +1,851 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPStreamTransport + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPStreamTransport

+

GstRTSPStreamTransport — A media stream transport configuration

+
+
+

Functions

+ +
+
+

Types and Values

+
++++ + + + + + + + + + + +
structGstRTSPStreamTransport
structGstRTSPStreamTransportClass
+
+
+

Description

+

The GstRTSPStreamTransport configures the transport used by a +GstRTSPStream. It is usually manages by a GstRTSPSessionMedia object.

+

With gst_rtsp_stream_transport_set_callbacks(), callbacks can be configured +to handle the RTP and RTCP packets from the stream, for example when they +need to be sent over TCP.

+

With gst_rtsp_stream_transport_set_active() the transports are added and +removed from the stream.

+

A GstRTSPStream will call gst_rtsp_stream_transport_keep_alive() when RTCP +is received from the client. It will also call +gst_rtsp_stream_transport_set_timed_out() when a receiver has timed out.

+

Last reviewed on 2013-07-16 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_stream_transport_new ()

+
GstRTSPStreamTransport *
+gst_rtsp_stream_transport_new (GstRTSPStream *stream,
+                               GstRTSPTransport *tr);
+

Create a new GstRTSPStreamTransport that can be used to manage +stream + with transport tr +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stream

a GstRTSPStream

 

tr

a GstRTSPTransport.

[transfer full]
+
+
+

Returns

+

a new GstRTSPStreamTransport.

+

[transfer full]

+
+
+
+
+

gst_rtsp_stream_transport_get_stream ()

+
GstRTSPStream *
+gst_rtsp_stream_transport_get_stream (GstRTSPStreamTransport *trans);
+

Get the GstRTSPStream used when constructing trans +.

+
+

Parameters

+
+++++ + + + + + +

trans

a GstRTSPStreamTransport

 
+
+
+

Returns

+

the stream used when constructing trans +.

+

[transfer none]

+
+
+
+
+

gst_rtsp_stream_transport_get_transport ()

+
const GstRTSPTransport *
+gst_rtsp_stream_transport_get_transport
+                               (GstRTSPStreamTransport *trans);
+

Get the transport configured in trans +.

+
+

Parameters

+
+++++ + + + + + +

trans

a GstRTSPStreamTransport

 
+
+
+

Returns

+

the transport configured in trans +. It remains +valid for as long as trans +is valid.

+

[transfer none]

+
+
+
+
+

gst_rtsp_stream_transport_set_transport ()

+
void
+gst_rtsp_stream_transport_set_transport
+                               (GstRTSPStreamTransport *trans,
+                                GstRTSPTransport *tr);
+

Set tr + as the client transport. This function takes ownership of the +passed tr +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

trans

a GstRTSPStreamTransport

 

tr

a client GstRTSPTransport.

[transfer full]
+
+
+
+
+

gst_rtsp_stream_transport_get_url ()

+
const GstRTSPUrl *
+gst_rtsp_stream_transport_get_url (GstRTSPStreamTransport *trans);
+

Get the url configured in trans +.

+
+

Parameters

+
+++++ + + + + + +

trans

a GstRTSPStreamTransport

 
+
+
+

Returns

+

the url configured in trans +. It remains +valid for as long as trans +is valid.

+

[transfer none]

+
+
+
+
+

gst_rtsp_stream_transport_set_url ()

+
void
+gst_rtsp_stream_transport_set_url (GstRTSPStreamTransport *trans,
+                                   const GstRTSPUrl *url);
+

Set url + as the client url.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

trans

a GstRTSPStreamTransport

 

url

a client GstRTSPUrl.

[transfer none]
+
+
+
+
+

gst_rtsp_stream_transport_get_rtpinfo ()

+
gchar *
+gst_rtsp_stream_transport_get_rtpinfo (GstRTSPStreamTransport *trans,
+                                       GstClockTime start_time);
+

Get the RTP-Info string for trans + and start_time +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

trans

a GstRTSPStreamTransport

 

start_time

a star time

 
+
+
+

Returns

+

the RTPInfo string for trans +and start_time +or NULL when the RTP-Info could not be +determined. g_free() after usage.

+

[transfer full][nullable]

+
+
+
+
+

GstRTSPSendFunc ()

+
gboolean
+(*GstRTSPSendFunc) (GstBuffer *buffer,
+                    guint8 channel,
+                    gpointer user_data);
+

Function registered with gst_rtsp_stream_transport_set_callbacks() and +called when buffer + must be sent on channel +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

buffer

a GstBuffer

 

channel

a channel

 

user_data

user data

 
+
+
+

Returns

+

TRUE on success

+

+
+
+
+
+

gst_rtsp_stream_transport_set_callbacks ()

+
void
+gst_rtsp_stream_transport_set_callbacks
+                               (GstRTSPStreamTransport *trans,
+                                GstRTSPSendFunc send_rtp,
+                                GstRTSPSendFunc send_rtcp,
+                                gpointer user_data,
+                                GDestroyNotify notify);
+

Install callbacks that will be called when data for a stream should be sent +to a client. This is usually used when sending RTP/RTCP over TCP.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

trans

a GstRTSPStreamTransport

 

send_rtp

a callback called when RTP should be sent.

[scope notified]

send_rtcp

a callback called when RTCP should be sent.

[scope notified]

user_data

user data passed to callbacks.

[closure]

notify

called with the user_data when no longer needed.

[allow-none]
+
+
+
+
+

GstRTSPKeepAliveFunc ()

+
void
+(*GstRTSPKeepAliveFunc) (gpointer user_data);
+

Function registered with gst_rtsp_stream_transport_set_keepalive() and called +when the stream is active.

+
+

Parameters

+
+++++ + + + + + +

user_data

user data

 
+
+
+
+
+

gst_rtsp_stream_transport_set_keepalive ()

+
void
+gst_rtsp_stream_transport_set_keepalive
+                               (GstRTSPStreamTransport *trans,
+                                GstRTSPKeepAliveFunc keep_alive,
+                                gpointer user_data,
+                                GDestroyNotify notify);
+

Install callbacks that will be called when RTCP packets are received from the +receiver of trans +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

trans

a GstRTSPStreamTransport

 

keep_alive

a callback called when the receiver is active.

[scope notified]

user_data

user data passed to callback.

[closure]

notify

called with the user_data when no longer needed.

[allow-none]
+
+
+
+
+

gst_rtsp_stream_transport_keep_alive ()

+
void
+gst_rtsp_stream_transport_keep_alive (GstRTSPStreamTransport *trans);
+

Signal the installed keep_alive callback for trans +.

+
+

Parameters

+
+++++ + + + + + +

trans

a GstRTSPStreamTransport

 
+
+
+
+
+

gst_rtsp_stream_transport_set_active ()

+
gboolean
+gst_rtsp_stream_transport_set_active (GstRTSPStreamTransport *trans,
+                                      gboolean active);
+

Activate or deactivate datatransfer configured in trans +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

trans

a GstRTSPStreamTransport

 

active

new state of trans +

 
+
+
+

Returns

+

TRUE when the state was changed.

+

+
+
+
+
+

gst_rtsp_stream_transport_set_timed_out ()

+
void
+gst_rtsp_stream_transport_set_timed_out
+                               (GstRTSPStreamTransport *trans,
+                                gboolean timedout);
+

Set the timed out state of trans + to timedout +

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

trans

a GstRTSPStreamTransport

 

timedout

timed out value

 
+
+
+
+
+

gst_rtsp_stream_transport_is_timed_out ()

+
gboolean
+gst_rtsp_stream_transport_is_timed_out
+                               (GstRTSPStreamTransport *trans);
+

Check if trans + is timed out.

+
+

Parameters

+
+++++ + + + + + +

trans

a GstRTSPStreamTransport

 
+
+
+

Returns

+

TRUE if trans +timed out.

+

+
+
+
+
+

gst_rtsp_stream_transport_send_rtcp ()

+
gboolean
+gst_rtsp_stream_transport_send_rtcp (GstRTSPStreamTransport *trans,
+                                     GstBuffer *buffer);
+

Send buffer + to the installed RTCP callback for trans +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

trans

a GstRTSPStreamTransport

 

buffer

a GstBuffer.

[transfer none]
+
+
+

Returns

+

TRUE on success

+

+
+
+
+
+

gst_rtsp_stream_transport_send_rtp ()

+
gboolean
+gst_rtsp_stream_transport_send_rtp (GstRTSPStreamTransport *trans,
+                                    GstBuffer *buffer);
+

Send buffer + to the installed RTP callback for trans +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

trans

a GstRTSPStreamTransport

 

buffer

a GstBuffer.

[transfer none]
+
+
+

Returns

+

TRUE on success

+

+
+
+
+
+

Types and Values

+
+

struct GstRTSPStreamTransport

+
struct GstRTSPStreamTransport {
+  GObject              parent;
+};
+
+

A Transport description for a stream

+
+

Members

+
+++++ + + + + + +

GObject parent;

parent instance

 
+
+
+
+
+

struct GstRTSPStreamTransportClass

+
struct GstRTSPStreamTransportClass {
+  GObjectClass parent_class;
+};
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPThreadPool.html b/docs/libs/html/gst-rtsp-server-GstRTSPThreadPool.html new file mode 100644 index 0000000..4ce53af --- /dev/null +++ b/docs/libs/html/gst-rtsp-server-GstRTSPThreadPool.html @@ -0,0 +1,592 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPThreadPool + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPThreadPool

+

GstRTSPThreadPool — A pool of threads

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPThread * + +gst_rtsp_thread_new () +
+GstRTSPThread * + +gst_rtsp_thread_ref () +
+void + +gst_rtsp_thread_unref () +
+gboolean + +gst_rtsp_thread_reuse () +
+void + +gst_rtsp_thread_stop () +
+GstRTSPThreadPool * + +gst_rtsp_thread_pool_new () +
+gint + +gst_rtsp_thread_pool_get_max_threads () +
+void + +gst_rtsp_thread_pool_set_max_threads () +
+GstRTSPThread * + +gst_rtsp_thread_pool_get_thread () +
+void + +gst_rtsp_thread_pool_cleanup () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + +
enumGstRTSPThreadType
structGstRTSPThread
structGstRTSPThreadPool
structGstRTSPThreadPoolClass
+
+
+

Description

+

A GstRTSPThreadPool manages reusable threads for various server tasks. +Currently the defined thread types can be found in GstRTSPThreadType.

+

Threads of type GST_RTSP_THREAD_TYPE_CLIENT are used to handle requests from +a connected client. With gst_rtsp_thread_pool_get_max_threads() a maximum +number of threads can be set after which the pool will start to reuse the +same thread for multiple clients.

+

Threads of type GST_RTSP_THREAD_TYPE_MEDIA will be used to perform the state +changes of the media pipelines and handle its bus messages.

+

gst_rtsp_thread_pool_get_thread() can be used to create a GstRTSPThread +object of the right type. The thread object contains a mainloop and context +that run in a seperate thread and can be used to attached sources to.

+

gst_rtsp_thread_reuse() can be used to reuse a thread for multiple purposes. +If all gst_rtsp_thread_reuse() calls are matched with a +gst_rtsp_thread_stop() call, the mainloop will be quit and the thread will +stop.

+

To configure the threads, a subclass of this object should be made and the +virtual methods should be overriden to implement the desired functionality.

+

Last reviewed on 2013-07-11 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_thread_new ()

+
GstRTSPThread *
+gst_rtsp_thread_new (GstRTSPThreadType type);
+

Create a new thread object that can run a mainloop.

+
+

Parameters

+
+++++ + + + + + +

type

the thread type

 
+
+
+

Returns

+

a GstRTSPThread.

+

[transfer full]

+
+
+
+
+

gst_rtsp_thread_ref ()

+
GstRTSPThread *
+gst_rtsp_thread_ref (GstRTSPThread *thread);
+

Increase the refcount of this thread.

+
+

Parameters

+
+++++ + + + + + +

thread

The thread to refcount

 
+
+
+

Returns

+

thread +(for convenience when doing assignments).

+

[transfer full]

+
+
+
+
+

gst_rtsp_thread_unref ()

+
void
+gst_rtsp_thread_unref (GstRTSPPermissions *thread);
+

Decrease the refcount of an thread, freeing it if the refcount reaches 0.

+
+

Parameters

+
+++++ + + + + + +

thread

the thread to refcount.

[transfer full]
+
+
+
+
+

gst_rtsp_thread_reuse ()

+
gboolean
+gst_rtsp_thread_reuse (GstRTSPThread *thread);
+

Reuse the mainloop of thread +

+
+

Parameters

+
+++++ + + + + + +

thread

a GstRTSPThread.

[transfer none]
+
+
+

Returns

+

TRUE if the mainloop could be reused

+

+
+
+
+
+

gst_rtsp_thread_stop ()

+
void
+gst_rtsp_thread_stop (GstRTSPThread *thread);
+

Stop and unref thread +. When no threads are using the mainloop, the thread +will be stopped and the final ref to thread + will be released.

+
+

Parameters

+
+++++ + + + + + +

thread

a GstRTSPThread.

[transfer full]
+
+
+
+
+

gst_rtsp_thread_pool_new ()

+
GstRTSPThreadPool *
+gst_rtsp_thread_pool_new (void);
+

Create a new GstRTSPThreadPool instance.

+
+

Returns

+

a new GstRTSPThreadPool.

+

[transfer full]

+
+
+
+
+

gst_rtsp_thread_pool_get_max_threads ()

+
gint
+gst_rtsp_thread_pool_get_max_threads (GstRTSPThreadPool *pool);
+

Get the maximum number of threads used for client connections. +See gst_rtsp_thread_pool_set_max_threads().

+
+

Parameters

+
+++++ + + + + + +

pool

a GstRTSPThreadPool

 
+
+
+

Returns

+

the maximum number of threads.

+

+
+
+
+
+

gst_rtsp_thread_pool_set_max_threads ()

+
void
+gst_rtsp_thread_pool_set_max_threads (GstRTSPThreadPool *pool,
+                                      gint max_threads);
+

Set the maximum threads used by the pool to handle client requests. +A value of 0 will use the pool mainloop, a value of -1 will use an +unlimited number of threads.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pool

a GstRTSPThreadPool

 

max_threads

maximum threads

 
+
+
+
+
+

gst_rtsp_thread_pool_get_thread ()

+
GstRTSPThread *
+gst_rtsp_thread_pool_get_thread (GstRTSPThreadPool *pool,
+                                 GstRTSPThreadType type,
+                                 GstRTSPContext *ctx);
+

Get a new GstRTSPThread for type + and ctx +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

pool

a GstRTSPThreadPool

 

type

the GstRTSPThreadType

 

ctx

a GstRTSPContext.

[transfer none]
+
+
+

Returns

+

a new GstRTSPThread, gst_rtsp_thread_stop() after usage.

+

[transfer full]

+
+
+
+
+

gst_rtsp_thread_pool_cleanup ()

+
void
+gst_rtsp_thread_pool_cleanup (void);
+

Wait for all tasks to be stopped and free all allocated resources. This is +mainly used in test suites to ensure proper cleanup of internal data +structures.

+
+
+
+

Types and Values

+
+

enum GstRTSPThreadType

+

Different thread types

+
+

Members

+
+++++ + + + + + + + + + + + + +

GST_RTSP_THREAD_TYPE_CLIENT

+

a thread to handle the client communication

+
 

GST_RTSP_THREAD_TYPE_MEDIA

+

a thread to handle media

+
 
+
+
+
+
+

struct GstRTSPThread

+
struct GstRTSPThread {
+  GstMiniObject mini_object;
+
+  GstRTSPThreadType type;
+  GMainContext *context;
+  GMainLoop *loop;
+};
+
+

Structure holding info about a mainloop running in a thread

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

GstMiniObject mini_object;

parent GstMiniObject

 

GstRTSPThreadType type;

the thread type

 

GMainContext *context;

a GMainContext

 

GMainLoop *loop;

a GMainLoop

 
+
+
+
+
+

struct GstRTSPThreadPool

+
struct GstRTSPThreadPool {
+  GObject       parent;
+};
+
+

The thread pool structure.

+
+
+
+

struct GstRTSPThreadPoolClass

+
struct GstRTSPThreadPoolClass {
+  GObjectClass  parent_class;
+
+  GThreadPool *pool;
+
+  GstRTSPThread * (*get_thread)        (GstRTSPThreadPool *pool,
+                                        GstRTSPThreadType type,
+                                        GstRTSPContext *ctx);
+  void            (*configure_thread)  (GstRTSPThreadPool *pool,
+                                        GstRTSPThread * thread,
+                                        GstRTSPContext *ctx);
+
+  void            (*thread_enter)      (GstRTSPThreadPool *pool,
+                                        GstRTSPThread *thread);
+  void            (*thread_leave)      (GstRTSPThreadPool *pool,
+                                        GstRTSPThread *thread);
+};
+
+

Class for managing threads.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GObjectClass parent_class;

  

GThreadPool *pool;

a GThreadPool used internally

 

get_thread ()

this function should make or reuse an existing thread that runs +a mainloop.

 

configure_thread ()

configure a thread object. this vmethod is called when +a new thread has been created and should be configured.

 

thread_enter ()

called from the thread when it is entered

 

thread_leave ()

called from the thread when it is left

 
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPToken.html b/docs/libs/html/gst-rtsp-server-GstRTSPToken.html new file mode 100644 index 0000000..8279c79 --- /dev/null +++ b/docs/libs/html/gst-rtsp-server-GstRTSPToken.html @@ -0,0 +1,443 @@ + + + + +GStreamer RTSP Server Reference Manual: GstRTSPToken + + + + + + + + + + + + + + + + +
+
+
+ + +
+

GstRTSPToken

+

GstRTSPToken — Roles and permissions for a client

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+GstRTSPToken * + +gst_rtsp_token_new_empty () +
+GstRTSPToken * + +gst_rtsp_token_new () +
+GstRTSPToken * + +gst_rtsp_token_new_valist () +
+GstRTSPToken * + +gst_rtsp_token_ref () +
+void + +gst_rtsp_token_unref () +
const GstStructure * + +gst_rtsp_token_get_structure () +
+GstStructure * + +gst_rtsp_token_writable_structure () +
const gchar * + +gst_rtsp_token_get_string () +
+gboolean + +gst_rtsp_token_is_allowed () +
+
+
+

Types and Values

+
++++ + + + + +
structGstRTSPToken
+
+
+

Description

+

A GstRTSPToken contains the permissions and roles of the user +performing the current request. A token is usually created when a user is +authenticated by the GstRTSPAuth object and is then placed as the current +token for the current request.

+

GstRTSPAuth can use the token and its contents to check authorization for +various operations by comparing the token to the GstRTSPPermissions of the +object.

+

The accepted values of the token are entirely defined by the GstRTSPAuth +object that implements the security policy.

+

Last reviewed on 2013-07-15 (1.0.0)

+
+
+

Functions

+
+

gst_rtsp_token_new_empty ()

+
GstRTSPToken *
+gst_rtsp_token_new_empty (void);
+

Create a new empty Authorization token.

+
+

Returns

+

a new empty authorization token.

+

[transfer full]

+
+
+
+
+

gst_rtsp_token_new ()

+
GstRTSPToken *
+gst_rtsp_token_new (const gchar *firstfield,
+                    ...);
+

Create a new Authorization token with the given fieldnames and values. +Arguments are given similar to gst_structure_new().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

firstfield

the first fieldname

 

...

additional arguments

 
+
+
+

Returns

+

a new authorization token.

+

[transfer full]

+
+
+
+
+

gst_rtsp_token_new_valist ()

+
GstRTSPToken *
+gst_rtsp_token_new_valist (const gchar *firstfield,
+                           va_list var_args);
+

Create a new Authorization token with the given fieldnames and values. +Arguments are given similar to gst_structure_new_valist().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

firstfield

the first fieldname

 

var_args

additional arguments

 
+
+
+

Returns

+

a new authorization token.

+

[transfer full]

+
+
+
+
+

gst_rtsp_token_ref ()

+
GstRTSPToken *
+gst_rtsp_token_ref (GstRTSPToken *token);
+

Increase the refcount of this token.

+
+

Parameters

+
+++++ + + + + + +

token

The token to refcount

 
+
+
+

Returns

+

token +(for convenience when doing assignments).

+

[transfer full]

+
+
+
+
+

gst_rtsp_token_unref ()

+
void
+gst_rtsp_token_unref (GstRTSPToken *token);
+

Decrease the refcount of an token, freeing it if the refcount reaches 0.

+
+

Parameters

+
+++++ + + + + + +

token

the token to refcount.

[transfer full]
+
+
+
+
+

gst_rtsp_token_get_structure ()

+
const GstStructure *
+gst_rtsp_token_get_structure (GstRTSPToken *token);
+

Access the structure of the token.

+
+

Parameters

+
+++++ + + + + + +

token

The GstRTSPToken.

 
+
+
+

Returns

+

The structure of the token. The structure is still +owned by the token, which means that you should not free it and that the +pointer becomes invalid when you free the token.

+

MT safe.

+

[transfer none]

+
+
+
+
+

gst_rtsp_token_writable_structure ()

+
GstStructure *
+gst_rtsp_token_writable_structure (GstRTSPToken *token);
+

Get a writable version of the structure.

+
+

Parameters

+
+++++ + + + + + +

token

The GstRTSPToken.

 
+
+
+

Returns

+

The structure of the token. The structure is still +owned by the token, which means that you should not free it and that the +pointer becomes invalid when you free the token. This function checks if +token +is writable and will never return NULL.

+

MT safe.

+

[transfer none]

+
+
+
+
+

gst_rtsp_token_get_string ()

+
const gchar *
+gst_rtsp_token_get_string (GstRTSPToken *token,
+                           const gchar *field);
+

Get the string value of field + in token +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

token

a GstRTSPToken

 

field

a field name

 
+
+
+

Returns

+

the string value of field +in +token +or NULL when field +is not defined in token +. The string +becomes invalid when you free token +.

+

[transfer none][nullable]

+
+
+
+
+

gst_rtsp_token_is_allowed ()

+
gboolean
+gst_rtsp_token_is_allowed (GstRTSPToken *token,
+                           const gchar *field);
+

Check if token + has a boolean field + and if it is set to TRUE.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

token

a GstRTSPToken

 

field

a field name

 
+
+
+

Returns

+

TRUE if token +has a boolean field named field +set to TRUE.

+

+
+
+
+
+

Types and Values

+
+

struct GstRTSPToken

+
struct GstRTSPToken {
+  GstMiniObject mini_object;
+};
+
+

An opaque object used for checking authorisations. +It is generated after successful authentication.

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/libs/html/home.png b/docs/libs/html/home.png new file mode 100644 index 0000000000000000000000000000000000000000..9346b336a784463192c7daab5133a3673dd69845 GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRMbARQqaxysz9Q}BI-m)~Y zggoA|1V*z2{cQ=d;!=?fvu4~`n82RKrk1UubNXTJj1GP|o-=>$A29f{JgJ9K`^t{Q z-oWs>M&_hvT&MjX@T4-&sBW+1^4oB5G4r2q!qGktZ!n*!)hjrjd0_4L6;4%u<}orJ u%Vo~x?#i!!ww+1OGuHe}T=cKQUzn^_t)8|WlnDbmjKR~@&t;ucLK6T + + + +GStreamer RTSP Server Reference Manual: GStreamer RTSP Server Reference Manual + + + + + + + +
+
+
+
+

+ for GStreamer RTSP Server 1.4.1 +

+
+
+
+
+
+
+
+GstRTSPServer — The main server object +
+
+GstRTSPClient — A client connection state +
+
+GstRTSPContext — A client request context +
+
+GstRTSPMountPoints — Map a path to media +
+
+GstRTSPMediaFactory — A factory for media pipelines +
+
+GstRTSPMediaFactoryURI — A factory for URI sources +
+
+GstRTSPMedia — The media pipeline +
+
+GstRTSPStream — A media stream +
+
+GstRTSPSessionPool — An object for managing sessions +
+
+GstRTSPSession — An object to manage media +
+
+GstRTSPSessionMedia — Media managed in a session +
+
+GstRTSPStreamTransport — A media stream transport configuration +
+
+GstRTSPSdp — Make SDP messages +
+
+GstRTSPAddressPool — A pool of network addresses +
+
+GstRTSPThreadPool — A pool of threads +
+
+GstRTSPAuth — Authentication and authorization +
+
+GstRTSPToken — Roles and permissions for a client +
+
+GstRTSPPermissions — Roles and associated permissions +
+
+GstRTSPParams — Param get and set implementation +
+
+
Object Hierarchy
+
API Index
+
Annotation Glossary
+
+
+ + + \ No newline at end of file diff --git a/docs/libs/html/index.sgml b/docs/libs/html/index.sgml new file mode 100644 index 0000000..a3ac202 --- /dev/null +++ b/docs/libs/html/index.sgml @@ -0,0 +1,533 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libs/html/left-insensitive.png b/docs/libs/html/left-insensitive.png new file mode 100644 index 0000000000000000000000000000000000000000..3269393a7f72af744a772c437bd7b3976c23709d GIT binary patch literal 395 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefH0HbvDJm`3=E7Co-U3d7N^fnTIWJ3j{^~q!iyia4kV=mdU|Jhfgdm;SLIpiYJ7wv^kjFiECCc&8T30!RG0~&BG=X zlu#U4@Z`))V`EG9e^NqDr#{!5k|)wT* zYTNt0`@q%TAD$){%#eQ?;$^ly8}yZCU%T~u0XM^%t?f#e znB*EuLv2rP%K3BMvFO}YmnR}KSgH;`EHL$)^!tH~iBxZ#h^zJi*#P5Xb6B50U@nx2 mU;T=yfcwnSOsS9SKd{M#MlNkCuvG>I8-u5-pUXO@geCx5`k@p6 literal 0 HcmV?d00001 diff --git a/docs/libs/html/left.png b/docs/libs/html/left.png new file mode 100644 index 0000000000000000000000000000000000000000..2abde032b0c98b756b12d380da4318205cd78470 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRMaSLay~*pwMJb7sn8b(^oI8=R24v(*CjE{-BFv z0BhvLm?o9(UC{-Ci?lD?Ve-7-xypA!PTC(0^;>UheG4Altep3@`rO0#Rjs1)RxCLr zE5mee>7m*=%yEk+GVvGkRy0O&*&MTd5SjH(lgq~7r%6oRW$l1p-*S}iC>@fyDsz%y z`UIW8^Ao=maGhj3E8{7Cd_qof`K4oa->23`>&M2+XBtd2J`8jogQu&X%Q~loCIG_? BVG#fT literal 0 HcmV?d00001 diff --git a/docs/libs/html/right-insensitive.png b/docs/libs/html/right-insensitive.png new file mode 100644 index 0000000000000000000000000000000000000000..4c95785b907b978f36674cd98bf5302669c15c1b GIT binary patch literal 373 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefG`u!(zUX23=E7+o-U3d7N^fn+URvSL8NuRG*{E) z?#-+97X-^pidQ*u@StO1(S@7g8g>nnA24$?ty?)cmuaa|Y>ez2*_Ia?6HP4j{3LIs zTr!s1ao_Sz^~3e4zRJGAjKZGn=XP#)Wmuo-QN>teTzzI!&R*jMI^Oa#7_ukLYdicf zOx;1mb-rt04s-c|uIH8fnX}$)XJa^0_-F3(pA%=sGI<|(n_*&=yYt96+n5InXn_GN+EraJI9q(O+n{6MQKErp&KxRvpfn0xh z`sSMqH(2Z%?kaFBTf06W^y=UDA9gR9YrwNS*1pjB((0K%&+SbAx3`XA&dKZ}j*nX7 QfdRze>FVdQ&MBb@09|aA9{>OV literal 0 HcmV?d00001 diff --git a/docs/libs/html/right.png b/docs/libs/html/right.png new file mode 100644 index 0000000000000000000000000000000000000000..76260ec8865f4e13cd269ec62eccd78a33adba3c GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRMbR+#PqI2*V^#7sn8b(^oI8=W9$9IsUQVezxzH zy`G{eu0`y#boSlU-NAlQG~=D)BPJG4k(^0qdDa(AdQvI0d|vJT=i7_<_D6`Cy?Dm; zP0@1EeB~D|O$oQe*sxL-P;q{2UCr}fN-o#M~tpZzsGyfNz46SZlIJCbKH zZQscEqpOfBCPDgx + + + +GStreamer RTSP Server Reference Manual: Object Hierarchy + + + + + + + + + + + + + + + + +
+

+Object Hierarchy

+
+    GObject
+    ├── GstRTSPAuth
+    ├── GstRTSPMountPoints
+    ├── GstRTSPMediaFactory
+    ├── GstRTSPMedia
+    ├── GstRTSPServer
+    ├── GstRTSPSessionPool
+    ├── GstRTSPSession
+    ├── GstRTSPClient
+    ╰── GstRTSPStream
+
+
+ + + \ No newline at end of file diff --git a/docs/libs/html/style.css b/docs/libs/html/style.css new file mode 100644 index 0000000..c141ddd --- /dev/null +++ b/docs/libs/html/style.css @@ -0,0 +1,476 @@ +body +{ + font-family: cantarell, sans-serif; +} +.synopsis, .classsynopsis +{ + /* tango:aluminium 1/2 */ + background: #eeeeec; + background: rgba(238, 238, 236, 0.5); + border: solid 1px rgb(238, 238, 236); + padding: 0.5em; +} +.programlisting +{ + /* tango:sky blue 0/1 */ + /* fallback for no rgba support */ + background: #e6f3ff; + border: solid 1px #729fcf; + background: rgba(114, 159, 207, 0.1); + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0.5em; +} +.variablelist +{ + padding: 4px; + margin-left: 3em; +} +.variablelist td:first-child +{ + vertical-align: top; +} + +div.gallery-float +{ + float: left; + padding: 10px; +} +div.gallery-float img +{ + border-style: none; +} +div.gallery-spacer +{ + clear: both; +} + +a, a:visited +{ + text-decoration: none; + /* tango:sky blue 2 */ + color: #3465a4; +} +a:hover +{ + text-decoration: underline; + /* tango:sky blue 1 */ + color: #729fcf; +} + +div.informaltable table +{ + border-collapse: separate; + border-spacing: 1em 0.5em; + border: none; +} + +div.informaltable table td, div.informaltable table th +{ + vertical-align: top; +} + +.function_type, +.variable_type, +.property_type, +.signal_type, +.parameter_name, +.struct_member_name, +.union_member_name, +.define_keyword, +.datatype_keyword, +.typedef_keyword +{ + text-align: right; +} + +/* dim non-primary columns */ +.c_punctuation, +.function_type, +.variable_type, +.property_type, +.signal_type, +.define_keyword, +.datatype_keyword, +.typedef_keyword, +.property_flags, +.signal_flags, +.parameter_annotations, +.enum_member_annotations, +.struct_member_annotations, +.union_member_annotations +{ + color: #888a85; +} + +.function_type a, +.function_type a:visited, +.function_type a:hover, +.property_type a, +.property_type a:visited, +.property_type a:hover, +.signal_type a, +.signal_type a:visited, +.signal_type a:hover, +.signal_flags a, +.signal_flags a:visited, +.signal_flags a:hover +{ + color: #729fcf; +} + +td p +{ + margin: 0.25em; +} + +div.table table +{ + border-collapse: collapse; + border-spacing: 0px; + /* tango:aluminium 3 */ + border: solid 1px #babdb6; +} + +div.table table td, div.table table th +{ + /* tango:aluminium 3 */ + border: solid 1px #babdb6; + padding: 3px; + vertical-align: top; +} + +div.table table th +{ + /* tango:aluminium 2 */ + background-color: #d3d7cf; +} + +h4 +{ + color: #555753; +} + +hr +{ + /* tango:aluminium 1 */ + color: #d3d7cf; + background: #d3d7cf; + border: none 0px; + height: 1px; + clear: both; + margin: 2.0em 0em 2.0em 0em; +} + +dl.toc dt +{ + padding-bottom: 0.25em; +} + +dl.toc > dd > dl > dt +{ + padding-top: 0.25em; + padding-bottom: 0.25em; +} + +dl.toc > dt +{ + padding-top: 1em; + padding-bottom: 0.5em; + font-weight: bold; +} + +.parameter +{ + font-style: normal; +} + +.footer +{ + padding-top: 3.5em; + /* tango:aluminium 3 */ + color: #babdb6; + text-align: center; + font-size: 80%; +} + +.informalfigure, +.figure +{ + margin: 1em; +} + +.informalexample, +.example +{ + margin-top: 1em; + margin-bottom: 1em; +} + +.warning +{ + /* tango:orange 0/1 */ + background: #ffeed9; + background: rgba(252, 175, 62, 0.1); + border-color: #ffb04f; + border-color: rgba(252, 175, 62, 0.2); +} +.note +{ + /* tango:chameleon 0/0.5 */ + background: #d8ffb2; + background: rgba(138, 226, 52, 0.1); + border-color: #abf562; + border-color: rgba(138, 226, 52, 0.2); +} +div.blockquote +{ + border-color: #eeeeec; +} +.note, .warning, div.blockquote +{ + padding: 0.5em; + border-width: 1px; + border-style: solid; + margin: 2em; +} +.note p, .warning p +{ + margin: 0; +} + +div.warning h3.title, +div.note h3.title +{ + display: none; +} + +p + div.section +{ + margin-top: 1em; +} + +div.refnamediv, +div.refsynopsisdiv, +div.refsect1, +div.refsect2, +div.toc, +div.section +{ + margin-bottom: 1em; +} + +/* blob links */ +h2 .extralinks, h3 .extralinks +{ + float: right; + /* tango:aluminium 3 */ + color: #babdb6; + font-size: 80%; + font-weight: normal; +} + +.lineart +{ + color: #d3d7cf; + font-weight: normal; +} + +.annotation +{ + /* tango:aluminium 5 */ + color: #555753; + font-weight: normal; +} + +.structfield +{ + font-style: normal; + font-weight: normal; +} + +acronym,abbr +{ + border-bottom: 1px dotted gray; +} + +/* code listings */ + +.listing_code .programlisting .normal, +.listing_code .programlisting .normal a, +.listing_code .programlisting .number, +.listing_code .programlisting .cbracket, +.listing_code .programlisting .symbol { color: #555753; } +.listing_code .programlisting .comment, +.listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ +.listing_code .programlisting .function, +.listing_code .programlisting .function a, +.listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ +.listing_code .programlisting .string { color: #ad7fa8; } /* tango: plum */ +.listing_code .programlisting .keyword, +.listing_code .programlisting .usertype, +.listing_code .programlisting .type, +.listing_code .programlisting .type a { color: #4e9a06; } /* tango: chameleon 3 */ + +.listing_frame { + /* tango:sky blue 1 */ + border: solid 1px #729fcf; + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0px; +} + +.listing_lines, .listing_code { + margin-top: 0px; + margin-bottom: 0px; + padding: 0.5em; +} +.listing_lines { + /* tango:sky blue 0.5 */ + background: #a6c5e3; + background: rgba(114, 159, 207, 0.2); + /* tango:aluminium 6 */ + color: #2e3436; +} +.listing_code { + /* tango:sky blue 0 */ + background: #e6f3ff; + background: rgba(114, 159, 207, 0.1); +} +.listing_code .programlisting { + /* override from previous */ + border: none 0px; + padding: 0px; + background: none; +} +.listing_lines pre, .listing_code pre { + margin: 0px; +} + +@media screen { + sup a.footnote + { + position: relative; + top: 0em ! important; + } + /* this is needed so that the local anchors are displayed below the naviagtion */ + div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] + { + display: inline-block; + position: relative; + top:-5em; + } + /* this seems to be a bug in the xsl style sheets when generating indexes */ + div.index div.index + { + top: 0em; + } + /* make space for the fixed navigation bar and add space at the bottom so that + * link targets appear somewhat close to top + */ + body + { + padding-top: 2.5em; + padding-bottom: 500px; + max-width: 60em; + } + p + { + max-width: 60em; + } + /* style and size the navigation bar */ + table.navigation#top + { + position: fixed; + background: #e2e2e2; + border-bottom: solid 1px #babdb6; + border-spacing: 5px; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + z-index: 10; + } + table.navigation#top td + { + padding-left: 6px; + padding-right: 6px; + } + .navigation a, .navigation a:visited + { + /* tango:sky blue 3 */ + color: #204a87; + } + .navigation a:hover + { + /* tango:sky blue 2 */ + color: #3465a4; + } + td.shortcuts + { + /* tango:sky blue 2 */ + color: #3465a4; + font-size: 80%; + white-space: nowrap; + } + td.shortcuts .dim + { + color: #babdb6; + } + .navigation .title + { + font-size: 80%; + max-width: none; + margin: 0px; + font-weight: normal; + } +} +@media screen and (min-width: 60em) { + /* screen larger than 60em */ + body { margin: auto; } +} +@media screen and (max-width: 60em) { + /* screen less than 60em */ + #nav_hierarchy { display: none; } + #nav_interfaces { display: none; } + #nav_prerequisites { display: none; } + #nav_derived_interfaces { display: none; } + #nav_implementations { display: none; } + #nav_child_properties { display: none; } + #nav_style_properties { display: none; } + #nav_index { display: none; } + #nav_glossary { display: none; } + .gallery_image { display: none; } + .property_flags { display: none; } + .signal_flags { display: none; } + .parameter_annotations { display: none; } + .enum_member_annotations { display: none; } + .struct_member_annotations { display: none; } + .union_member_annotations { display: none; } + /* now that a column is hidden, optimize space */ + col.parameters_name { width: auto; } + col.parameters_description { width: auto; } + col.struct_members_name { width: auto; } + col.struct_members_description { width: auto; } + col.enum_members_name { width: auto; } + col.enum_members_description { width: auto; } + col.union_members_name { width: auto; } + col.union_members_description { width: auto; } + .listing_lines { display: none; } +} +@media print { + table.navigation { + visibility: collapse; + display: none; + } + div.titlepage table.navigation { + visibility: visible; + display: table; + background: #e2e2e2; + border: solid 1px #babdb6; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + height: 3em; + } +} + diff --git a/docs/libs/html/up-insensitive.png b/docs/libs/html/up-insensitive.png new file mode 100644 index 0000000000000000000000000000000000000000..f40498606db349a7321cf6b470523e836ee7ac2e GIT binary patch literal 374 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefG~@Ex#w@70gTL^E{-7zACwHGSRJaopUzr*FR_KPpkxheNzTDP+%{a~ox zRb6~e-_l%s#;V|Jw-)bO$G_X=4F`Y7SBoCzyjAZQ8BPW>ywAP8?pbBsZ|wt?+h6S6&uqY)kkMnwQQEd@7k`4t@sCCO z@7MoiEI4Q_#IB70vhu7Ab+>SXLxu@LWH Qzz|~aboFyt=akR{08E^fv;Y7A literal 0 HcmV?d00001 diff --git a/docs/libs/html/up.png b/docs/libs/html/up.png new file mode 100644 index 0000000000000000000000000000000000000000..80b4b37e997d69b2e128bc3090bc447ccb74bbe9 GIT binary patch literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRFevZLys@4W>+6GUE!tU04Ii{0w_tkMIDB?rA5 zttYTN + diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 0000000..eb5ddb8 --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1,14 @@ +noinst_PROGRAMS = test-video test-ogg test-mp4 test-readme \ + test-launch test-sdp test-uri test-auth \ + test-multicast test-multicast2 test-appsrc test-wfd + +#INCLUDES = -I$(top_srcdir) -I$(srcdir) + +AM_CFLAGS = $(GST_OBJ_CFLAGS) +LDADD = $(GST_OBJ_LIBS) $(GIO_LIBS) + +if HAVE_LIBCGROUP +noinst_PROGRAMS += test-cgroups +LDADD += $(LIBCGROUP_LIBS) +endif + diff --git a/examples/Makefile.in b/examples/Makefile.in new file mode 100644 index 0000000..82559a7 --- /dev/null +++ b/examples/Makefile.in @@ -0,0 +1,832 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +noinst_PROGRAMS = test-video$(EXEEXT) test-ogg$(EXEEXT) \ + test-mp4$(EXEEXT) test-readme$(EXEEXT) test-launch$(EXEEXT) \ + test-sdp$(EXEEXT) test-uri$(EXEEXT) test-auth$(EXEEXT) \ + test-multicast$(EXEEXT) test-multicast2$(EXEEXT) \ + test-appsrc$(EXEEXT) $(am__EXEEXT_1) +@HAVE_LIBCGROUP_TRUE@am__append_1 = test-cgroups +@HAVE_LIBCGROUP_TRUE@am__append_2 = $(LIBCGROUP_LIBS) +subdir = examples +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-docbook.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-doc.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/introspection.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@HAVE_LIBCGROUP_TRUE@am__EXEEXT_1 = test-cgroups$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) +test_appsrc_SOURCES = test-appsrc.c +test_appsrc_OBJECTS = test-appsrc.$(OBJEXT) +test_appsrc_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +@HAVE_LIBCGROUP_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +test_appsrc_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +test_auth_SOURCES = test-auth.c +test_auth_OBJECTS = test-auth.$(OBJEXT) +test_auth_LDADD = $(LDADD) +test_auth_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +test_cgroups_SOURCES = test-cgroups.c +test_cgroups_OBJECTS = test-cgroups.$(OBJEXT) +test_cgroups_LDADD = $(LDADD) +test_cgroups_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +test_launch_SOURCES = test-launch.c +test_launch_OBJECTS = test-launch.$(OBJEXT) +test_launch_LDADD = $(LDADD) +test_launch_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +test_mp4_SOURCES = test-mp4.c +test_mp4_OBJECTS = test-mp4.$(OBJEXT) +test_mp4_LDADD = $(LDADD) +test_mp4_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +test_multicast_SOURCES = test-multicast.c +test_multicast_OBJECTS = test-multicast.$(OBJEXT) +test_multicast_LDADD = $(LDADD) +test_multicast_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +test_multicast2_SOURCES = test-multicast2.c +test_multicast2_OBJECTS = test-multicast2.$(OBJEXT) +test_multicast2_LDADD = $(LDADD) +test_multicast2_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +test_ogg_SOURCES = test-ogg.c +test_ogg_OBJECTS = test-ogg.$(OBJEXT) +test_ogg_LDADD = $(LDADD) +test_ogg_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +test_readme_SOURCES = test-readme.c +test_readme_OBJECTS = test-readme.$(OBJEXT) +test_readme_LDADD = $(LDADD) +test_readme_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +test_sdp_SOURCES = test-sdp.c +test_sdp_OBJECTS = test-sdp.$(OBJEXT) +test_sdp_LDADD = $(LDADD) +test_sdp_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +test_uri_SOURCES = test-uri.c +test_uri_OBJECTS = test-uri.$(OBJEXT) +test_uri_LDADD = $(LDADD) +test_uri_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +test_video_SOURCES = test-video.c +test_video_OBJECTS = test-video.$(OBJEXT) +test_video_LDADD = $(LDADD) +test_video_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = test-appsrc.c test-auth.c test-cgroups.c test-launch.c \ + test-mp4.c test-multicast.c test-multicast2.c test-ogg.c \ + test-readme.c test-sdp.c test-uri.c test-video.c +DIST_SOURCES = test-appsrc.c test-auth.c test-cgroups.c test-launch.c \ + test-mp4.c test-multicast.c test-multicast2.c test-ogg.c \ + test-readme.c test-sdp.c test-uri.c test-video.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAT_ENTRY_END = @CAT_ENTRY_END@ +CAT_ENTRY_START = @CAT_ENTRY_START@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPD_PLUGINS_DIR = @GSTPD_PLUGINS_DIR@ +GSTPG_PLUGINS_DIR = @GSTPG_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALL_CFLAGS = @GST_ALL_CFLAGS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_ALL_LIBS = @GST_ALL_LIBS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OBJ_CFLAGS = @GST_OBJ_CFLAGS@ +GST_OBJ_LIBS = @GST_OBJ_LIBS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PKG_CONFIG_PATH = @GST_PKG_CONFIG_PATH@ +GST_PLUGINS_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@ +GST_PLUGINS_BAD_DIR = @GST_PLUGINS_BAD_DIR@ +GST_PLUGINS_BAD_LIBS = @GST_PLUGINS_BAD_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@ +GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@ +GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ +HAVE_DVIPS = @HAVE_DVIPS@ +HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ +HAVE_JADETEX = @HAVE_JADETEX@ +HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ +HAVE_PNMTOPS = @HAVE_PNMTOPS@ +HAVE_PS2PDF = @HAVE_PS2PDF@ +HAVE_XMLLINT = @HAVE_XMLLINT@ +HAVE_XSLTPROC = @HAVE_XSLTPROC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCGROUP_CFLAGS = @LIBCGROUP_CFLAGS@ +LIBCGROUP_LIBS = @LIBCGROUP_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XML_CATALOG = @XML_CATALOG@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +#INCLUDES = -I$(top_srcdir) -I$(srcdir) +AM_CFLAGS = $(GST_OBJ_CFLAGS) +LDADD = $(GST_OBJ_LIBS) $(GIO_LIBS) $(am__append_2) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +test-appsrc$(EXEEXT): $(test_appsrc_OBJECTS) $(test_appsrc_DEPENDENCIES) $(EXTRA_test_appsrc_DEPENDENCIES) + @rm -f test-appsrc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_appsrc_OBJECTS) $(test_appsrc_LDADD) $(LIBS) + +test-auth$(EXEEXT): $(test_auth_OBJECTS) $(test_auth_DEPENDENCIES) $(EXTRA_test_auth_DEPENDENCIES) + @rm -f test-auth$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_auth_OBJECTS) $(test_auth_LDADD) $(LIBS) + +test-cgroups$(EXEEXT): $(test_cgroups_OBJECTS) $(test_cgroups_DEPENDENCIES) $(EXTRA_test_cgroups_DEPENDENCIES) + @rm -f test-cgroups$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_cgroups_OBJECTS) $(test_cgroups_LDADD) $(LIBS) + +test-launch$(EXEEXT): $(test_launch_OBJECTS) $(test_launch_DEPENDENCIES) $(EXTRA_test_launch_DEPENDENCIES) + @rm -f test-launch$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_launch_OBJECTS) $(test_launch_LDADD) $(LIBS) + +test-mp4$(EXEEXT): $(test_mp4_OBJECTS) $(test_mp4_DEPENDENCIES) $(EXTRA_test_mp4_DEPENDENCIES) + @rm -f test-mp4$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_mp4_OBJECTS) $(test_mp4_LDADD) $(LIBS) + +test-multicast$(EXEEXT): $(test_multicast_OBJECTS) $(test_multicast_DEPENDENCIES) $(EXTRA_test_multicast_DEPENDENCIES) + @rm -f test-multicast$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_multicast_OBJECTS) $(test_multicast_LDADD) $(LIBS) + +test-multicast2$(EXEEXT): $(test_multicast2_OBJECTS) $(test_multicast2_DEPENDENCIES) $(EXTRA_test_multicast2_DEPENDENCIES) + @rm -f test-multicast2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_multicast2_OBJECTS) $(test_multicast2_LDADD) $(LIBS) + +test-ogg$(EXEEXT): $(test_ogg_OBJECTS) $(test_ogg_DEPENDENCIES) $(EXTRA_test_ogg_DEPENDENCIES) + @rm -f test-ogg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_ogg_OBJECTS) $(test_ogg_LDADD) $(LIBS) + +test-readme$(EXEEXT): $(test_readme_OBJECTS) $(test_readme_DEPENDENCIES) $(EXTRA_test_readme_DEPENDENCIES) + @rm -f test-readme$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_readme_OBJECTS) $(test_readme_LDADD) $(LIBS) + +test-sdp$(EXEEXT): $(test_sdp_OBJECTS) $(test_sdp_DEPENDENCIES) $(EXTRA_test_sdp_DEPENDENCIES) + @rm -f test-sdp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sdp_OBJECTS) $(test_sdp_LDADD) $(LIBS) + +test-uri$(EXEEXT): $(test_uri_OBJECTS) $(test_uri_DEPENDENCIES) $(EXTRA_test_uri_DEPENDENCIES) + @rm -f test-uri$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_uri_OBJECTS) $(test_uri_LDADD) $(LIBS) + +test-video$(EXEEXT): $(test_video_OBJECTS) $(test_video_DEPENDENCIES) $(EXTRA_test_video_DEPENDENCIES) + @rm -f test-video$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_video_OBJECTS) $(test_video_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-appsrc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-auth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cgroups.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-launch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mp4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-multicast.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-multicast2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ogg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-readme.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-uri.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-video.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(PROGRAMS) +installdirs: +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +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: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ + ctags-am 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am 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 tags-am uninstall uninstall-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: diff --git a/examples/test-appsrc.c b/examples/test-appsrc.c new file mode 100644 index 0000000..9d271ea --- /dev/null +++ b/examples/test-appsrc.c @@ -0,0 +1,137 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +typedef struct +{ + gboolean white; + GstClockTime timestamp; +} MyContext; + +/* called when we need to give data to appsrc */ +static void +need_data (GstElement * appsrc, guint unused, MyContext * ctx) +{ + GstBuffer *buffer; + guint size; + GstFlowReturn ret; + + size = 385 * 288 * 2; + + buffer = gst_buffer_new_allocate (NULL, size, NULL); + + /* this makes the image black/white */ + gst_buffer_memset (buffer, 0, ctx->white ? 0xff : 0x0, size); + + ctx->white = !ctx->white; + + /* increment the timestamp every 1/2 second */ + GST_BUFFER_PTS (buffer) = ctx->timestamp; + GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale_int (1, GST_SECOND, 2); + ctx->timestamp += GST_BUFFER_DURATION (buffer); + + g_signal_emit_by_name (appsrc, "push-buffer", buffer, &ret); +} + +/* called when a new media pipeline is constructed. We can query the + * pipeline and configure our appsrc */ +static void +media_configure (GstRTSPMediaFactory * factory, GstRTSPMedia * media, + gpointer user_data) +{ + GstElement *element, *appsrc; + MyContext *ctx; + + /* get the element used for providing the streams of the media */ + element = gst_rtsp_media_get_element (media); + + /* get our appsrc, we named it 'mysrc' with the name property */ + appsrc = gst_bin_get_by_name_recurse_up (GST_BIN (element), "mysrc"); + + /* this instructs appsrc that we will be dealing with timed buffer */ + gst_util_set_object_arg (G_OBJECT (appsrc), "format", "time"); + /* configure the caps of the video */ + g_object_set (G_OBJECT (appsrc), "caps", + gst_caps_new_simple ("video/x-raw", + "format", G_TYPE_STRING, "RGB16", + "width", G_TYPE_INT, 384, + "height", G_TYPE_INT, 288, + "framerate", GST_TYPE_FRACTION, 0, 1, NULL), NULL); + + ctx = g_new0 (MyContext, 1); + ctx->white = FALSE; + ctx->timestamp = 0; + /* make sure ther datais freed when the media is gone */ + g_object_set_data_full (G_OBJECT (media), "my-extra-data", ctx, + (GDestroyNotify) g_free); + + /* install the callback that will be called when a buffer is needed */ + g_signal_connect (appsrc, "need-data", (GCallback) need_data, ctx); +} + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; + + gst_init (&argc, &argv); + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* get the mount points for this server, every server has a default object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + /* make a media factory for a test stream. The default media factory can use + * gst-launch syntax to create pipelines. + * any launch line works as long as it contains elements named pay%d. Each + * element with pay%d names will be a stream */ + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, + "( appsrc name=mysrc ! videoconvert ! x264enc ! rtph264pay name=pay0 pt=96 )"); + + /* notify when our media is ready, This is called whenever someone asks for + * the media and a new pipeline with our appsrc is created */ + g_signal_connect (factory, "media-configure", (GCallback) media_configure, + NULL); + + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + /* don't need the ref to the mounts anymore */ + g_object_unref (mounts); + + /* attach the server to the default maincontext */ + gst_rtsp_server_attach (server, NULL); + + /* start serving */ + g_print ("stream ready at rtsp://127.0.0.1:8554/test\n"); + g_main_loop_run (loop); + + return 0; +} diff --git a/examples/test-auth.c b/examples/test-auth.c new file mode 100644 index 0000000..eff3c74 --- /dev/null +++ b/examples/test-auth.c @@ -0,0 +1,186 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +static gboolean +remove_func (GstRTSPSessionPool * pool, GstRTSPSession * session, + GstRTSPServer * server) +{ + return GST_RTSP_FILTER_REMOVE; +} + +static gboolean +remove_sessions (GstRTSPServer * server) +{ + GstRTSPSessionPool *pool; + + g_print ("removing all sessions\n"); + pool = gst_rtsp_server_get_session_pool (server); + gst_rtsp_session_pool_filter (pool, + (GstRTSPSessionPoolFilterFunc) remove_func, server); + g_object_unref (pool); + + return FALSE; +} + +static gboolean +timeout (GstRTSPServer * server) +{ + GstRTSPSessionPool *pool; + + pool = gst_rtsp_server_get_session_pool (server); + gst_rtsp_session_pool_cleanup (pool); + g_object_unref (pool); + + return TRUE; +} + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; + GstRTSPAuth *auth; + GstRTSPToken *token; + gchar *basic; + + gst_init (&argc, &argv); + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* get the mounts for this server, every server has a default mapper object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + + /* make a media factory for a test stream. The default media factory can use + * gst-launch syntax to create pipelines. + * any launch line works as long as it contains elements named pay%d. Each + * element with pay%d names will be a stream */ + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, "( " + "videotestsrc ! video/x-raw,width=352,height=288,framerate=15/1 ! " + "x264enc ! rtph264pay name=pay0 pt=96 " + "audiotestsrc ! audio/x-raw,rate=8000 ! " + "alawenc ! rtppcmapay name=pay1 pt=97 " ")"); + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + /* allow user and admin to access this resource */ + gst_rtsp_media_factory_add_role (factory, "user", + GST_RTSP_PERM_MEDIA_FACTORY_ACCESS, G_TYPE_BOOLEAN, TRUE, + GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT, G_TYPE_BOOLEAN, TRUE, NULL); + gst_rtsp_media_factory_add_role (factory, "admin", + GST_RTSP_PERM_MEDIA_FACTORY_ACCESS, G_TYPE_BOOLEAN, TRUE, + GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT, G_TYPE_BOOLEAN, TRUE, NULL); + /* admin2 can look at the media but not construct so he gets a + * 401 Unauthorized */ + gst_rtsp_media_factory_add_role (factory, "admin2", + GST_RTSP_PERM_MEDIA_FACTORY_ACCESS, G_TYPE_BOOLEAN, TRUE, + GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT, G_TYPE_BOOLEAN, FALSE, NULL); + + /* make another factory */ + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, "( " + "videotestsrc ! video/x-raw,width=352,height=288,framerate=30/1 ! " + "x264enc ! rtph264pay name=pay0 pt=96 )"); + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test2", factory); + + /* allow admin2 to access this resource */ + /* user and admin have no permissions so they can't even see the + * media and get a 404 Not Found */ + gst_rtsp_media_factory_add_role (factory, "admin2", + GST_RTSP_PERM_MEDIA_FACTORY_ACCESS, G_TYPE_BOOLEAN, TRUE, + GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT, G_TYPE_BOOLEAN, TRUE, NULL); + + /* don't need the ref to the mapper anymore */ + g_object_unref (mounts); + + /* make a new authentication manager */ + auth = gst_rtsp_auth_new (); + + /* make default token, it has the same permissions as admin2 */ + token = + gst_rtsp_token_new (GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, G_TYPE_STRING, + "admin2", NULL); + gst_rtsp_auth_set_default_token (auth, token); + gst_rtsp_token_unref (token); + + /* make user token */ + token = + gst_rtsp_token_new (GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, G_TYPE_STRING, + "user", NULL); + basic = gst_rtsp_auth_make_basic ("user", "password"); + gst_rtsp_auth_add_basic (auth, basic, token); + g_free (basic); + gst_rtsp_token_unref (token); + + /* make admin token */ + token = + gst_rtsp_token_new (GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, G_TYPE_STRING, + "admin", NULL); + basic = gst_rtsp_auth_make_basic ("admin", "power"); + gst_rtsp_auth_add_basic (auth, basic, token); + g_free (basic); + gst_rtsp_token_unref (token); + + /* make admin2 token */ + token = + gst_rtsp_token_new (GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, G_TYPE_STRING, + "admin2", NULL); + basic = gst_rtsp_auth_make_basic ("admin2", "power2"); + gst_rtsp_auth_add_basic (auth, basic, token); + g_free (basic); + gst_rtsp_token_unref (token); + + /* set as the server authentication manager */ + gst_rtsp_server_set_auth (server, auth); + g_object_unref (auth); + + /* attach the server to the default maincontext */ + if (gst_rtsp_server_attach (server, NULL) == 0) + goto failed; + + g_timeout_add_seconds (2, (GSourceFunc) timeout, server); + g_timeout_add_seconds (10, (GSourceFunc) remove_sessions, server); + + /* start serving */ + g_print ("stream with user:password ready at rtsp://127.0.0.1:8554/test\n"); + g_print ("stream with admin:power ready at rtsp://127.0.0.1:8554/test\n"); + g_print ("stream with admin2:power2 ready at rtsp://127.0.0.1:8554/test2\n"); + g_main_loop_run (loop); + + return 0; + + /* ERRORS */ +failed: + { + g_print ("failed to attach the server\n"); + return -1; + } +} diff --git a/examples/test-cgroups.c b/examples/test-cgroups.c new file mode 100644 index 0000000..600fa3c --- /dev/null +++ b/examples/test-cgroups.c @@ -0,0 +1,276 @@ +/* GStreamer + * Copyright (C) 2013 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +/* Runs a pipeline and clasifies the media pipelines based on the + * authenticated user. + * + * This test requires 2 cpu cgroups to exist named 'user' and 'admin'. + * The rtsp server should have permission to add its threads to the + * cgroups. + * + * sudo cgcreate -t uid:gid -g cpu:/user + * sudo cgcreate -t uid:gid -g cpu:/admin + * + * With -t you can give the user and group access to the task file to + * write the thread ids. The user running the server can be used. + * + * Then you would want to change the cpu shares assigned to each group: + * + * sudo cgset -r cpu.shares=100 user + * sudo cgset -r cpu.shares=1024 admin + * + * Then start clients for 'user' until the stream is degraded because of + * lack of CPU. Then start a client for 'admin' and check that the stream + * is not degraded. + */ + +#include + +#include +#include + +typedef struct _GstRTSPCGroupPool GstRTSPCGroupPool; +typedef struct _GstRTSPCGroupPoolClass GstRTSPCGroupPoolClass; + +#define GST_TYPE_RTSP_CGROUP_POOL (gst_rtsp_cgroup_pool_get_type ()) +#define GST_IS_RTSP_CGROUP_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_CGROUP_POOL)) +#define GST_IS_RTSP_CGROUP_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_CGROUP_POOL)) +#define GST_RTSP_CGROUP_POOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_CGROUP_POOL, GstRTSPCGroupPoolClass)) +#define GST_RTSP_CGROUP_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_CGROUP_POOL, GstRTSPCGroupPool)) +#define GST_RTSP_CGROUP_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_CGROUP_POOL, GstRTSPCGroupPoolClass)) +#define GST_RTSP_CGROUP_POOL_CAST(obj) ((GstRTSPCGroupPool*)(obj)) +#define GST_RTSP_CGROUP_POOL_CLASS_CAST(klass) ((GstRTSPCGroupPoolClass*)(klass)) + +struct _GstRTSPCGroupPool +{ + GstRTSPThreadPool parent; + + struct cgroup *user; + struct cgroup *admin; +}; + +struct _GstRTSPCGroupPoolClass +{ + GstRTSPThreadPoolClass parent_class; +}; + +static GQuark thread_cgroup; + +static void gst_rtsp_cgroup_pool_finalize (GObject * obj); + +static void default_thread_enter (GstRTSPThreadPool * pool, + GstRTSPThread * thread); +static void default_configure_thread (GstRTSPThreadPool * pool, + GstRTSPThread * thread, GstRTSPContext * ctx); + +static GType gst_rtsp_cgroup_pool_get_type (void); + +G_DEFINE_TYPE (GstRTSPCGroupPool, gst_rtsp_cgroup_pool, + GST_TYPE_RTSP_THREAD_POOL); + +static void +gst_rtsp_cgroup_pool_class_init (GstRTSPCGroupPoolClass * klass) +{ + GObjectClass *gobject_class; + GstRTSPThreadPoolClass *tpool_class; + + gobject_class = G_OBJECT_CLASS (klass); + tpool_class = GST_RTSP_THREAD_POOL_CLASS (klass); + + gobject_class->finalize = gst_rtsp_cgroup_pool_finalize; + + tpool_class->configure_thread = default_configure_thread; + tpool_class->thread_enter = default_thread_enter; + + thread_cgroup = g_quark_from_string ("cgroup.pool.thread.cgroup"); + + cgroup_init (); +} + +static void +gst_rtsp_cgroup_pool_init (GstRTSPCGroupPool * pool) +{ + pool->user = cgroup_new_cgroup ("user"); + if (cgroup_add_controller (pool->user, "cpu") == NULL) + g_error ("Failed to add cpu controller to user cgroup"); + pool->admin = cgroup_new_cgroup ("admin"); + if (cgroup_add_controller (pool->admin, "cpu") == NULL) + g_error ("Failed to add cpu controller to admin cgroup"); +} + +static void +gst_rtsp_cgroup_pool_finalize (GObject * obj) +{ + GstRTSPCGroupPool *pool = GST_RTSP_CGROUP_POOL (obj); + + GST_INFO ("finalize pool %p", pool); + + cgroup_free (&pool->user); + cgroup_free (&pool->admin); + + G_OBJECT_CLASS (gst_rtsp_cgroup_pool_parent_class)->finalize (obj); +} + +static void +default_thread_enter (GstRTSPThreadPool * pool, GstRTSPThread * thread) +{ + struct cgroup *cgroup; + + cgroup = gst_mini_object_get_qdata (GST_MINI_OBJECT (thread), thread_cgroup); + if (cgroup) { + gint res = 0; + + res = cgroup_attach_task (cgroup); + + if (res != 0) + GST_ERROR ("error: %d (%s)", res, cgroup_strerror (res)); + } +} + +static void +default_configure_thread (GstRTSPThreadPool * pool, + GstRTSPThread * thread, GstRTSPContext * ctx) +{ + GstRTSPCGroupPool *cpool = GST_RTSP_CGROUP_POOL (pool); + const gchar *cls; + struct cgroup *cgroup; + + if (ctx->token) + cls = gst_rtsp_token_get_string (ctx->token, "cgroup.pool.media.class"); + else + cls = NULL; + + GST_DEBUG ("manage cgroup %s", cls); + + if (!g_strcmp0 (cls, "admin")) + cgroup = cpool->admin; + else + cgroup = cpool->user; + + /* attach the cgroup to the thread */ + gst_mini_object_set_qdata (GST_MINI_OBJECT (thread), thread_cgroup, + cgroup, NULL); +} + +static gboolean +timeout (GstRTSPServer * server) +{ + GstRTSPSessionPool *pool; + + pool = gst_rtsp_server_get_session_pool (server); + gst_rtsp_session_pool_cleanup (pool); + g_object_unref (pool); + + return TRUE; +} + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; + GstRTSPAuth *auth; + GstRTSPToken *token; + gchar *basic; + GstRTSPThreadPool *thread_pool; + + gst_init (&argc, &argv); + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* get the mounts for this server, every server has a default mapper object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + /* make a media factory for a test stream. The default media factory can use + * gst-launch syntax to create pipelines. + * any launch line works as long as it contains elements named pay%d. Each + * element with pay%d names will be a stream */ + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, "( " + "videotestsrc ! video/x-raw,width=640,height=480,framerate=50/1 ! " + "x264enc ! rtph264pay name=pay0 pt=96 " + "audiotestsrc ! audio/x-raw,rate=8000 ! " + "alawenc ! rtppcmapay name=pay1 pt=97 " ")"); + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + /* allow user and admin to access this resource */ + gst_rtsp_media_factory_add_role (factory, "user", + "media.factory.access", G_TYPE_BOOLEAN, TRUE, + "media.factory.construct", G_TYPE_BOOLEAN, TRUE, NULL); + gst_rtsp_media_factory_add_role (factory, "admin", + "media.factory.access", G_TYPE_BOOLEAN, TRUE, + "media.factory.construct", G_TYPE_BOOLEAN, TRUE, NULL); + + /* don't need the ref to the mapper anymore */ + g_object_unref (mounts); + + /* make a new authentication manager */ + auth = gst_rtsp_auth_new (); + + /* make user token */ + token = gst_rtsp_token_new ("cgroup.pool.media.class", G_TYPE_STRING, "user", + "media.factory.role", G_TYPE_STRING, "user", NULL); + basic = gst_rtsp_auth_make_basic ("user", "password"); + gst_rtsp_auth_add_basic (auth, basic, token); + g_free (basic); + gst_rtsp_token_unref (token); + + /* make admin token */ + token = gst_rtsp_token_new ("cgroup.pool.media.class", G_TYPE_STRING, "admin", + "media.factory.role", G_TYPE_STRING, "admin", NULL); + basic = gst_rtsp_auth_make_basic ("admin", "power"); + gst_rtsp_auth_add_basic (auth, basic, token); + g_free (basic); + gst_rtsp_token_unref (token); + + /* set as the server authentication manager */ + gst_rtsp_server_set_auth (server, auth); + g_object_unref (auth); + + thread_pool = g_object_new (GST_TYPE_RTSP_CGROUP_POOL, NULL); + gst_rtsp_server_set_thread_pool (server, thread_pool); + g_object_unref (thread_pool); + + /* attach the server to the default maincontext */ + if (gst_rtsp_server_attach (server, NULL) == 0) + goto failed; + + g_timeout_add_seconds (2, (GSourceFunc) timeout, server); + + /* start serving */ + g_print ("stream with user:password ready at rtsp://127.0.0.1:8554/test\n"); + g_print ("stream with admin:power ready at rtsp://127.0.0.1:8554/test\n"); + g_main_loop_run (loop); + + return 0; + + /* ERRORS */ +failed: + { + g_print ("failed to attach the server\n"); + return -1; + } +} diff --git a/examples/test-launch.c b/examples/test-launch.c new file mode 100644 index 0000000..0466224 --- /dev/null +++ b/examples/test-launch.c @@ -0,0 +1,71 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; + + gst_init (&argc, &argv); + + if (argc < 2) { + g_print ("usage: %s \n" + "example: %s \"( videotestsrc ! x264enc ! rtph264pay name=pay0 pt=96 )\"\n", + argv[0], argv[0]); + return -1; + } + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* get the mount points for this server, every server has a default object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + /* make a media factory for a test stream. The default media factory can use + * gst-launch syntax to create pipelines. + * any launch line works as long as it contains elements named pay%d. Each + * element with pay%d names will be a stream */ + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, argv[1]); + + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + /* don't need the ref to the mapper anymore */ + g_object_unref (mounts); + + /* attach the server to the default maincontext */ + gst_rtsp_server_attach (server, NULL); + + /* start serving */ + g_print ("stream ready at rtsp://127.0.0.1:8554/test\n"); + g_main_loop_run (loop); + + return 0; +} diff --git a/examples/test-mp4.c b/examples/test-mp4.c new file mode 100644 index 0000000..52e082d --- /dev/null +++ b/examples/test-mp4.c @@ -0,0 +1,76 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; + gchar *str; + + gst_init (&argc, &argv); + + if (argc < 2) { + g_message ("usage: %s ", argv[0]); + return -1; + } + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* get the mount points for this server, every server has a default object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + str = g_strdup_printf ("( " + "filesrc location=%s ! qtdemux name=d " + "d. ! queue ! rtph264pay pt=96 name=pay0 " + "d. ! queue ! rtpmp4apay pt=97 name=pay1 " ")", argv[1]); + + /* make a media factory for a test stream. The default media factory can use + * gst-launch syntax to create pipelines. + * any launch line works as long as it contains elements named pay%d. Each + * element with pay%d names will be a stream */ + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, str); + g_free (str); + + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + /* don't need the ref to the mapper anymore */ + g_object_unref (mounts); + + /* attach the server to the default maincontext */ + gst_rtsp_server_attach (server, NULL); + + /* start serving */ + g_print ("stream ready at rtsp://127.0.0.1:8554/test\n"); + g_main_loop_run (loop); + + return 0; +} diff --git a/examples/test-multicast.c b/examples/test-multicast.c new file mode 100644 index 0000000..c7d55fc --- /dev/null +++ b/examples/test-multicast.c @@ -0,0 +1,104 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + + +static gboolean +timeout (GstRTSPServer * server, gboolean ignored) +{ + GstRTSPSessionPool *pool; + + pool = gst_rtsp_server_get_session_pool (server); + gst_rtsp_session_pool_cleanup (pool); + g_object_unref (pool); + + return TRUE; +} + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; + GstRTSPAddressPool *pool; + + gst_init (&argc, &argv); + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* get the mount points for this server, every server has a default object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + /* make a media factory for a test stream. The default media factory can use + * gst-launch syntax to create pipelines. + * any launch line works as long as it contains elements named pay%d. Each + * element with pay%d names will be a stream */ + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, "( " + "videotestsrc ! video/x-raw,width=352,height=288,framerate=15/1 ! " + "x264enc ! rtph264pay name=pay0 pt=96 " + "audiotestsrc ! audio/x-raw,rate=8000 ! " + "alawenc ! rtppcmapay name=pay1 pt=97 " ")"); + + gst_rtsp_media_factory_set_shared (factory, TRUE); + + /* make a new address pool */ + pool = gst_rtsp_address_pool_new (); + gst_rtsp_address_pool_add_range (pool, + "224.3.0.0", "224.3.0.10", 5000, 5010, 16); + gst_rtsp_media_factory_set_address_pool (factory, pool); + /* only allow multicast */ + gst_rtsp_media_factory_set_protocols (factory, + GST_RTSP_LOWER_TRANS_UDP_MCAST); + g_object_unref (pool); + + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + /* don't need the ref to the mapper anymore */ + g_object_unref (mounts); + + /* attach the server to the default maincontext */ + if (gst_rtsp_server_attach (server, NULL) == 0) + goto failed; + + g_timeout_add_seconds (2, (GSourceFunc) timeout, server); + + /* start serving */ + g_print ("stream ready at rtsp://127.0.0.1:8554/test\n"); + g_main_loop_run (loop); + + return 0; + + /* ERRORS */ +failed: + { + g_print ("failed to attach the server\n"); + return -1; + } +} diff --git a/examples/test-multicast2.c b/examples/test-multicast2.c new file mode 100644 index 0000000..1d8e6f2 --- /dev/null +++ b/examples/test-multicast2.c @@ -0,0 +1,125 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + + +static gboolean +timeout (GstRTSPServer * server, gboolean ignored) +{ + GstRTSPSessionPool *pool; + + pool = gst_rtsp_server_get_session_pool (server); + gst_rtsp_session_pool_cleanup (pool); + g_object_unref (pool); + + return TRUE; +} + +static void +media_constructed (GstRTSPMediaFactory * factory, GstRTSPMedia * media) +{ + guint i, n_streams; + + n_streams = gst_rtsp_media_n_streams (media); + + for (i = 0; i < n_streams; i++) { + GstRTSPAddressPool *pool; + GstRTSPStream *stream; + gchar *min, *max; + + stream = gst_rtsp_media_get_stream (media, i); + + /* make a new address pool */ + pool = gst_rtsp_address_pool_new (); + + min = g_strdup_printf ("224.3.0.%d", (2 * i) + 1); + max = g_strdup_printf ("224.3.0.%d", (2 * i) + 2); + gst_rtsp_address_pool_add_range (pool, min, max, + 5000 + (10 * i), 5010 + (10 * i), 1); + g_free (min); + g_free (max); + + gst_rtsp_stream_set_address_pool (stream, pool); + g_object_unref (pool); + } +} + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; + + gst_init (&argc, &argv); + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* get the mount points for this server, every server has a default object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + /* make a media factory for a test stream. The default media factory can use + * gst-launch syntax to create pipelines. + * any launch line works as long as it contains elements named pay%d. Each + * element with pay%d names will be a stream */ + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, "( " + "videotestsrc ! video/x-raw,width=352,height=288,framerate=15/1 ! " + "x264enc ! rtph264pay name=pay0 pt=96 " + "audiotestsrc ! audio/x-raw,rate=8000 ! " + "alawenc ! rtppcmapay name=pay1 pt=97 " ")"); + + gst_rtsp_media_factory_set_shared (factory, TRUE); + + g_signal_connect (factory, "media-constructed", (GCallback) + media_constructed, NULL); + + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + /* don't need the ref to the mapper anymore */ + g_object_unref (mounts); + + /* attach the server to the default maincontext */ + if (gst_rtsp_server_attach (server, NULL) == 0) + goto failed; + + g_timeout_add_seconds (2, (GSourceFunc) timeout, server); + + /* start serving */ + g_print ("stream ready at rtsp://127.0.0.1:8554/test\n"); + g_main_loop_run (loop); + + return 0; + + /* ERRORS */ +failed: + { + g_print ("failed to attach the server\n"); + return -1; + } +} diff --git a/examples/test-ogg.c b/examples/test-ogg.c new file mode 100644 index 0000000..f4d104c --- /dev/null +++ b/examples/test-ogg.c @@ -0,0 +1,76 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; + gchar *str; + + gst_init (&argc, &argv); + + if (argc < 2) { + g_message ("usage: %s ", argv[0]); + return -1; + } + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* get the mount points for this server, every server has a default object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + str = g_strdup_printf ("( " + "filesrc location=%s ! oggdemux name=d " + "d. ! queue ! rtptheorapay name=pay0 pt=96 " + "d. ! queue ! rtpvorbispay name=pay1 pt=97 " ")", argv[1]); + + /* make a media factory for a test stream. The default media factory can use + * gst-launch syntax to create pipelines. + * any launch line works as long as it contains elements named pay%d. Each + * element with pay%d names will be a stream */ + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, str); + g_free (str); + + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + /* don't need the ref to the mapper anymore */ + g_object_unref (mounts); + + /* attach the server to the default maincontext */ + gst_rtsp_server_attach (server, NULL); + + /* start serving */ + g_print ("stream ready at rtsp://127.0.0.1:8554/test\n"); + g_main_loop_run (loop); + + return 0; +} diff --git a/examples/test-readme.c b/examples/test-readme.c new file mode 100644 index 0000000..2e2caa6 --- /dev/null +++ b/examples/test-readme.c @@ -0,0 +1,67 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; + + gst_init (&argc, &argv); + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* get the mount points for this server, every server has a default object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + /* make a media factory for a test stream. The default media factory can use + * gst-launch syntax to create pipelines. + * any launch line works as long as it contains elements named pay%d. Each + * element with pay%d names will be a stream */ + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc is-live=1 ! x264enc ! rtph264pay name=pay0 pt=96 )"); + + gst_rtsp_media_factory_set_shared (factory, TRUE); + + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + /* don't need the ref to the mapper anymore */ + g_object_unref (mounts); + + /* attach the server to the default maincontext */ + gst_rtsp_server_attach (server, NULL); + + /* start serving */ + g_print ("stream ready at rtsp://127.0.0.1:8554/test\n"); + g_main_loop_run (loop); + + return 0; +} diff --git a/examples/test-sdp.c b/examples/test-sdp.c new file mode 100644 index 0000000..98efe9e --- /dev/null +++ b/examples/test-sdp.c @@ -0,0 +1,98 @@ +/* GStreamer + * Copyright (C) 2009 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + + +static gboolean +timeout (GstRTSPServer * server, gboolean ignored) +{ + GstRTSPSessionPool *pool; + + pool = gst_rtsp_server_get_session_pool (server); + gst_rtsp_session_pool_cleanup (pool); + g_object_unref (pool); + + return TRUE; +} + +static void +media_configure (GstRTSPMediaFactory * factory, GstRTSPMedia * media) +{ + gst_rtsp_media_set_reusable (media, TRUE); +} + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; + gchar *str; + + gst_init (&argc, &argv); + + if (argc < 2) { + g_message ("usage: %s ", argv[0]); + return -1; + } + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* get the mount points for this server, every server has a default object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + /* make a media factory for a test stream. The default media factory can use + * gst-launch syntax to create pipelines. + * any launch line works as long as it contains elements named pay%d. Each + * element with pay%d names will be a stream */ + factory = gst_rtsp_media_factory_new (); + + str = + g_strdup_printf ("( filesrc location=%s ! sdpdemux name=dynpay0 )", + argv[1]); + gst_rtsp_media_factory_set_launch (factory, str); + gst_rtsp_media_factory_set_shared (factory, TRUE); + g_signal_connect (factory, "media-configure", (GCallback) media_configure, + NULL); + g_free (str); + + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + /* don't need the ref to the mapper anymore */ + g_object_unref (mounts); + + /* attach the server to the default maincontext */ + gst_rtsp_server_attach (server, NULL); + + g_timeout_add_seconds (2, (GSourceFunc) timeout, server); + + /* start serving */ + g_main_loop_run (loop); + + return 0; +} diff --git a/examples/test-uri.c b/examples/test-uri.c new file mode 100644 index 0000000..b0daebc --- /dev/null +++ b/examples/test-uri.c @@ -0,0 +1,114 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include +#include + + +static gboolean +timeout (GstRTSPServer * server) +{ + GstRTSPSessionPool *pool; + + pool = gst_rtsp_server_get_session_pool (server); + gst_rtsp_session_pool_cleanup (pool); + g_object_unref (pool); + + return TRUE; +} + +static gboolean +remove_map (GstRTSPServer * server) +{ + GstRTSPMountPoints *mounts; + + g_print ("removing /test mount point\n"); + mounts = gst_rtsp_server_get_mount_points (server); + gst_rtsp_mount_points_remove_factory (mounts, "/test"); + g_object_unref (mounts); + + return FALSE; +} + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactoryURI *factory; + + gst_init (&argc, &argv); + + if (argc < 2) { + g_message ("usage: %s ", argv[0]); + return -1; + } + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* get the mount points for this server, every server has a default object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + /* make a URI media factory for a test stream. */ + factory = gst_rtsp_media_factory_uri_new (); + /* when using GStreamer as a client, one can use the gst payloader, which is + * more efficient when there is no payloader for the compressed format */ + /* g_object_set (factory, "use-gstpay", TRUE, NULL); */ + gst_rtsp_media_factory_uri_set_uri (factory, argv[1]); + /* if you want multiple clients to see the same video, set the shared property + * to TRUE */ + /* gst_rtsp_media_factory_set_shared ( GST_RTSP_MEDIA_FACTORY (factory), TRUE); */ + + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", + GST_RTSP_MEDIA_FACTORY (factory)); + + /* don't need the ref to the mapper anymore */ + g_object_unref (mounts); + + /* attach the server to the default maincontext */ + if (gst_rtsp_server_attach (server, NULL) == 0) + goto failed; + + /* do session cleanup every 2 seconds */ + g_timeout_add_seconds (2, (GSourceFunc) timeout, server); + /* remove the mount point after 10 seconds, new clients won't be able to use the + * /test url anymore */ + g_timeout_add_seconds (10, (GSourceFunc) remove_map, server); + + /* start serving */ + g_print ("stream ready at rtsp://127.0.0.1:8554/test\n"); + g_main_loop_run (loop); + + return 0; + + /* ERRORS */ +failed: + { + g_print ("failed to attach the server\n"); + return -1; + } +} diff --git a/examples/test-video.c b/examples/test-video.c new file mode 100644 index 0000000..0d4a3a5 --- /dev/null +++ b/examples/test-video.c @@ -0,0 +1,177 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +/* define this if you want the resource to only be available when using + * user/password as the password */ +#undef WITH_AUTH + +/* define this if you want the server to use TLS (it will also need WITH_AUTH + * to be defined) */ +#undef WITH_TLS + +/* this timeout is periodically run to clean up the expired sessions from the + * pool. This needs to be run explicitly currently but might be done + * automatically as part of the mainloop. */ +static gboolean +timeout (GstRTSPServer * server, gboolean ignored) +{ + GstRTSPSessionPool *pool; + + pool = gst_rtsp_server_get_session_pool (server); + gst_rtsp_session_pool_cleanup (pool); + g_object_unref (pool); + + return TRUE; +} + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; +#ifdef WITH_AUTH + GstRTSPAuth *auth; + GstRTSPToken *token; + gchar *basic; + GstRTSPPermissions *permissions; +#endif +#ifdef WITH_TLS + GTlsCertificate *cert; + GError *error = NULL; +#endif + + gst_init (&argc, &argv); + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + +#ifdef WITH_AUTH + /* make a new authentication manager. it can be added to control access to all + * the factories on the server or on individual factories. */ + auth = gst_rtsp_auth_new (); +#ifdef WITH_TLS + cert = g_tls_certificate_new_from_pem ("-----BEGIN CERTIFICATE-----" + "MIICJjCCAY+gAwIBAgIBBzANBgkqhkiG9w0BAQUFADCBhjETMBEGCgmSJomT8ixk" + "ARkWA0NPTTEXMBUGCgmSJomT8ixkARkWB0VYQU1QTEUxHjAcBgNVBAsTFUNlcnRp" + "ZmljYXRlIEF1dGhvcml0eTEXMBUGA1UEAxMOY2EuZXhhbXBsZS5jb20xHTAbBgkq" + "hkiG9w0BCQEWDmNhQGV4YW1wbGUuY29tMB4XDTExMDExNzE5NDcxN1oXDTIxMDEx" + "NDE5NDcxN1owSzETMBEGCgmSJomT8ixkARkWA0NPTTEXMBUGCgmSJomT8ixkARkW" + "B0VYQU1QTEUxGzAZBgNVBAMTEnNlcnZlci5leGFtcGxlLmNvbTBcMA0GCSqGSIb3" + "DQEBAQUAA0sAMEgCQQDYScTxk55XBmbDM9zzwO+grVySE4rudWuzH2PpObIonqbf" + "hRoAalKVluG9jvbHI81eXxCdSObv1KBP1sbN5RzpAgMBAAGjIjAgMAkGA1UdEwQC" + "MAAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDQYJKoZIhvcNAQEFBQADgYEAYx6fMqT1" + "Gvo0jq88E8mc+bmp4LfXD4wJ7KxYeadQxt75HFRpj4FhFO3DOpVRFgzHlOEo3Fwk" + "PZOKjvkT0cbcoEq5whLH25dHoQxGoVQgFyAP5s+7Vp5AlHh8Y/vAoXeEVyy/RCIH" + "QkhUlAflfDMcrrYjsmwoOPSjhx6Mm/AopX4=" + "-----END CERTIFICATE-----" + "-----BEGIN PRIVATE KEY-----" + "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEA2EnE8ZOeVwZmwzPc" + "88DvoK1ckhOK7nVrsx9j6TmyKJ6m34UaAGpSlZbhvY72xyPNXl8QnUjm79SgT9bG" + "zeUc6QIDAQABAkBRFJZ32VbqWMP9OVwDJLiwC01AlYLnka0mIQZbT/2xq9dUc9GW" + "U3kiVw4lL8v/+sPjtTPCYYdzHHOyDen6znVhAiEA9qJT7BtQvRxCvGrAhr9MS022" + "tTdPbW829BoUtIeH64cCIQDggG5i48v7HPacPBIH1RaSVhXl8qHCpQD3qrIw3FMw" + "DwIga8PqH5Sf5sHedy2+CiK0V4MRfoU4c3zQ6kArI+bEgSkCIQCLA1vXBiE31B5s" + "bdHoYa1BXebfZVd+1Hd95IfEM5mbRwIgSkDuQwV55BBlvWph3U8wVIMIb4GStaH8" + "W535W8UBbEg=" "-----END PRIVATE KEY-----", -1, &error); + if (cert == NULL) { + g_printerr ("failed to parse PEM: %s\n", error->message); + return -1; + } + gst_rtsp_auth_set_tls_certificate (auth, cert); + g_object_unref (cert); +#endif + + /* make user token */ + token = + gst_rtsp_token_new (GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, G_TYPE_STRING, + "user", NULL); + basic = gst_rtsp_auth_make_basic ("user", "password"); + gst_rtsp_auth_add_basic (auth, basic, token); + g_free (basic); + gst_rtsp_token_unref (token); + + /* configure in the server */ + gst_rtsp_server_set_auth (server, auth); +#endif + + /* get the mount points for this server, every server has a default object + * that be used to map uri mount points to media factories */ + mounts = gst_rtsp_server_get_mount_points (server); + + /* make a media factory for a test stream. The default media factory can use + * gst-launch syntax to create pipelines. + * any launch line works as long as it contains elements named pay%d. Each + * element with pay%d names will be a stream */ + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, "( " + "videotestsrc ! video/x-raw,width=352,height=288,framerate=15/1 ! " + "x264enc ! rtph264pay name=pay0 pt=96 " + "audiotestsrc ! audio/x-raw,rate=8000 ! " + "alawenc ! rtppcmapay name=pay1 pt=97 " ")"); +#ifdef WITH_AUTH + /* add permissions for the user media role */ + permissions = gst_rtsp_permissions_new (); + gst_rtsp_permissions_add_role (permissions, "user", + GST_RTSP_PERM_MEDIA_FACTORY_ACCESS, G_TYPE_BOOLEAN, TRUE, + GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT, G_TYPE_BOOLEAN, TRUE, NULL); + gst_rtsp_media_factory_set_permissions (factory, permissions); + gst_rtsp_permissions_unref (permissions); +#ifdef WITH_TLS + gst_rtsp_media_factory_set_profiles (factory, GST_RTSP_PROFILE_SAVP); +#endif +#endif + + /* attach the test factory to the /test url */ + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + /* don't need the ref to the mapper anymore */ + g_object_unref (mounts); + + /* attach the server to the default maincontext */ + if (gst_rtsp_server_attach (server, NULL) == 0) + goto failed; + + /* add a timeout for the session cleanup */ + g_timeout_add_seconds (2, (GSourceFunc) timeout, server); + + /* start serving, this never stops */ +#ifdef WITH_TLS + g_print ("stream ready at rtsps://127.0.0.1:8554/test\n"); +#else + g_print ("stream ready at rtsp://127.0.0.1:8554/test\n"); +#endif + g_main_loop_run (loop); + + return 0; + + /* ERRORS */ +failed: + { + g_print ("failed to attach the server\n"); + return -1; + } +} diff --git a/examples/test-wfd.c b/examples/test-wfd.c new file mode 100644 index 0000000..3d9782f --- /dev/null +++ b/examples/test-wfd.c @@ -0,0 +1,133 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include + +#include +#include + +#if 1 +#define VIDEO_PIPELINE "ximagesrc ! videorate ! videoscale ! videoconvert ! " \ + "video/x-raw,width=640,height=480,framerate=30/1 ! " \ + "x264enc aud=false byte-stream=true bitrate=512 ! video/x-h264,profile=baseline ! mpegtsmux wfd-mode=TRUE ! " \ + "rtpmp2tpay name=pay0 pt=33" +#define AUDIO_PIPELINE "pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! audioconvert ! " \ + "faac ! mpegtsmux wfd-mode=TRUE ! " \ + "rtpmp2tpay name=pay0 pt=33" +#else +#define VIDEO_PIPELINE "ximagesrc ! videoscale ! videoconvert ! " \ + "video/x-raw,width=640,height=480,framerate=60/1 ! " \ + "x264enc aud=false byte-stream=true bitrate=512 ! video/x-h264,profile=baseline ! mpegtsmux name=mux " \ + "pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! audioconvert ! " \ + "faac ! mux. mux. ! " \ + "rtpmp2tpay name=pay0 pt=33" +#if 0 +#define VIDEO_PIPELINE "ximagesrc startx=0 starty=0 endx=1919 endy=1079 ! videorate ! videoscale ! video/x-raw,width=1280,height=720,framerate=30/1 ! videoconvert ! " \ + "x264enc aud=false byte-stream=true bitrate=512 ! video/x-h264,profile=baseline ! mpegtsmux name=mux wfd-mode=TRUE " \ + "pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! audioconvert ! " \ + "faac ! mux. mux. ! " \ + "rtpmp2tpay name=pay0 pt=33" +#endif +/* +#define VIDEO_PIPELINE "ximagesrc do-timestamp=true ! videoscale ! video/x-raw,width=1280,height=720,framerate=30/1 ! videoconvert ! " \ + "x264enc aud=false byte-stream=true bitrate=512 ! video/x-h264,profile=baseline ! mpegtsmux name=mux wfd-mode=TRUE " \ + "pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor provide-clock=false ! audioconvert ! " \ + "faac ! mux. mux. ! " \ + "rtpmp2tpay name=pay0 pt=33" +*/ +#endif + +#define WFD_RTSP_PORT "2022" +#define TEST_MOUNT_POINT "/wfd1.0/streamid=0" + +GMainLoop *loop; + +static gboolean +teardown(gpointer data) +{ + GstRTSPWFDServer *server = NULL; + server = (GstRTSPWFDServer *) data; + + g_print("teardown\n"); + + if (server == NULL) return FALSE; + + gst_rtsp_wfd_server_trigger_request (GST_RTSP_SERVER(server), WFD_TRIGGER_TEARDOWN); + + return FALSE; +} + +int main (int argc, char *argv[]) +{ + GstRTSPWFDServer *server; + guint id; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactoryWFD *factory; + GMainContext *context = NULL; + GSource * signal_handler_src = NULL; + + gst_init (&argc, &argv); + + loop = g_main_loop_new (NULL, FALSE); + context = g_main_loop_get_context(loop); + + /* create a server instance */ + server = gst_rtsp_wfd_server_new (); + + gst_rtsp_server_set_address(GST_RTSP_SERVER(server), "192.168.3.100"); + //gst_rtsp_server_set_address(GST_RTSP_SERVER(server), "192.168.49.194"); + //gst_rtsp_server_set_address(GST_RTSP_SERVER(server), "192.168.49.20"); + gst_rtsp_server_set_service(GST_RTSP_SERVER(server), WFD_RTSP_PORT); + mounts = gst_rtsp_server_get_mount_points (GST_RTSP_SERVER(server)); + + factory = gst_rtsp_media_factory_wfd_new (); + + gst_rtsp_media_factory_set_launch (GST_RTSP_MEDIA_FACTORY(factory), + "( " VIDEO_PIPELINE " )"); + g_object_ref (factory); + gst_rtsp_mount_points_add_factory (mounts, TEST_MOUNT_POINT, GST_RTSP_MEDIA_FACTORY(factory)); + g_object_unref (mounts); + + /* attach the server to the default maincontext */ + if ((id = gst_rtsp_server_attach (GST_RTSP_SERVER_CAST(server), NULL)) == 0) + goto failed; + + signal_handler_src = (GSource *)g_unix_signal_source_new (SIGINT); + /* Set callback to be called when socket is readable */ + g_source_set_callback(signal_handler_src, teardown, server, NULL); + g_source_attach(signal_handler_src, context); + + /* start serving */ + g_main_loop_run (loop); + + /* cleanup */ + g_source_remove (id); + g_object_unref (server); + g_main_loop_unref (loop); + + return 0; + + /* ERRORS */ +failed: + { + g_print ("failed to attach the server\n"); + return -1; + } +} diff --git a/gst-rtsp-server.doap b/gst-rtsp-server.doap new file mode 100644 index 0000000..a549266 --- /dev/null +++ b/gst-rtsp-server.doap @@ -0,0 +1,120 @@ + + + GStreamer RTSP Server + gst-rtsp-server + + 1999-10-31 + +RTSP server library based on GStreamer + + +RTSP server library based on GStreamer + + + + + + C + + + + + + + + + + + + + 1.4.1 + 1.4 + + 2014-08-27 + + + + + + + 1.4.0 + 1.4 + + 2014-07-19 + + + + + + + 1.3.91 + 1.3 + + 2014-07-11 + + + + + + + 1.3.90 + 1.3 + + 2014-06-28 + + + + + + + 1.3.3 + 1.3 + + 2014-06-22 + + + + + + + 1.3.2 + 1.3 + + 2014-05-21 + + + + + + + 1.3.1 + 1.3 + + 2014-05-03 + + + + + + + 1.1.90 + 1.1 + + 2014-02-09 + + + + + + + Wim Taymans + 0d93fde052812d51a05fd86de9bdbf674423daa2 + + + + diff --git a/gst-rtsp-server.manifest b/gst-rtsp-server.manifest new file mode 100755 index 0000000..a76fdba --- /dev/null +++ b/gst-rtsp-server.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/gst/Makefile.am b/gst/Makefile.am new file mode 100644 index 0000000..e37bbc6 --- /dev/null +++ b/gst/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = rtsp-server diff --git a/gst/Makefile.in b/gst/Makefile.in new file mode 100644 index 0000000..35a2115 --- /dev/null +++ b/gst/Makefile.in @@ -0,0 +1,734 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = gst +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-docbook.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-doc.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/introspection.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAT_ENTRY_END = @CAT_ENTRY_END@ +CAT_ENTRY_START = @CAT_ENTRY_START@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPD_PLUGINS_DIR = @GSTPD_PLUGINS_DIR@ +GSTPG_PLUGINS_DIR = @GSTPG_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALL_CFLAGS = @GST_ALL_CFLAGS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_ALL_LIBS = @GST_ALL_LIBS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OBJ_CFLAGS = @GST_OBJ_CFLAGS@ +GST_OBJ_LIBS = @GST_OBJ_LIBS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PKG_CONFIG_PATH = @GST_PKG_CONFIG_PATH@ +GST_PLUGINS_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@ +GST_PLUGINS_BAD_DIR = @GST_PLUGINS_BAD_DIR@ +GST_PLUGINS_BAD_LIBS = @GST_PLUGINS_BAD_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@ +GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@ +GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ +HAVE_DVIPS = @HAVE_DVIPS@ +HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ +HAVE_JADETEX = @HAVE_JADETEX@ +HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ +HAVE_PNMTOPS = @HAVE_PNMTOPS@ +HAVE_PS2PDF = @HAVE_PS2PDF@ +HAVE_XMLLINT = @HAVE_XMLLINT@ +HAVE_XSLTPROC = @HAVE_XSLTPROC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCGROUP_CFLAGS = @LIBCGROUP_CFLAGS@ +LIBCGROUP_LIBS = @LIBCGROUP_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XML_CATALOG = @XML_CATALOG@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = rtsp-server +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gst/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu gst/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + 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 || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + 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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean 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-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-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: diff --git a/gst/rtsp-server/Makefile.am b/gst/rtsp-server/Makefile.am new file mode 100644 index 0000000..60eaf3e --- /dev/null +++ b/gst/rtsp-server/Makefile.am @@ -0,0 +1,128 @@ +public_headers = \ + rtsp-auth.h \ + rtsp-address-pool.h \ + rtsp-context.h \ + rtsp-params.h \ + rtsp-sdp.h \ + rtsp-thread-pool.h \ + rtsp-media.h \ + rtsp-media-factory.h \ + rtsp-media-factory-wfd.h \ + rtsp-media-factory-uri.h \ + rtsp-mount-points.h \ + rtsp-permissions.h \ + rtsp-stream.h \ + rtsp-stream-transport.h \ + rtsp-session.h \ + rtsp-session-media.h \ + rtsp-session-pool.h \ + rtsp-token.h \ + rtsp-client-wfd.h \ + rtsp-client.h \ + rtsp-server-wfd.h \ + rtsp-server.h \ + gstwfdmessage.h + +c_sources = \ + rtsp-auth.c \ + rtsp-address-pool.c \ + rtsp-context.c \ + rtsp-params.c \ + rtsp-sdp.c \ + rtsp-thread-pool.c \ + rtsp-media.c \ + rtsp-media-factory.c \ + rtsp-media-factory-wfd.c \ + rtsp-media-factory-uri.c \ + rtsp-mount-points.c \ + rtsp-permissions.c \ + rtsp-stream.c \ + rtsp-stream-transport.c \ + rtsp-session.c \ + rtsp-session-media.c \ + rtsp-session-pool.c \ + rtsp-token.c \ + gstwfdmessage.c \ + rtsp-client-wfd.c \ + rtsp-client.c \ + rtsp-server-wfd.c \ + rtsp-server.c + +noinst_HEADERS = + +lib_LTLIBRARIES = \ + libgstrtspserver-@GST_API_VERSION@.la + +libgstrtspserver_@GST_API_VERSION@_la_SOURCES = \ + $(c_sources) + +libgstrtspserver_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) +libgstrtspserver_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) +libgstrtspserver_@GST_API_VERSION@_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) \ + -lgstrtp-@GST_API_VERSION@ -lgstrtsp-@GST_API_VERSION@ \ + -lgstnet-@GST_API_VERSION@ \ + -lgstsdp-@GST_API_VERSION@ \ + -lgstapp-@GST_API_VERSION@ \ + $(GST_LIBS) $(GIO_LIBS) $(LIBM) + +libgstrtspserver_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst/rtsp-server +libgstrtspserver_@GST_API_VERSION@include_HEADERS = $(public_headers) + +CLEANFILES = + +if HAVE_INTROSPECTION +BUILT_GIRSOURCES = GstRtspServer-@GST_API_VERSION@.gir + +gir_headers=$(patsubst %,$(srcdir)/%, $(libgstrtspserver_@GST_API_VERSION@include_HEADERS)) +gir_sources=$(patsubst %,$(srcdir)/%, $(libgstrtspserver_@GST_API_VERSION@_la_SOURCES)) + +GstRtspServer-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtspserver-@GST_API_VERSION@.la + $(AM_V_GEN)PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ + $(INTROSPECTION_SCANNER) -v --namespace GstRtspServer \ + --nsversion=@GST_API_VERSION@ \ + --strip-prefix=Gst \ + --warn-all \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -DIN_GOBJECT_INTROSPECTION=1 \ + --c-include='gst/rtsp-server/rtsp-server.h' \ + --add-include-path=`$(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ + --add-include-path=`$(PKG_CONFIG) --variable=girdir gstreamer-rtsp-@GST_API_VERSION@` \ + --add-include-path=`$(PKG_CONFIG) --variable=girdir gstreamer-sdp-@GST_API_VERSION@` \ + --add-include-path=`$(PKG_CONFIG) --variable=girdir gstreamer-net-@GST_API_VERSION@` \ + --library=libgstrtspserver-@GST_API_VERSION@.la \ + --include=Gst-@GST_API_VERSION@ \ + --include=GstRtsp-@GST_API_VERSION@ \ + --include=GstNet-@GST_API_VERSION@ \ + --libtool="$(top_builddir)/libtool" \ + --pkg gstreamer-@GST_API_VERSION@ \ + --pkg gstreamer-rtsp-@GST_API_VERSION@ \ + --pkg gstreamer-net-@GST_API_VERSION@ \ + --pkg-export gstreamer-rtsp-server-@GST_API_VERSION@ \ + --output $@ \ + $(gir_headers) \ + $(gir_sources) + +# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to +# install anything - we need to install inside our prefix. +girdir = $(datadir)/gir-1.0 +gir_DATA = $(BUILT_GIRSOURCES) + +typelibsdir = $(libdir)/girepository-1.0/ + +typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) + +%.typelib: %.gir $(INTROSPECTION_COMPILER) + $(AM_V_GEN)PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ + $(INTROSPECTION_COMPILER) \ + --includedir=$(srcdir) \ + --includedir=$(builddir) \ + --includedir=`$(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ + --includedir=`$(PKG_CONFIG) --variable=girdir gstreamer-rtsp-@GST_API_VERSION@` \ + --includedir=`$(PKG_CONFIG) --variable=girdir gstreamer-sdp-@GST_API_VERSION@` \ + --includedir=`$(PKG_CONFIG) --variable=girdir gstreamer-net-@GST_API_VERSION@` \ + $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) + +CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA) +endif diff --git a/gst/rtsp-server/Makefile.in b/gst/rtsp-server/Makefile.in new file mode 100644 index 0000000..c7c73ae --- /dev/null +++ b/gst/rtsp-server/Makefile.in @@ -0,0 +1,1065 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ + + + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +@HAVE_INTROSPECTION_TRUE@am__append_1 = $(BUILT_GIRSOURCES) $(typelibs_DATA) +subdir = gst/rtsp-server +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp \ + $(libgstrtspserver_@GST_API_VERSION@include_HEADERS) \ + $(noinst_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-docbook.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-doc.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/introspection.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" \ + "$(DESTDIR)$(typelibsdir)" \ + "$(DESTDIR)$(libgstrtspserver_@GST_API_VERSION@includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgstrtspserver_@GST_API_VERSION@_la_DEPENDENCIES = \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__objects_1 = libgstrtspserver_@GST_API_VERSION@_la-rtsp-auth.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-address-pool.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-context.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-params.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-sdp.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-thread-pool.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-media.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory-uri.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-mount-points.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-permissions.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream-transport.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-session.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-media.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-pool.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-token.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-client.lo \ + libgstrtspserver_@GST_API_VERSION@_la-rtsp-server.lo +am_libgstrtspserver_@GST_API_VERSION@_la_OBJECTS = $(am__objects_1) +libgstrtspserver_@GST_API_VERSION@_la_OBJECTS = \ + $(am_libgstrtspserver_@GST_API_VERSION@_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgstrtspserver_@GST_API_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ + --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) \ + $(CFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgstrtspserver_@GST_API_VERSION@_la_SOURCES) +DIST_SOURCES = $(libgstrtspserver_@GST_API_VERSION@_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(gir_DATA) $(typelibs_DATA) +HEADERS = $(libgstrtspserver_@GST_API_VERSION@include_HEADERS) \ + $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAT_ENTRY_END = @CAT_ENTRY_END@ +CAT_ENTRY_START = @CAT_ENTRY_START@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPD_PLUGINS_DIR = @GSTPD_PLUGINS_DIR@ +GSTPG_PLUGINS_DIR = @GSTPG_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALL_CFLAGS = @GST_ALL_CFLAGS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_ALL_LIBS = @GST_ALL_LIBS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OBJ_CFLAGS = @GST_OBJ_CFLAGS@ +GST_OBJ_LIBS = @GST_OBJ_LIBS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PKG_CONFIG_PATH = @GST_PKG_CONFIG_PATH@ +GST_PLUGINS_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@ +GST_PLUGINS_BAD_DIR = @GST_PLUGINS_BAD_DIR@ +GST_PLUGINS_BAD_LIBS = @GST_PLUGINS_BAD_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@ +GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@ +GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ +HAVE_DVIPS = @HAVE_DVIPS@ +HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ +HAVE_JADETEX = @HAVE_JADETEX@ +HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ +HAVE_PNMTOPS = @HAVE_PNMTOPS@ +HAVE_PS2PDF = @HAVE_PS2PDF@ +HAVE_XMLLINT = @HAVE_XMLLINT@ +HAVE_XSLTPROC = @HAVE_XSLTPROC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCGROUP_CFLAGS = @LIBCGROUP_CFLAGS@ +LIBCGROUP_LIBS = @LIBCGROUP_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XML_CATALOG = @XML_CATALOG@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +public_headers = \ + rtsp-auth.h \ + rtsp-address-pool.h \ + rtsp-context.h \ + rtsp-params.h \ + rtsp-sdp.h \ + rtsp-thread-pool.h \ + rtsp-media.h \ + rtsp-media-factory.h \ + rtsp-media-factory-uri.h \ + rtsp-mount-points.h \ + rtsp-permissions.h \ + rtsp-stream.h \ + rtsp-stream-transport.h \ + rtsp-session.h \ + rtsp-session-media.h \ + rtsp-session-pool.h \ + rtsp-token.h \ + rtsp-client.h \ + rtsp-server.h + +c_sources = \ + rtsp-auth.c \ + rtsp-address-pool.c \ + rtsp-context.c \ + rtsp-params.c \ + rtsp-sdp.c \ + rtsp-thread-pool.c \ + rtsp-media.c \ + rtsp-media-factory.c \ + rtsp-media-factory-uri.c \ + rtsp-mount-points.c \ + rtsp-permissions.c \ + rtsp-stream.c \ + rtsp-stream-transport.c \ + rtsp-session.c \ + rtsp-session-media.c \ + rtsp-session-pool.c \ + rtsp-token.c \ + rtsp-client.c \ + rtsp-server.c + +noinst_HEADERS = +lib_LTLIBRARIES = \ + libgstrtspserver-@GST_API_VERSION@.la + +libgstrtspserver_@GST_API_VERSION@_la_SOURCES = \ + $(c_sources) + +libgstrtspserver_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) +libgstrtspserver_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) +libgstrtspserver_@GST_API_VERSION@_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) \ + -lgstrtp-@GST_API_VERSION@ -lgstrtsp-@GST_API_VERSION@ \ + -lgstnet-@GST_API_VERSION@ \ + -lgstsdp-@GST_API_VERSION@ \ + -lgstapp-@GST_API_VERSION@ \ + $(GST_LIBS) $(GIO_LIBS) $(LIBM) + +libgstrtspserver_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst/rtsp-server +libgstrtspserver_@GST_API_VERSION@include_HEADERS = $(public_headers) +CLEANFILES = $(am__append_1) +@HAVE_INTROSPECTION_TRUE@BUILT_GIRSOURCES = GstRtspServer-@GST_API_VERSION@.gir +@HAVE_INTROSPECTION_TRUE@gir_headers = $(patsubst %,$(srcdir)/%, $(libgstrtspserver_@GST_API_VERSION@include_HEADERS)) +@HAVE_INTROSPECTION_TRUE@gir_sources = $(patsubst %,$(srcdir)/%, $(libgstrtspserver_@GST_API_VERSION@_la_SOURCES)) + +# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to +# install anything - we need to install inside our prefix. +@HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0 +@HAVE_INTROSPECTION_TRUE@gir_DATA = $(BUILT_GIRSOURCES) +@HAVE_INTROSPECTION_TRUE@typelibsdir = $(libdir)/girepository-1.0/ +@HAVE_INTROSPECTION_TRUE@typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gst/rtsp-server/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu gst/rtsp-server/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgstrtspserver-@GST_API_VERSION@.la: $(libgstrtspserver_@GST_API_VERSION@_la_OBJECTS) $(libgstrtspserver_@GST_API_VERSION@_la_DEPENDENCIES) $(EXTRA_libgstrtspserver_@GST_API_VERSION@_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstrtspserver_@GST_API_VERSION@_la_LINK) -rpath $(libdir) $(libgstrtspserver_@GST_API_VERSION@_la_OBJECTS) $(libgstrtspserver_@GST_API_VERSION@_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-address-pool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-auth.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-client.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-context.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory-uri.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-mount-points.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-params.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-permissions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-sdp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-server.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-media.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-pool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream-transport.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-thread-pool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-token.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-auth.lo: rtsp-auth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-auth.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-auth.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-auth.lo `test -f 'rtsp-auth.c' || echo '$(srcdir)/'`rtsp-auth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-auth.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-auth.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-auth.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-auth.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-auth.lo `test -f 'rtsp-auth.c' || echo '$(srcdir)/'`rtsp-auth.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-address-pool.lo: rtsp-address-pool.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-address-pool.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-address-pool.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-address-pool.lo `test -f 'rtsp-address-pool.c' || echo '$(srcdir)/'`rtsp-address-pool.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-address-pool.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-address-pool.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-address-pool.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-address-pool.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-address-pool.lo `test -f 'rtsp-address-pool.c' || echo '$(srcdir)/'`rtsp-address-pool.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-context.lo: rtsp-context.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-context.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-context.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-context.lo `test -f 'rtsp-context.c' || echo '$(srcdir)/'`rtsp-context.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-context.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-context.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-context.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-context.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-context.lo `test -f 'rtsp-context.c' || echo '$(srcdir)/'`rtsp-context.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-params.lo: rtsp-params.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-params.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-params.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-params.lo `test -f 'rtsp-params.c' || echo '$(srcdir)/'`rtsp-params.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-params.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-params.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-params.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-params.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-params.lo `test -f 'rtsp-params.c' || echo '$(srcdir)/'`rtsp-params.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-sdp.lo: rtsp-sdp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-sdp.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-sdp.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-sdp.lo `test -f 'rtsp-sdp.c' || echo '$(srcdir)/'`rtsp-sdp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-sdp.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-sdp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-sdp.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-sdp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-sdp.lo `test -f 'rtsp-sdp.c' || echo '$(srcdir)/'`rtsp-sdp.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-thread-pool.lo: rtsp-thread-pool.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-thread-pool.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-thread-pool.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-thread-pool.lo `test -f 'rtsp-thread-pool.c' || echo '$(srcdir)/'`rtsp-thread-pool.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-thread-pool.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-thread-pool.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-thread-pool.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-thread-pool.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-thread-pool.lo `test -f 'rtsp-thread-pool.c' || echo '$(srcdir)/'`rtsp-thread-pool.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-media.lo: rtsp-media.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-media.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-media.lo `test -f 'rtsp-media.c' || echo '$(srcdir)/'`rtsp-media.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-media.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-media.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-media.lo `test -f 'rtsp-media.c' || echo '$(srcdir)/'`rtsp-media.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory.lo: rtsp-media-factory.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory.lo `test -f 'rtsp-media-factory.c' || echo '$(srcdir)/'`rtsp-media-factory.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-media-factory.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory.lo `test -f 'rtsp-media-factory.c' || echo '$(srcdir)/'`rtsp-media-factory.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory-uri.lo: rtsp-media-factory-uri.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory-uri.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory-uri.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory-uri.lo `test -f 'rtsp-media-factory-uri.c' || echo '$(srcdir)/'`rtsp-media-factory-uri.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory-uri.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory-uri.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-media-factory-uri.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory-uri.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-media-factory-uri.lo `test -f 'rtsp-media-factory-uri.c' || echo '$(srcdir)/'`rtsp-media-factory-uri.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-mount-points.lo: rtsp-mount-points.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-mount-points.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-mount-points.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-mount-points.lo `test -f 'rtsp-mount-points.c' || echo '$(srcdir)/'`rtsp-mount-points.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-mount-points.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-mount-points.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-mount-points.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-mount-points.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-mount-points.lo `test -f 'rtsp-mount-points.c' || echo '$(srcdir)/'`rtsp-mount-points.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-permissions.lo: rtsp-permissions.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-permissions.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-permissions.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-permissions.lo `test -f 'rtsp-permissions.c' || echo '$(srcdir)/'`rtsp-permissions.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-permissions.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-permissions.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-permissions.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-permissions.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-permissions.lo `test -f 'rtsp-permissions.c' || echo '$(srcdir)/'`rtsp-permissions.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream.lo: rtsp-stream.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream.lo `test -f 'rtsp-stream.c' || echo '$(srcdir)/'`rtsp-stream.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-stream.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream.lo `test -f 'rtsp-stream.c' || echo '$(srcdir)/'`rtsp-stream.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream-transport.lo: rtsp-stream-transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream-transport.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream-transport.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream-transport.lo `test -f 'rtsp-stream-transport.c' || echo '$(srcdir)/'`rtsp-stream-transport.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream-transport.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream-transport.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-stream-transport.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream-transport.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-stream-transport.lo `test -f 'rtsp-stream-transport.c' || echo '$(srcdir)/'`rtsp-stream-transport.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-session.lo: rtsp-session.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-session.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-session.lo `test -f 'rtsp-session.c' || echo '$(srcdir)/'`rtsp-session.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-session.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-session.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-session.lo `test -f 'rtsp-session.c' || echo '$(srcdir)/'`rtsp-session.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-media.lo: rtsp-session-media.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-media.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-media.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-media.lo `test -f 'rtsp-session-media.c' || echo '$(srcdir)/'`rtsp-session-media.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-media.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-media.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-session-media.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-media.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-media.lo `test -f 'rtsp-session-media.c' || echo '$(srcdir)/'`rtsp-session-media.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-pool.lo: rtsp-session-pool.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-pool.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-pool.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-pool.lo `test -f 'rtsp-session-pool.c' || echo '$(srcdir)/'`rtsp-session-pool.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-pool.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-pool.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-session-pool.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-pool.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-session-pool.lo `test -f 'rtsp-session-pool.c' || echo '$(srcdir)/'`rtsp-session-pool.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-token.lo: rtsp-token.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-token.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-token.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-token.lo `test -f 'rtsp-token.c' || echo '$(srcdir)/'`rtsp-token.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-token.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-token.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-token.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-token.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-token.lo `test -f 'rtsp-token.c' || echo '$(srcdir)/'`rtsp-token.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-client.lo: rtsp-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-client.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-client.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-client.lo `test -f 'rtsp-client.c' || echo '$(srcdir)/'`rtsp-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-client.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-client.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-client.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-client.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-client.lo `test -f 'rtsp-client.c' || echo '$(srcdir)/'`rtsp-client.c + +libgstrtspserver_@GST_API_VERSION@_la-rtsp-server.lo: rtsp-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -MT libgstrtspserver_@GST_API_VERSION@_la-rtsp-server.lo -MD -MP -MF $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-server.Tpo -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-server.lo `test -f 'rtsp-server.c' || echo '$(srcdir)/'`rtsp-server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-server.Tpo $(DEPDIR)/libgstrtspserver_@GST_API_VERSION@_la-rtsp-server.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp-server.c' object='libgstrtspserver_@GST_API_VERSION@_la-rtsp-server.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstrtspserver_@GST_API_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libgstrtspserver_@GST_API_VERSION@_la-rtsp-server.lo `test -f 'rtsp-server.c' || echo '$(srcdir)/'`rtsp-server.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-girDATA: $(gir_DATA) + @$(NORMAL_INSTALL) + @list='$(gir_DATA)'; test -n "$(girdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(girdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(girdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(girdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(girdir)" || exit $$?; \ + done + +uninstall-girDATA: + @$(NORMAL_UNINSTALL) + @list='$(gir_DATA)'; test -n "$(girdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(girdir)'; $(am__uninstall_files_from_dir) +install-typelibsDATA: $(typelibs_DATA) + @$(NORMAL_INSTALL) + @list='$(typelibs_DATA)'; test -n "$(typelibsdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(typelibsdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(typelibsdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(typelibsdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(typelibsdir)" || exit $$?; \ + done + +uninstall-typelibsDATA: + @$(NORMAL_UNINSTALL) + @list='$(typelibs_DATA)'; test -n "$(typelibsdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(typelibsdir)'; $(am__uninstall_files_from_dir) +install-libgstrtspserver_@GST_API_VERSION@includeHEADERS: $(libgstrtspserver_@GST_API_VERSION@include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgstrtspserver_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstrtspserver_@GST_API_VERSION@includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgstrtspserver_@GST_API_VERSION@includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgstrtspserver_@GST_API_VERSION@includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libgstrtspserver_@GST_API_VERSION@includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgstrtspserver_@GST_API_VERSION@includedir)" || exit $$?; \ + done + +uninstall-libgstrtspserver_@GST_API_VERSION@includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgstrtspserver_@GST_API_VERSION@include_HEADERS)'; test -n "$(libgstrtspserver_@GST_API_VERSION@includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgstrtspserver_@GST_API_VERSION@includedir)'; $(am__uninstall_files_from_dir) +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(libgstrtspserver_@GST_API_VERSION@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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-girDATA \ + install-libgstrtspserver_@GST_API_VERSION@includeHEADERS \ + install-typelibsDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +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-girDATA uninstall-libLTLIBRARIES \ + uninstall-libgstrtspserver_@GST_API_VERSION@includeHEADERS \ + uninstall-typelibsDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool cscopelist-am ctags-am \ + distclean distclean-compile distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-girDATA \ + install-html install-html-am install-info install-info-am \ + install-libLTLIBRARIES \ + install-libgstrtspserver_@GST_API_VERSION@includeHEADERS \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip install-typelibsDATA installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am uninstall-girDATA \ + uninstall-libLTLIBRARIES \ + uninstall-libgstrtspserver_@GST_API_VERSION@includeHEADERS \ + uninstall-typelibsDATA + + +@HAVE_INTROSPECTION_TRUE@GstRtspServer-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtspserver-@GST_API_VERSION@.la +@HAVE_INTROSPECTION_TRUE@ $(AM_V_GEN)PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ +@HAVE_INTROSPECTION_TRUE@ $(INTROSPECTION_SCANNER) -v --namespace GstRtspServer \ +@HAVE_INTROSPECTION_TRUE@ --nsversion=@GST_API_VERSION@ \ +@HAVE_INTROSPECTION_TRUE@ --strip-prefix=Gst \ +@HAVE_INTROSPECTION_TRUE@ --warn-all \ +@HAVE_INTROSPECTION_TRUE@ -I$(top_srcdir) \ +@HAVE_INTROSPECTION_TRUE@ -I$(top_builddir) \ +@HAVE_INTROSPECTION_TRUE@ -DIN_GOBJECT_INTROSPECTION=1 \ +@HAVE_INTROSPECTION_TRUE@ --c-include='gst/rtsp-server/rtsp-server.h' \ +@HAVE_INTROSPECTION_TRUE@ --add-include-path=`$(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ +@HAVE_INTROSPECTION_TRUE@ --add-include-path=`$(PKG_CONFIG) --variable=girdir gstreamer-rtsp-@GST_API_VERSION@` \ +@HAVE_INTROSPECTION_TRUE@ --add-include-path=`$(PKG_CONFIG) --variable=girdir gstreamer-sdp-@GST_API_VERSION@` \ +@HAVE_INTROSPECTION_TRUE@ --add-include-path=`$(PKG_CONFIG) --variable=girdir gstreamer-net-@GST_API_VERSION@` \ +@HAVE_INTROSPECTION_TRUE@ --library=libgstrtspserver-@GST_API_VERSION@.la \ +@HAVE_INTROSPECTION_TRUE@ --include=Gst-@GST_API_VERSION@ \ +@HAVE_INTROSPECTION_TRUE@ --include=GstRtsp-@GST_API_VERSION@ \ +@HAVE_INTROSPECTION_TRUE@ --include=GstNet-@GST_API_VERSION@ \ +@HAVE_INTROSPECTION_TRUE@ --libtool="$(top_builddir)/libtool" \ +@HAVE_INTROSPECTION_TRUE@ --pkg gstreamer-@GST_API_VERSION@ \ +@HAVE_INTROSPECTION_TRUE@ --pkg gstreamer-rtsp-@GST_API_VERSION@ \ +@HAVE_INTROSPECTION_TRUE@ --pkg gstreamer-net-@GST_API_VERSION@ \ +@HAVE_INTROSPECTION_TRUE@ --pkg-export gstreamer-rtsp-server-@GST_API_VERSION@ \ +@HAVE_INTROSPECTION_TRUE@ --output $@ \ +@HAVE_INTROSPECTION_TRUE@ $(gir_headers) \ +@HAVE_INTROSPECTION_TRUE@ $(gir_sources) + +@HAVE_INTROSPECTION_TRUE@%.typelib: %.gir $(INTROSPECTION_COMPILER) +@HAVE_INTROSPECTION_TRUE@ $(AM_V_GEN)PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ +@HAVE_INTROSPECTION_TRUE@ $(INTROSPECTION_COMPILER) \ +@HAVE_INTROSPECTION_TRUE@ --includedir=$(srcdir) \ +@HAVE_INTROSPECTION_TRUE@ --includedir=$(builddir) \ +@HAVE_INTROSPECTION_TRUE@ --includedir=`$(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ +@HAVE_INTROSPECTION_TRUE@ --includedir=`$(PKG_CONFIG) --variable=girdir gstreamer-rtsp-@GST_API_VERSION@` \ +@HAVE_INTROSPECTION_TRUE@ --includedir=`$(PKG_CONFIG) --variable=girdir gstreamer-sdp-@GST_API_VERSION@` \ +@HAVE_INTROSPECTION_TRUE@ --includedir=`$(PKG_CONFIG) --variable=girdir gstreamer-net-@GST_API_VERSION@` \ +@HAVE_INTROSPECTION_TRUE@ $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) + +# 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: diff --git a/gst/rtsp-server/from_upstream.diff b/gst/rtsp-server/from_upstream.diff new file mode 100644 index 0000000..99065f5 --- /dev/null +++ b/gst/rtsp-server/from_upstream.diff @@ -0,0 +1,255 @@ +diff -urN /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/Makefile.am ./Makefile.am +--- /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/Makefile.am 2014-01-13 01:50:54.000000000 +0900 ++++ ./Makefile.am 2015-01-15 16:49:47.091243189 +0900 +@@ -7,6 +7,7 @@ + rtsp-thread-pool.h \ + rtsp-media.h \ + rtsp-media-factory.h \ ++ rtsp-media-factory-wfd.h \ + rtsp-media-factory-uri.h \ + rtsp-mount-points.h \ + rtsp-permissions.h \ +@@ -16,8 +17,11 @@ + rtsp-session-media.h \ + rtsp-session-pool.h \ + rtsp-token.h \ ++ rtsp-client-wfd.h \ + rtsp-client.h \ +- rtsp-server.h ++ rtsp-server-wfd.h \ ++ rtsp-server.h \ ++ gstwfdmessage.h + + c_sources = \ + rtsp-auth.c \ +@@ -28,6 +32,7 @@ + rtsp-thread-pool.c \ + rtsp-media.c \ + rtsp-media-factory.c \ ++ rtsp-media-factory-wfd.c \ + rtsp-media-factory-uri.c \ + rtsp-mount-points.c \ + rtsp-permissions.c \ +@@ -37,7 +42,10 @@ + rtsp-session-media.c \ + rtsp-session-pool.c \ + rtsp-token.c \ ++ gstwfdmessage.c \ ++ rtsp-client-wfd.c \ + rtsp-client.c \ ++ rtsp-server-wfd.c \ + rtsp-server.c + + noinst_HEADERS = +diff -urN /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-client.c ./rtsp-client.c +--- /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-client.c 2014-02-10 21:43:30.000000000 +0900 ++++ ./rtsp-client.c 2015-02-23 16:33:37.059801061 +0900 +@@ -137,6 +137,12 @@ + GstRTSPContext * ctx); + static gchar *default_make_path_from_uri (GstRTSPClient * client, + const GstRTSPUrl * uri); ++static gboolean default_handle_options_request (GstRTSPClient * client, ++ GstRTSPContext * ctx); ++static gboolean default_handle_set_param_request (GstRTSPClient * client, ++ GstRTSPContext * ctx); ++static gboolean default_handle_get_param_request (GstRTSPClient * client, ++ GstRTSPContext * ctx); + + G_DEFINE_TYPE (GstRTSPClient, gst_rtsp_client, G_TYPE_OBJECT); + +@@ -159,6 +165,9 @@ + klass->params_set = default_params_set; + klass->params_get = default_params_get; + klass->make_path_from_uri = default_make_path_from_uri; ++ klass->handle_options_request = default_handle_options_request; ++ klass->handle_set_param_request = default_handle_set_param_request; ++ klass->handle_get_param_request = default_handle_get_param_request; + + g_object_class_install_property (gobject_class, PROP_SESSION_POOL, + g_param_spec_object ("session-pool", "Session Pool", +@@ -869,7 +878,7 @@ + } + + static gboolean +-handle_get_param_request (GstRTSPClient * client, GstRTSPContext * ctx) ++default_handle_get_param_request (GstRTSPClient * client, GstRTSPContext * ctx) + { + GstRTSPResult res; + guint8 *data; +@@ -906,7 +915,7 @@ + } + + static gboolean +-handle_set_param_request (GstRTSPClient * client, GstRTSPContext * ctx) ++default_handle_set_param_request (GstRTSPClient * client, GstRTSPContext * ctx) + { + GstRTSPResult res; + guint8 *data; +@@ -1462,6 +1471,8 @@ + if (media == NULL) + goto media_not_found_no_reply; + ++ /* FIXME-WFD : wfd url problem */ ++#if 0 + if (path[matched] == '\0') + goto control_not_found; + +@@ -1469,6 +1480,9 @@ + path[matched] = '\0'; + /* control is remainder */ + control = &path[matched + 1]; ++#else ++ control = g_strdup ("stream=0"); ++#endif + + /* find the stream now using the control part */ + stream = gst_rtsp_media_find_stream (media, control); +@@ -1534,6 +1548,10 @@ + /* create and serialize the server transport */ + st = make_server_transport (client, ctx, ct); + trans_str = gst_rtsp_transport_as_text (st); ++ ++ /* FIXME-WFD : Temporarily force to set profile string */ ++ trans_str = g_strjoinv ("RTP/AVP/UDP", g_strsplit (trans_str, "RTP/AVP", -1)); ++ + gst_rtsp_transport_free (st); + + /* construct the response now */ +@@ -1820,7 +1838,7 @@ + } + + static gboolean +-handle_options_request (GstRTSPClient * client, GstRTSPContext * ctx) ++default_handle_options_request (GstRTSPClient * client, GstRTSPContext * ctx) + { + GstRTSPMethod options; + gchar *str; +@@ -1906,6 +1924,9 @@ + GstRTSPContext sctx = { NULL }, *ctx; + GstRTSPMessage response = { 0 }; + gchar *sessid; ++ GstRTSPClientClass *klass; ++ ++ klass = GST_RTSP_CLIENT_GET_CLASS (client); + + if (!(ctx = gst_rtsp_context_get_current ())) { + ctx = &sctx; +@@ -1995,7 +2016,7 @@ + /* now see what is asked and dispatch to a dedicated handler */ + switch (method) { + case GST_RTSP_OPTIONS: +- handle_options_request (client, ctx); ++ klass->handle_options_request (client, ctx); + break; + case GST_RTSP_DESCRIBE: + handle_describe_request (client, ctx); +@@ -2013,10 +2034,10 @@ + handle_teardown_request (client, ctx); + break; + case GST_RTSP_SET_PARAMETER: +- handle_set_param_request (client, ctx); ++ klass->handle_set_param_request (client, ctx); + break; + case GST_RTSP_GET_PARAMETER: +- handle_get_param_request (client, ctx); ++ klass->handle_get_param_request (client, ctx); + break; + case GST_RTSP_ANNOUNCE: + case GST_RTSP_RECORD: +diff -urN /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-client.h ./rtsp-client.h +--- /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-client.h 2014-01-13 01:50:54.000000000 +0900 ++++ ./rtsp-client.h 2015-02-17 15:57:28.047757756 +0900 +@@ -102,6 +102,10 @@ + GstRTSPResult (*params_get) (GstRTSPClient *client, GstRTSPContext *ctx); + gchar * (*make_path_from_uri) (GstRTSPClient *client, const GstRTSPUrl *uri); + ++ gboolean (*handle_options_request) (GstRTSPClient * client, GstRTSPContext * ctx); ++ gboolean (*handle_set_param_request) (GstRTSPClient * client, GstRTSPContext * ctx); ++ gboolean (*handle_get_param_request) (GstRTSPClient * client, GstRTSPContext * ctx); ++ + /* signals */ + void (*closed) (GstRTSPClient *client); + void (*new_session) (GstRTSPClient *client, GstRTSPSession *session); +@@ -177,7 +181,7 @@ + GstRTSPSession *sess, + gpointer user_data); + +-GList * gst_rtsp_client_session_filter (GstRTSPClient *client, ++GList * gst_rtsp_client_session_filter (GstRTSPClient *client, + GstRTSPClientSessionFilterFunc func, + gpointer user_data); + +diff -urN /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-media.c ./rtsp-media.c +--- /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-media.c 2014-02-22 00:11:11.000000000 +0900 ++++ ./rtsp-media.c 2015-02-17 15:57:25.483757666 +0900 +@@ -241,10 +241,12 @@ + "If this media pipeline can be reused after an unprepare", + DEFAULT_REUSABLE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + ++#ifdef GST_TYPE_RTSP_PROFILE + g_object_class_install_property (gobject_class, PROP_PROFILES, + g_param_spec_flags ("profiles", "Profiles", + "Allowed transfer profiles", GST_TYPE_RTSP_PROFILE, + DEFAULT_PROFILES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++#endif + + g_object_class_install_property (gobject_class, PROP_PROTOCOLS, + g_param_spec_flags ("protocols", "Protocols", +diff -urN /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-stream.c ./rtsp-stream.c +--- /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-stream.c 2014-02-22 00:11:11.000000000 +0900 ++++ ./rtsp-stream.c 2015-02-17 15:57:25.527757667 +0900 +@@ -173,10 +173,12 @@ + "The control string for this stream", DEFAULT_CONTROL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + ++#ifdef GST_TYPE_RTSP_PROFILE + g_object_class_install_property (gobject_class, PROP_PROFILES, + g_param_spec_flags ("profiles", "Profiles", + "Allowed transfer profiles", GST_TYPE_RTSP_PROFILE, + DEFAULT_PROFILES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++#endif + + g_object_class_install_property (gobject_class, PROP_PROTOCOLS, + g_param_spec_flags ("protocols", "Protocols", +@@ -1001,6 +1003,9 @@ + inetaddr = g_inet_address_new_any (family); + } + ++ /* FIXME-WFD : Force to set 19000 as port number */ ++ tmp_rtp = 19000; ++ + rtp_sockaddr = g_inet_socket_address_new (inetaddr, tmp_rtp); + if (!g_socket_bind (rtp_socket, rtp_sockaddr, FALSE, NULL)) { + g_object_unref (rtp_sockaddr); +@@ -1171,9 +1176,14 @@ + G_SOCKET_FAMILY_IPV4, priv->udpsrc_v4, priv->udpsink, + &priv->server_port_v4, &priv->server_addr_v4); + ++ /* FIXME-WFD : force to disable ipv6 mode in WFD mode */ ++#if 0 + priv->have_ipv6 = alloc_ports_one_family (priv->pool, priv->buffer_size, + G_SOCKET_FAMILY_IPV6, priv->udpsrc_v6, priv->udpsink, + &priv->server_port_v6, &priv->server_addr_v6); ++#else ++ priv->have_ipv6 = FALSE; ++#endif + + return priv->have_ipv4 || priv->have_ipv6; + } +@@ -1552,6 +1562,8 @@ + + /* get the session */ + g_signal_emit_by_name (rtpbin, "get-internal-session", idx, &priv->session); ++ GST_DEBUG("zzoon unref internal session"); ++ g_object_unref(priv->session); + + g_signal_connect (priv->session, "on-new-ssrc", (GCallback) on_new_ssrc, + stream); +@@ -1841,6 +1853,7 @@ + gst_object_unref (priv->send_src[1]); + priv->send_src[1] = NULL; + ++ GST_DEBUG("Unref rtp session"); + g_object_unref (priv->session); + priv->session = NULL; + if (priv->caps) diff --git a/gst/rtsp-server/gstwfdmessage.c b/gst/rtsp-server/gstwfdmessage.c new file mode 100644 index 0000000..3bff785 --- /dev/null +++ b/gst/rtsp-server/gstwfdmessage.c @@ -0,0 +1,2269 @@ +/* GStreamer + * Copyright (C) <2005,2006> Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/* + * Unless otherwise indicated, Source Code is licensed under MIT license. + * See further explanation attached in License Statement (distributed in the file + * LICENSE). + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished to do + * so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/** + * SECTION:gstwfdmessage + * @short_description: Helper methods for dealing with WFD messages + * + * + * + * The GstWFDMessage helper functions makes it easy to parse and create WFD + * messages. + * + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include + +#include "gstwfdmessage.h" + +#define EDID_BLOCK_SIZE 128 + +#define FREE_STRING(field) g_free (field); (field) = NULL +#define REPLACE_STRING(field, val) FREE_STRING(field); (field) = g_strdup (val) + +static void +free_string (gchar ** str) +{ + FREE_STRING (*str); +} + +#define INIT_ARRAY(field, type, init_func) \ +G_STMT_START { \ + if (field) { \ + guint i; \ + for(i = 0; i < (field)->len; i++) \ + init_func (&g_array_index ((field), type, i)); \ + g_array_set_size ((field), 0); \ + } \ + else \ + (field) = g_array_new (FALSE, TRUE, sizeof (type)); \ +} G_STMT_END + +#define FREE_ARRAY(field) \ +G_STMT_START { \ + if (field) \ + g_array_free ((field), TRUE); \ + (field) = NULL; \ +} G_STMT_END + +#define DEFINE_STRING_SETTER(field) \ +GstWFDResult gst_wfd_message_set_##field (GstWFDMessage *msg, const gchar *val) { \ + g_free (msg->field); \ + msg->field = g_strdup (val); \ + return GST_WFD_OK; \ +} +#define DEFINE_STRING_GETTER(field) \ +const gchar* gst_wfd_message_get_##field (const GstWFDMessage *msg) { \ + return msg->field; \ +} + +#define DEFINE_ARRAY_LEN(field) \ +guint gst_wfd_message_##field##_len (const GstWFDMessage *msg) { \ + return msg->field->len; \ +} +#define DEFINE_ARRAY_GETTER(method, field, type) \ +const type * gst_wfd_message_get_##method (const GstWFDMessage *msg, guint idx) { \ + return &g_array_index (msg->field, type, idx); \ +} +#define DEFINE_PTR_ARRAY_GETTER(method, field, type) \ +const type gst_wfd_message_get_##method (const GstWFDMessage *msg, guint idx) { \ + return g_array_index (msg->field, type, idx); \ +} +#define DEFINE_ARRAY_INSERT(method, field, intype, dup_method, type) \ +GstWFDResult gst_wfd_message_insert_##method (GstWFDMessage *msg, gint idx, intype val) { \ + type vt; \ + type* v = &vt; \ + dup_method (v, val); \ + if (idx == -1) \ + g_array_append_val (msg->field, vt); \ + else \ + g_array_insert_val (msg->field, idx, vt); \ + return GST_WFD_OK; \ +} + +#define DEFINE_ARRAY_REPLACE(method, field, intype, free_method, dup_method, type) \ +GstWFDResult gst_wfd_message_replace_##method (GstWFDMessage *msg, guint idx, intype val) { \ + type *v = &g_array_index (msg->field, type, idx); \ + free_method (v); \ + dup_method (v, val); \ + return GST_WFD_OK; \ +} +#define DEFINE_ARRAY_REMOVE(method, field, type, free_method) \ +GstWFDResult gst_wfd_message_remove_##method (GstWFDMessage *msg, guint idx) { \ + type *v = &g_array_index (msg->field, type, idx); \ + free_method (v); \ + g_array_remove_index (msg->field, idx); \ + return GST_WFD_OK; \ +} +#define DEFINE_ARRAY_ADDER(method, type) \ +GstWFDResult gst_wfd_message_add_##method (GstWFDMessage *msg, const type val) { \ + return gst_wfd_message_insert_##method (msg, -1, val); \ +} + +#define dup_string(v,val) ((*v) = g_strdup (val)) +#define INIT_STR_ARRAY(field) \ + INIT_ARRAY (field, gchar *, free_string) +#define DEFINE_STR_ARRAY_GETTER(method, field) \ + DEFINE_PTR_ARRAY_GETTER(method, field, gchar *) +#define DEFINE_STR_ARRAY_INSERT(method, field) \ + DEFINE_ARRAY_INSERT (method, field, const gchar *, dup_string, gchar *) +#define DEFINE_STR_ARRAY_ADDER(method, field) \ + DEFINE_ARRAY_ADDER (method, gchar *) +#define DEFINE_STR_ARRAY_REPLACE(method, field) \ + DEFINE_ARRAY_REPLACE (method, field, const gchar *, free_string, dup_string, gchar *) +#define DEFINE_STR_ARRAY_REMOVE(method, field) \ + DEFINE_ARRAY_REMOVE (method, field, gchar *, free_string) + +static GstWFDMessage *gst_wfd_message_boxed_copy (GstWFDMessage * orig); +static void gst_wfd_message_boxed_free (GstWFDMessage * msg); + +G_DEFINE_BOXED_TYPE (GstWFDMessage, gst_wfd_message, gst_wfd_message_boxed_copy, + gst_wfd_message_boxed_free); + +static GstWFDMessage * +gst_wfd_message_boxed_copy (GstWFDMessage * orig) +{ + GstWFDMessage *copy; + + if (gst_wfd_message_copy (orig, ©) == GST_WFD_OK) + return copy; + + return NULL; +} + +static void +gst_wfd_message_boxed_free (GstWFDMessage * msg) +{ + gst_wfd_message_free (msg); +} + +/** + * gst_wfd_message_new: + * @msg: (out) (transfer full): pointer to new #GstWFDMessage + * + * Allocate a new GstWFDMessage and store the result in @msg. + * + * Returns: a #GstWFDResult. + */ +GstWFDResult +gst_wfd_message_new (GstWFDMessage ** msg) +{ + GstWFDMessage *newmsg; + + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + newmsg = g_new0 (GstWFDMessage, 1); + + *msg = newmsg; + + return gst_wfd_message_init (newmsg); +} + +/** + * gst_wfd_message_init: + * @msg: a #GstWFDMessage + * + * Initialize @msg so that its contents are as if it was freshly allocated + * with gst_wfd_message_new(). This function is mostly used to initialize a message + * allocated on the stack. gst_wfd_message_uninit() undoes this operation. + * + * When this function is invoked on newly allocated data (with malloc or on the + * stack), its contents should be set to 0 before calling this function. + * + * Returns: a #GstWFDResult. + */ +GstWFDResult +gst_wfd_message_init (GstWFDMessage * msg) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + return GST_WFD_OK; +} + +/** + * gst_wfd_message_uninit: + * @msg: a #GstWFDMessage + * + * Free all resources allocated in @msg. @msg should not be used anymore after + * this function. This function should be used when @msg was allocated on the + * stack and initialized with gst_wfd_message_init(). + * + * Returns: a #GstWFDResult. + */ +GstWFDResult +gst_wfd_message_uninit (GstWFDMessage * msg) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + gst_wfd_message_init (msg); + + return GST_WFD_OK; +} + +/** + * gst_wfd_message_copy: + * @msg: a #GstWFDMessage + * @copy: (out) (transfer full): pointer to new #GstWFDMessage + * + * Allocate a new copy of @msg and store the result in @copy. The value in + * @copy should be release with gst_wfd_message_free function. + * + * Returns: a #GstWFDResult + * + * Since: 1.6 + */ +GstWFDResult +gst_wfd_message_copy (const GstWFDMessage * msg, GstWFDMessage ** copy) +{ + GstWFDResult ret; + GstWFDMessage *cp; + + if (msg == NULL) + return GST_WFD_EINVAL; + + ret = gst_wfd_message_new (copy); + if (ret != GST_WFD_OK) + return ret; + + cp = *copy; + + /* TODO-WFD */ + if (msg->client_rtp_ports) { + cp->client_rtp_ports = g_malloc (sizeof (GstWFDClientRtpPorts)); + if (cp->client_rtp_ports) { + cp->client_rtp_ports->profile = g_strdup (msg->client_rtp_ports->profile); + cp->client_rtp_ports->rtp_port0 = msg->client_rtp_ports->rtp_port0; + cp->client_rtp_ports->rtp_port1 = msg->client_rtp_ports->rtp_port1; + cp->client_rtp_ports->mode = g_strdup (msg->client_rtp_ports->mode); + } + } + + return GST_WFD_OK; +} + + +static void +_read_string_space_ended (gchar * dest, guint size, gchar * src) +{ + guint idx = 0; + + while (!g_ascii_isspace (*src) && *src != '\0') { + if (idx < size - 1) + dest[idx++] = *src; + src++; + } + + if (size > 0) + dest[idx] = '\0'; + + return; +} + +static void +_read_string_char_ended (gchar * dest, guint size, gchar del, gchar * src) +{ + guint idx = 0; + + while (*src != del && *src != '\0') { + if (idx < size - 1) + dest[idx++] = *src; + src++; + } + + if (size > 0) + dest[idx] = '\0'; + + return; +} + +static void +_read_string_attr_and_value (gchar * attr, gchar * value, guint tsize, + guint vsize, gchar del, gchar * src) +{ + guint idx; + + idx = 0; + + while (*src != del && *src != '\0') { + if (idx < tsize - 1) + attr[idx++] = *src; + src++; + } + + if (tsize > 0) + attr[idx] = '\0'; + + src++; + idx = 0; + + while (*src != '\0') { + if (idx < vsize - 1) + value[idx++] = *src; + src++; + } + + if (vsize > 0) + value[idx] = '\0'; + + return; +} + +static void +gst_wfd_parse_attribute (gchar * buffer, GstWFDMessage * msg) +{ + gchar attr[8192] = { 0 }; + gchar value[8192] = { 0 }; + gchar temp[8192] = { 0 }; + gchar *p = buffer; + gchar *v = value; + +#define WFD_SKIP_SPACE(q) if (*q && g_ascii_isspace (*q)) q++ +#define WFD_SKIP_EQUAL(q) if (*q && *q == '=') q++ +#define WFD_SKIP_COMMA(q) if (*q && g_ascii_ispunct (*q)) q++ +#define WFD_READ_STRING(field) _read_string_space_ended (temp, sizeof (temp), v); v+=strlen(temp); REPLACE_STRING (field, temp) +#define WFD_READ_CHAR_END_STRING(field, del) _read_string_char_ended (temp, sizeof (temp), del, v); v+=strlen(temp); REPLACE_STRING (field, temp) +#define WFD_READ_UINT32(field) _read_string_space_ended (temp, sizeof (temp), v); v+=strlen(temp); field = strtoul (temp, NULL, 16) +#define WFD_READ_UINT32_DIGIT(field) _read_string_space_ended (temp, sizeof (temp), v); v+=strlen(temp); field = strtoul (temp, NULL, 10) + + _read_string_attr_and_value (attr, value, sizeof (attr), sizeof (value), ':', + p); + + if (!g_strcmp0 (attr, "wfd_audio_codecs")) { + msg->audio_codecs = g_new0 (GstWFDAudioCodeclist, 1); + if (strlen (v)) { + guint i = 0; + msg->audio_codecs->count = strlen (v) / 16; + msg->audio_codecs->list = + g_new0 (GstWFDAudioCodec, msg->audio_codecs->count); + for (; i < msg->audio_codecs->count; i++) { + WFD_SKIP_SPACE (v); + WFD_READ_STRING (msg->audio_codecs->list[i].audio_format); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->audio_codecs->list[i].modes); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->audio_codecs->list[i].latency); + WFD_SKIP_COMMA (v); + } + } + } else if (!g_strcmp0 (attr, "wfd_video_formats")) { + msg->video_formats = g_new0 (GstWFDVideoCodeclist, 1); + if (strlen (v)) { + msg->video_formats->count = 1; + msg->video_formats->list = g_new0 (GstWFDVideoCodec, 1); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->native); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats-> + list->preferred_display_mode_supported); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->H264_codec.profile); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->H264_codec.level); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->H264_codec. + misc_params.CEA_Support); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->H264_codec. + misc_params.VESA_Support); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->H264_codec. + misc_params.HH_Support); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->H264_codec. + misc_params.latency); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->H264_codec. + misc_params.min_slice_size); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->H264_codec. + misc_params.slice_enc_params); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->H264_codec. + misc_params.frame_rate_control_support); + WFD_SKIP_SPACE (v); + if (msg->video_formats->list->preferred_display_mode_supported == 1) { + WFD_READ_UINT32 (msg->video_formats->list->H264_codec.max_hres); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->H264_codec.max_vres); + WFD_SKIP_SPACE (v); + } + } + } else if (!g_strcmp0 (attr, "wfd_3d_formats")) { + msg->video_3d_formats = g_new0 (GstWFD3DFormats, 1); + if (strlen (v)) { + msg->video_3d_formats->count = 1; + msg->video_3d_formats->list = g_new0 (GstWFD3dCapList, 1); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_3d_formats->list->native); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_3d_formats-> + list->preferred_display_mode_supported); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_3d_formats->list->H264_codec.profile); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_3d_formats->list->H264_codec.level); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_3d_formats->list->H264_codec. + misc_params.video_3d_capability); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_3d_formats->list->H264_codec. + misc_params.latency); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_3d_formats->list->H264_codec. + misc_params.min_slice_size); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_3d_formats->list->H264_codec. + misc_params.slice_enc_params); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_3d_formats->list->H264_codec. + misc_params.frame_rate_control_support); + WFD_SKIP_SPACE (v); + if (msg->video_formats->list->preferred_display_mode_supported == 1) { + WFD_READ_UINT32 (msg->video_formats->list->H264_codec.max_hres); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->video_formats->list->H264_codec.max_vres); + WFD_SKIP_SPACE (v); + } + } + } else if (!g_strcmp0 (attr, "wfd_content_protection")) { + msg->content_protection = g_new0 (GstWFDContentProtection, 1); + if (strlen (v)) { + WFD_SKIP_SPACE (v); + msg->content_protection->hdcp2_spec = g_new0 (GstWFDHdcp2Spec, 1); + if (strstr (v, "none")) { + msg->content_protection->hdcp2_spec->hdcpversion = g_strdup ("none"); + } else { + WFD_READ_STRING (msg->content_protection->hdcp2_spec->hdcpversion); + WFD_SKIP_SPACE (v); + WFD_READ_STRING (msg->content_protection->hdcp2_spec->TCPPort); + } + } + } else if (!g_strcmp0 (attr, "wfd_display_edid")) { + msg->display_edid = g_new0 (GstWFDDisplayEdid, 1); + if (strlen (v)) { + WFD_SKIP_SPACE (v); + if (strstr (v, "none")) { + msg->display_edid->edid_supported = 0; + } else { + msg->display_edid->edid_supported = 1; + WFD_READ_UINT32 (msg->display_edid->edid_block_count); + WFD_SKIP_SPACE (v); + if (msg->display_edid->edid_block_count) { + gchar *edid_string = v; + int i = 0, j = 0; + guint32 payload_size = + EDID_BLOCK_SIZE * msg->display_edid->edid_block_count; + msg->display_edid->edid_payload = g_malloc (payload_size); + for (; + i < (EDID_BLOCK_SIZE * msg->display_edid->edid_block_count * 2); + j++) { + int k = 0, kk = 0; + if (edid_string[i] > 0x29 && edid_string[i] < 0x40) + k = edid_string[i] - 48; + else if (edid_string[i] > 0x60 && edid_string[i] < 0x67) + k = edid_string[i] - 87; + else if (edid_string[i] > 0x40 && edid_string[i] < 0x47) + k = edid_string[i] - 55; + + if (edid_string[i + 1] > 0x29 && edid_string[i + 1] < 0x40) + kk = edid_string[i + 1] - 48; + else if (edid_string[i + 1] > 0x60 && edid_string[i + 1] < 0x67) + kk = edid_string[i + 1] - 87; + else if (edid_string[i + 1] > 0x40 && edid_string[i + 1] < 0x47) + kk = edid_string[i + 1] - 55; + + msg->display_edid->edid_payload[j] = (k << 4) | kk; + i += 2; + } + //memcpy(msg->display_edid->edid_payload, v, payload_size); + v += (payload_size * 2); + } else + v += strlen (v); + } + } + } else if (!g_strcmp0 (attr, "wfd_coupled_sink")) { + msg->coupled_sink = g_new0 (GstWFDCoupledSink, 1); + if (strlen (v)) { + msg->coupled_sink->coupled_sink_cap = g_new0 (GstWFDCoupled_sink_cap, 1); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->coupled_sink->coupled_sink_cap->status); + WFD_SKIP_SPACE (v); + WFD_READ_STRING (msg->coupled_sink->coupled_sink_cap->sink_address); + } + } else if (!g_strcmp0 (attr, "wfd_trigger_method")) { + msg->trigger_method = g_new0 (GstWFDTriggerMethod, 1); + if (strlen (v)) { + WFD_SKIP_SPACE (v); + WFD_READ_STRING (msg->trigger_method->wfd_trigger_method); + } + } else if (!g_strcmp0 (attr, "wfd_presentation_URL")) { + msg->presentation_url = g_new0 (GstWFDPresentationUrl, 1); + if (strlen (v)) { + WFD_SKIP_SPACE (v); + WFD_READ_STRING (msg->presentation_url->wfd_url0); + WFD_SKIP_SPACE (v); + WFD_READ_STRING (msg->presentation_url->wfd_url1); + } + } else if (!g_strcmp0 (attr, "wfd_client_rtp_ports")) { + msg->client_rtp_ports = g_new0 (GstWFDClientRtpPorts, 1); + if (strlen (v)) { + WFD_SKIP_SPACE (v); + WFD_READ_STRING (msg->client_rtp_ports->profile); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32_DIGIT (msg->client_rtp_ports->rtp_port0); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32_DIGIT (msg->client_rtp_ports->rtp_port1); + WFD_SKIP_SPACE (v); + WFD_READ_STRING (msg->client_rtp_ports->mode); + } + } else if (!g_strcmp0 (attr, "wfd_route")) { + msg->route = g_new0 (GstWFDRoute, 1); + if (strlen (v)) { + WFD_SKIP_SPACE (v); + WFD_READ_STRING (msg->route->destination); + } + } else if (!g_strcmp0 (attr, "wfd_I2C")) { + msg->I2C = g_new0 (GstWFDI2C, 1); + if (strlen (v)) { + msg->I2C->I2CPresent = TRUE; + WFD_SKIP_SPACE (v); + WFD_READ_UINT32_DIGIT (msg->I2C->I2C_port); + if (msg->I2C->I2C_port) + msg->I2C->I2CPresent = TRUE; + } + } else if (!g_strcmp0 (attr, "wfd_av_format_change_timing")) { + msg->av_format_change_timing = g_new0 (GstWFDAVFormatChangeTiming, 1); + if (strlen (v)) { + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->av_format_change_timing->PTS); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->av_format_change_timing->DTS); + } + } else if (!g_strcmp0 (attr, "wfd_preferred_display_mode")) { + msg->preferred_display_mode = g_new0 (GstWFDPreferredDisplayMode, 1); + if (strlen (v)) { + WFD_SKIP_SPACE (v); + if (!strstr (v, "none")) { + msg->preferred_display_mode->displaymodesupported = FALSE; + } else { + WFD_READ_UINT32 (msg->preferred_display_mode->p_clock); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->HB); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->HSPOL_HSOFF); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->HSW); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->V); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->VB); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->VSPOL_VSOFF); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->VSW); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->VBS3D); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->V2d_s3d_modes); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->P_depth); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H264_codec.profile); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H264_codec.level); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H264_codec. + misc_params.CEA_Support); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H264_codec. + misc_params.VESA_Support); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H264_codec. + misc_params.HH_Support); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H264_codec. + misc_params.latency); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H264_codec. + misc_params.min_slice_size); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H264_codec. + misc_params.slice_enc_params); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H264_codec. + misc_params.frame_rate_control_support); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H264_codec.max_hres); + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->preferred_display_mode->H264_codec.max_vres); + WFD_SKIP_SPACE (v); + } + } + } else if (!g_strcmp0 (attr, "wfd_uibc_capability")) { + msg->uibc_capability = g_new0 (GstWFDUibcCapability, 1); + if (strstr (v, "input_category_list")) { + gchar *tstring = NULL; + msg->uibc_capability->uibcsupported = TRUE; + WFD_SKIP_SPACE (v); + WFD_READ_CHAR_END_STRING (tstring, '='); + if (!g_strcmp0 (tstring, "input_category_list")) { + gchar temp[8192]; + guint rem_len, read_len = 0; + WFD_READ_CHAR_END_STRING (tstring, ';'); + rem_len = strlen (tstring); + do { + WFD_SKIP_SPACE (v); + _read_string_char_ended (temp, 8192, ',', tstring + read_len); + read_len += (strlen (temp) + 1); + if (strstr (temp, "GENERIC")) + msg->uibc_capability->input_category_list.input_cat |= + GST_WFD_UIBC_INPUT_CAT_GENERIC; + else if (strstr (temp, "HIDC")) + msg->uibc_capability->input_category_list.input_cat |= + GST_WFD_UIBC_INPUT_CAT_HIDC; + else + msg->uibc_capability->input_category_list.input_cat |= + GST_WFD_UIBC_INPUT_CAT_UNKNOWN; + } while (read_len < rem_len); + v = strstr (v, "generic_cap_list"); + WFD_READ_CHAR_END_STRING (tstring, '='); + if (!g_strcmp0 (tstring, "generic_cap_list")) { + gchar temp[8192]; + guint rem_len, read_len = 0; + WFD_SKIP_SPACE (v); + WFD_READ_CHAR_END_STRING (tstring, ';'); + rem_len = strlen (tstring); + do { + _read_string_char_ended (temp, 8192, ',', tstring + read_len); + read_len += (strlen (temp) + 1); + if (strstr (temp, "Keyboard")) + msg->uibc_capability->generic_cap_list.inp_type |= + GST_WFD_UIBC_INPUT_TYPE_KEYBOARD; + else if (strstr (temp, "Mouse")) + msg->uibc_capability->generic_cap_list.inp_type |= + GST_WFD_UIBC_INPUT_TYPE_MOUSE; + else if (strstr (temp, "SingleTouch")) + msg->uibc_capability->generic_cap_list.inp_type |= + GST_WFD_UIBC_INPUT_TYPE_SINGLETOUCH; + else if (strstr (temp, "MultiTouch")) + msg->uibc_capability->generic_cap_list.inp_type |= + GST_WFD_UIBC_INPUT_TYPE_MULTITOUCH; + else if (strstr (temp, "Joystick")) + msg->uibc_capability->generic_cap_list.inp_type |= + GST_WFD_UIBC_INPUT_TYPE_JOYSTICK; + else if (strstr (temp, "Camera")) + msg->uibc_capability->generic_cap_list.inp_type |= + GST_WFD_UIBC_INPUT_TYPE_CAMERA; + else if (strstr (temp, "Gesture")) + msg->uibc_capability->generic_cap_list.inp_type |= + GST_WFD_UIBC_INPUT_TYPE_GESTURE; + else if (strstr (temp, "RemoteControl")) + msg->uibc_capability->generic_cap_list.inp_type |= + GST_WFD_UIBC_INPUT_TYPE_REMOTECONTROL; + else + msg->uibc_capability->generic_cap_list.inp_type |= + GST_WFD_UIBC_INPUT_TYPE_UNKNOWN; + } while (read_len < rem_len); + } + v = strstr (v, "hidc_cap_list"); + WFD_SKIP_SPACE (v); + WFD_READ_CHAR_END_STRING (tstring, '='); + if (!g_strcmp0 (tstring, "hidc_cap_list")) { + gchar temp[8192]; + gchar inp_type[8192]; + gchar inp_path[8192]; + guint rem_len, read_len = 0; + detailed_cap *temp_cap; + WFD_READ_CHAR_END_STRING (tstring, ';'); + rem_len = strlen (tstring); + msg->uibc_capability->hidc_cap_list.next = g_new0 (detailed_cap, 1); + temp_cap = msg->uibc_capability->hidc_cap_list.next; + do { + msg->uibc_capability->hidc_cap_list.cap_count++; + _read_string_char_ended (temp, 8192, ',', tstring + read_len); + read_len += (strlen (temp) + 1); + _read_string_attr_and_value (inp_type, inp_path, sizeof (inp_type), + sizeof (inp_path), '/', temp); + if (strstr (inp_type, "Keyboard")) + temp_cap->p.inp_type = GST_WFD_UIBC_INPUT_TYPE_KEYBOARD; + else if (strstr (inp_type, "Mouse")) + temp_cap->p.inp_type = GST_WFD_UIBC_INPUT_TYPE_MOUSE; + else if (strstr (inp_type, "SingleTouch")) + temp_cap->p.inp_type = GST_WFD_UIBC_INPUT_TYPE_SINGLETOUCH; + else if (strstr (inp_type, "MultiTouch")) + temp_cap->p.inp_type = GST_WFD_UIBC_INPUT_TYPE_MULTITOUCH; + else if (strstr (inp_type, "Joystick")) + temp_cap->p.inp_type = GST_WFD_UIBC_INPUT_TYPE_JOYSTICK; + else if (strstr (inp_type, "Camera")) + temp_cap->p.inp_type = GST_WFD_UIBC_INPUT_TYPE_CAMERA; + else if (strstr (inp_type, "Gesture")) + temp_cap->p.inp_type = GST_WFD_UIBC_INPUT_TYPE_GESTURE; + else if (strstr (inp_type, "RemoteControl")) + temp_cap->p.inp_type = GST_WFD_UIBC_INPUT_TYPE_REMOTECONTROL; + else + temp_cap->p.inp_type = GST_WFD_UIBC_INPUT_TYPE_UNKNOWN; + + if (strstr (inp_path, "Infrared")) + temp_cap->p.inp_path = GST_WFD_UIBC_INPUT_PATH_INFRARED; + else if (strstr (inp_path, "USB")) + temp_cap->p.inp_path = GST_WFD_UIBC_INPUT_PATH_USB; + else if (strstr (inp_path, "BT")) + temp_cap->p.inp_path = GST_WFD_UIBC_INPUT_PATH_BT; + else if (strstr (inp_path, "Zigbee")) + temp_cap->p.inp_path = GST_WFD_UIBC_INPUT_PATH_ZIGBEE; + else if (strstr (inp_path, "Wi-Fi")) + temp_cap->p.inp_path = GST_WFD_UIBC_INPUT_PATH_WIFI; + else if (strstr (inp_path, "No-SP")) + temp_cap->p.inp_path = GST_WFD_UIBC_INPUT_PATH_NOSP; + else + temp_cap->p.inp_path = GST_WFD_UIBC_INPUT_PATH_UNKNOWN; + if (read_len < rem_len) { + temp_cap->next = g_new0 (detailed_cap, 1); + temp_cap = temp_cap->next; + } + } while (read_len < rem_len); + } + if (strstr (v, "port")) { + v = strstr (v, "port"); + WFD_READ_CHAR_END_STRING (tstring, '='); + if (!g_strcmp0 (tstring, "port")) { + WFD_SKIP_EQUAL (v); + WFD_READ_CHAR_END_STRING (tstring, ';'); + if (!strstr (tstring, "none")) { + msg->uibc_capability->tcp_port = strtoul (tstring, NULL, 10); + } + } + } + } + } else if (strstr (v, "none")) { + msg->uibc_capability->uibcsupported = FALSE; + } + } else if (!g_strcmp0 (attr, "wfd_uibc_setting")) { + msg->uibc_setting = g_new0 (GstWFDUibcSetting, 1); + if (strlen (v)) { + WFD_SKIP_SPACE (v); + if (!g_strcmp0 (v, "enable")) + msg->uibc_setting->uibc_setting = TRUE; + else + msg->uibc_setting->uibc_setting = FALSE; + } + } else if (!g_strcmp0 (attr, "wfd_standby_resume_capability")) { + msg->standby_resume_capability = g_new0 (GstWFDStandbyResumeCapability, 1); + if (strlen (v)) { + WFD_SKIP_SPACE (v); + if (!g_strcmp0 (v, "supported")) + msg->standby_resume_capability->standby_resume_cap = TRUE; + else + msg->standby_resume_capability->standby_resume_cap = FALSE; + } + } else if (!g_strcmp0 (attr, "wfd_standby")) { + msg->standby = g_new0 (GstWFDStandby, 1); + msg->standby->wfd_standby = TRUE; + } else if (!g_strcmp0 (attr, "wfd_connector_type")) { + msg->connector_type = g_new0 (GstWFDConnectorType, 1); + if (strlen (v)) { + msg->connector_type->supported = TRUE; + WFD_SKIP_SPACE (v); + WFD_READ_UINT32 (msg->connector_type->connector_type); + } + } else if (!g_strcmp0 (attr, "wfd_idr_request")) { + msg->idr_request = g_new0 (GstWFDIdrRequest, 1); + msg->idr_request->idr_request = TRUE; + } + return; +} + +/** + * gst_wfd_message_parse_buffer: + * @data: the start of the buffer + * @size: the size of the buffer + * @msg: the result #GstSDPMessage + * + * Parse the contents of @size bytes pointed to by @data and store the result in + * @msg. + * + * Returns: #GST_SDP_OK on success. + */ +GstWFDResult +gst_wfd_message_parse_buffer (const guint8 * data, guint size, + GstWFDMessage * msg) +{ + gchar *p; + gchar buffer[255] = { 0 }; + guint idx = 0; + + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + g_return_val_if_fail (data != NULL, GST_WFD_EINVAL); + g_return_val_if_fail (size != 0, GST_WFD_EINVAL); + + p = (gchar *) data; + while (TRUE) { + + if (*p == '\0') + break; + + idx = 0; + while (*p != '\n' && *p != '\r' && *p != '\0') { + if (idx < sizeof (buffer) - 1) + buffer[idx++] = *p; + p++; + } + buffer[idx] = '\0'; + gst_wfd_parse_attribute (buffer, msg); + + if (*p == '\0') + break; + p += 2; + } + return GST_WFD_OK; +} + +/** + * gst_wfd_message_free: + * @msg: a #GstWFDMessage + * + * Free all resources allocated by @msg. @msg should not be used anymore after + * this function. This function should be used when @msg was dynamically + * allocated with gst_wfd_message_new(). + * + * Returns: a #GstWFDResult. + */ +GstWFDResult +gst_wfd_message_free (GstWFDMessage * msg) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + gst_wfd_message_uninit (msg); + g_free (msg); + + return GST_WFD_OK; +} + +/** + * gst_wfd_message_as_text: + * @msg: a #GstWFDMessage + * + * Convert the contents of @msg to a text string. + * + * Returns: A dynamically allocated string representing the WFD description. + */ +gchar * +gst_wfd_message_as_text (const GstWFDMessage * msg) +{ + /* change all vars so they match rfc? */ + GString *lines; + guint i; + + g_return_val_if_fail (msg != NULL, NULL); + + lines = g_string_new (""); + + /* list of audio codecs */ + if (msg->audio_codecs) { + g_string_append_printf (lines, "wfd_audio_codecs"); + if (msg->audio_codecs->list) { + g_string_append_printf (lines, ":"); + for (i = 0; i < msg->audio_codecs->count; i++) { + g_string_append_printf (lines, " %s", + msg->audio_codecs->list[i].audio_format); + g_string_append_printf (lines, " %08x", + msg->audio_codecs->list[i].modes); + g_string_append_printf (lines, " %02x", + msg->audio_codecs->list[i].latency); + if ((i + 1) < msg->audio_codecs->count) + g_string_append_printf (lines, ","); + } + } + g_string_append_printf (lines, "\r\n"); + } + + /* list of video codecs */ + if (msg->video_formats) { + g_string_append_printf (lines, "wfd_video_formats"); + if (msg->video_formats->list) { + g_string_append_printf (lines, ":"); + g_string_append_printf (lines, " %02x", msg->video_formats->list->native); + g_string_append_printf (lines, " %02x", + msg->video_formats->list->preferred_display_mode_supported); + g_string_append_printf (lines, " %02x", + msg->video_formats->list->H264_codec.profile); + g_string_append_printf (lines, " %02x", + msg->video_formats->list->H264_codec.level); + g_string_append_printf (lines, " %08x", + msg->video_formats->list->H264_codec.misc_params.CEA_Support); + g_string_append_printf (lines, " %08x", + msg->video_formats->list->H264_codec.misc_params.VESA_Support); + g_string_append_printf (lines, " %08x", + msg->video_formats->list->H264_codec.misc_params.HH_Support); + g_string_append_printf (lines, " %02x", + msg->video_formats->list->H264_codec.misc_params.latency); + g_string_append_printf (lines, " %04x", + msg->video_formats->list->H264_codec.misc_params.min_slice_size); + g_string_append_printf (lines, " %04x", + msg->video_formats->list->H264_codec.misc_params.slice_enc_params); + g_string_append_printf (lines, " %02x", + msg->video_formats->list->H264_codec. + misc_params.frame_rate_control_support); + + if (msg->video_formats->list->H264_codec.max_hres) + g_string_append_printf (lines, " %04x", + msg->video_formats->list->H264_codec.max_hres); + else + g_string_append_printf (lines, " none"); + + if (msg->video_formats->list->H264_codec.max_vres) + g_string_append_printf (lines, " %04x", + msg->video_formats->list->H264_codec.max_vres); + else + g_string_append_printf (lines, " none"); + } + g_string_append_printf (lines, "\r\n"); + } + + /* list of video 3D codecs */ + if (msg->video_3d_formats) { + g_string_append_printf (lines, "wfd_3d_video_formats"); + g_string_append_printf (lines, ":"); + if (msg->video_3d_formats->list) { + g_string_append_printf (lines, " %02x", + msg->video_3d_formats->list->native); + g_string_append_printf (lines, " %02x", + msg->video_3d_formats->list->preferred_display_mode_supported); + g_string_append_printf (lines, " %02x", + msg->video_3d_formats->list->H264_codec.profile); + g_string_append_printf (lines, " %02x", + msg->video_3d_formats->list->H264_codec.level); + g_string_append_printf (lines, " %16x", + msg->video_3d_formats->list->H264_codec. + misc_params.video_3d_capability); + g_string_append_printf (lines, " %02x", + msg->video_3d_formats->list->H264_codec.misc_params.latency); + g_string_append_printf (lines, " %04x", + msg->video_3d_formats->list->H264_codec.misc_params.min_slice_size); + g_string_append_printf (lines, " %04x", + msg->video_3d_formats->list->H264_codec.misc_params.slice_enc_params); + g_string_append_printf (lines, " %02x", + msg->video_3d_formats->list->H264_codec. + misc_params.frame_rate_control_support); + if (msg->video_3d_formats->list->H264_codec.max_hres) + g_string_append_printf (lines, " %04x", + msg->video_formats->list->H264_codec.max_hres); + else + g_string_append_printf (lines, " none"); + if (msg->video_3d_formats->list->H264_codec.max_vres) + g_string_append_printf (lines, " %04x", + msg->video_formats->list->H264_codec.max_vres); + else + g_string_append_printf (lines, " none"); + } else { + g_string_append_printf (lines, " none"); + } + g_string_append_printf (lines, "\r\n"); + } + + if (msg->content_protection) { + g_string_append_printf (lines, "wfd_content_protection"); + g_string_append_printf (lines, ":"); + if (msg->content_protection->hdcp2_spec) { + if (msg->content_protection->hdcp2_spec->hdcpversion) { + g_string_append_printf (lines, " %s", + msg->content_protection->hdcp2_spec->hdcpversion); + g_string_append_printf (lines, " %s", + msg->content_protection->hdcp2_spec->TCPPort); + } else { + g_string_append_printf (lines, " none"); + } + } else { + g_string_append_printf (lines, " none"); + } + g_string_append_printf (lines, "\r\n"); + } + + if (msg->display_edid) { + g_string_append_printf (lines, "wfd_display_edid"); + g_string_append_printf (lines, ":"); + if (msg->display_edid->edid_supported) { + g_string_append_printf (lines, " %d", msg->display_edid->edid_supported); + if (msg->display_edid->edid_block_count) + g_string_append_printf (lines, " %d", + msg->display_edid->edid_block_count); + else + g_string_append_printf (lines, " none"); + } else { + g_string_append_printf (lines, " none"); + } + g_string_append_printf (lines, "\r\n"); + } + + if (msg->coupled_sink) { + g_string_append_printf (lines, "wfd_coupled_sink"); + g_string_append_printf (lines, ":"); + if (msg->coupled_sink->coupled_sink_cap) { + g_string_append_printf (lines, " %02x", + msg->coupled_sink->coupled_sink_cap->status); + if (msg->coupled_sink->coupled_sink_cap->sink_address) + g_string_append_printf (lines, " %s", + msg->coupled_sink->coupled_sink_cap->sink_address); + else + g_string_append_printf (lines, " none"); + } else { + g_string_append_printf (lines, " none"); + } + g_string_append_printf (lines, "\r\n"); + } + + if (msg->trigger_method) { + g_string_append_printf (lines, "wfd_trigger_method"); + g_string_append_printf (lines, ":"); + g_string_append_printf (lines, " %s", + msg->trigger_method->wfd_trigger_method); + g_string_append_printf (lines, "\r\n"); + } + + if (msg->presentation_url) { + g_string_append_printf (lines, "wfd_presentation_URL"); + g_string_append_printf (lines, ":"); + if (msg->presentation_url->wfd_url0) + g_string_append_printf (lines, " %s", msg->presentation_url->wfd_url0); + else + g_string_append_printf (lines, " none"); + if (msg->presentation_url->wfd_url1) + g_string_append_printf (lines, " %s", msg->presentation_url->wfd_url1); + else + g_string_append_printf (lines, " none"); + g_string_append_printf (lines, "\r\n"); + } + + if (msg->client_rtp_ports) { + g_string_append_printf (lines, "wfd_client_rtp_ports"); + if (msg->client_rtp_ports->profile) { + g_string_append_printf (lines, ":"); + g_string_append_printf (lines, " %s", msg->client_rtp_ports->profile); + g_string_append_printf (lines, " %d", msg->client_rtp_ports->rtp_port0); + g_string_append_printf (lines, " %d", msg->client_rtp_ports->rtp_port1); + g_string_append_printf (lines, " %s", msg->client_rtp_ports->mode); + } + g_string_append_printf (lines, "\r\n"); + } + + if (msg->route) { + g_string_append_printf (lines, "wfd_route"); + g_string_append_printf (lines, ":"); + g_string_append_printf (lines, " %s", msg->route->destination); + g_string_append_printf (lines, "\r\n"); + } + + if (msg->I2C) { + g_string_append_printf (lines, "wfd_I2C"); + g_string_append_printf (lines, ":"); + if (msg->I2C->I2CPresent) + g_string_append_printf (lines, " %x", msg->I2C->I2C_port); + else + g_string_append_printf (lines, " none"); + g_string_append_printf (lines, "\r\n"); + } + + if (msg->av_format_change_timing) { + g_string_append_printf (lines, "wfd_av_format_change_timing"); + g_string_append_printf (lines, ":"); + g_string_append_printf (lines, " %10llu", + msg->av_format_change_timing->PTS); + g_string_append_printf (lines, " %10llu", + msg->av_format_change_timing->DTS); + g_string_append_printf (lines, "\r\n"); + } + + if (msg->preferred_display_mode) { + g_string_append_printf (lines, "wfd_preferred_display_mode"); + g_string_append_printf (lines, ":"); + if (msg->preferred_display_mode->displaymodesupported) { + g_string_append_printf (lines, " %06llu", + msg->preferred_display_mode->p_clock); + g_string_append_printf (lines, " %04x", msg->preferred_display_mode->H); + g_string_append_printf (lines, " %04x", msg->preferred_display_mode->HB); + g_string_append_printf (lines, " %04x", + msg->preferred_display_mode->HSPOL_HSOFF); + g_string_append_printf (lines, " %04x", msg->preferred_display_mode->HSW); + g_string_append_printf (lines, " %04x", msg->preferred_display_mode->V); + g_string_append_printf (lines, " %04x", msg->preferred_display_mode->VB); + g_string_append_printf (lines, " %04x", + msg->preferred_display_mode->VSPOL_VSOFF); + g_string_append_printf (lines, " %04x", msg->preferred_display_mode->VSW); + g_string_append_printf (lines, " %02x", + msg->preferred_display_mode->VBS3D); + g_string_append_printf (lines, " %02x", + msg->preferred_display_mode->V2d_s3d_modes); + g_string_append_printf (lines, " %02x", + msg->preferred_display_mode->P_depth); + } else + g_string_append_printf (lines, " none"); + g_string_append_printf (lines, "\r\n"); + } + + if (msg->uibc_capability) { + g_string_append_printf (lines, "wfd_uibc_capability"); + g_string_append_printf (lines, ":"); + if (msg->uibc_capability->uibcsupported) { + g_string_append_printf (lines, " input_category_list="); + if (msg->uibc_capability->input_category_list.input_cat) { + guint32 tempcap = 0; + if (msg->uibc_capability-> + input_category_list.input_cat & GST_WFD_UIBC_INPUT_CAT_GENERIC) { + tempcap |= GST_WFD_UIBC_INPUT_CAT_GENERIC; + g_string_append_printf (lines, "GENERIC"); + if (msg->uibc_capability->input_category_list.input_cat != tempcap) + g_string_append_printf (lines, ", "); + } + if (msg->uibc_capability-> + input_category_list.input_cat & GST_WFD_UIBC_INPUT_CAT_HIDC) { + tempcap |= GST_WFD_UIBC_INPUT_CAT_HIDC; + g_string_append_printf (lines, "HIDC"); + if (msg->uibc_capability->input_category_list.input_cat != tempcap) + g_string_append_printf (lines, ", "); + } + } else + g_string_append_printf (lines, "none"); + g_string_append_printf (lines, ";"); + g_string_append_printf (lines, " generic_cap_list="); + if (msg->uibc_capability->generic_cap_list.inp_type) { + guint32 tempcap = 0; + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_KEYBOARD) { + tempcap |= GST_WFD_UIBC_INPUT_TYPE_KEYBOARD; + g_string_append_printf (lines, "Keyboard"); + if (msg->uibc_capability->generic_cap_list.inp_type != tempcap) + g_string_append_printf (lines, ", "); + } + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_MOUSE) { + tempcap |= GST_WFD_UIBC_INPUT_TYPE_MOUSE; + g_string_append_printf (lines, "Mouse"); + if (msg->uibc_capability->generic_cap_list.inp_type != tempcap) + g_string_append_printf (lines, ", "); + } + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_SINGLETOUCH) { + tempcap |= GST_WFD_UIBC_INPUT_TYPE_SINGLETOUCH; + g_string_append_printf (lines, "SingleTouch"); + if (msg->uibc_capability->generic_cap_list.inp_type != tempcap) + g_string_append_printf (lines, ", "); + } + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_MULTITOUCH) { + tempcap |= GST_WFD_UIBC_INPUT_TYPE_MULTITOUCH; + g_string_append_printf (lines, "MultiTouch"); + if (msg->uibc_capability->generic_cap_list.inp_type != tempcap) + g_string_append_printf (lines, ", "); + } + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_JOYSTICK) { + tempcap |= GST_WFD_UIBC_INPUT_TYPE_JOYSTICK; + g_string_append_printf (lines, "Joystick"); + if (msg->uibc_capability->generic_cap_list.inp_type != tempcap) + g_string_append_printf (lines, ", "); + } + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_CAMERA) { + tempcap |= GST_WFD_UIBC_INPUT_TYPE_CAMERA; + g_string_append_printf (lines, "Camera"); + if (msg->uibc_capability->generic_cap_list.inp_type != tempcap) + g_string_append_printf (lines, ", "); + } + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_GESTURE) { + tempcap |= GST_WFD_UIBC_INPUT_TYPE_GESTURE; + g_string_append_printf (lines, "Gesture"); + if (msg->uibc_capability->generic_cap_list.inp_type != tempcap) + g_string_append_printf (lines, ", "); + } + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_REMOTECONTROL) { + tempcap |= GST_WFD_UIBC_INPUT_TYPE_REMOTECONTROL; + g_string_append_printf (lines, "RemoteControl"); + if (msg->uibc_capability->generic_cap_list.inp_type != tempcap) + g_string_append_printf (lines, ", "); + } + } else + g_string_append_printf (lines, "none"); + g_string_append_printf (lines, ";"); + g_string_append_printf (lines, " hidc_cap_list="); + if (msg->uibc_capability->hidc_cap_list.cap_count) { + detailed_cap *temp_cap = msg->uibc_capability->hidc_cap_list.next; + while (temp_cap) { + if (temp_cap->p.inp_type == GST_WFD_UIBC_INPUT_TYPE_KEYBOARD) + g_string_append_printf (lines, "Keyboard"); + else if (temp_cap->p.inp_type == GST_WFD_UIBC_INPUT_TYPE_MOUSE) + g_string_append_printf (lines, "Mouse"); + else if (temp_cap->p.inp_type == GST_WFD_UIBC_INPUT_TYPE_SINGLETOUCH) + g_string_append_printf (lines, "SingleTouch"); + else if (temp_cap->p.inp_type == GST_WFD_UIBC_INPUT_TYPE_MULTITOUCH) + g_string_append_printf (lines, "MultiTouch"); + else if (temp_cap->p.inp_type == GST_WFD_UIBC_INPUT_TYPE_JOYSTICK) + g_string_append_printf (lines, "Joystick"); + else if (temp_cap->p.inp_type == GST_WFD_UIBC_INPUT_TYPE_CAMERA) + g_string_append_printf (lines, "Camera"); + else if (temp_cap->p.inp_type == GST_WFD_UIBC_INPUT_TYPE_GESTURE) + g_string_append_printf (lines, "Gesture"); + else if (temp_cap->p.inp_type == + GST_WFD_UIBC_INPUT_TYPE_REMOTECONTROL) + g_string_append_printf (lines, "RemoteControl"); + g_string_append_printf (lines, "/"); + if (temp_cap->p.inp_path == GST_WFD_UIBC_INPUT_PATH_INFRARED) + g_string_append_printf (lines, "Infrared"); + else if (temp_cap->p.inp_path == GST_WFD_UIBC_INPUT_PATH_USB) + g_string_append_printf (lines, "USB"); + else if (temp_cap->p.inp_path == GST_WFD_UIBC_INPUT_PATH_BT) + g_string_append_printf (lines, "BT"); + else if (temp_cap->p.inp_path == GST_WFD_UIBC_INPUT_PATH_ZIGBEE) + g_string_append_printf (lines, "Zigbee"); + else if (temp_cap->p.inp_path == GST_WFD_UIBC_INPUT_PATH_WIFI) + g_string_append_printf (lines, "Wi-Fi"); + else if (temp_cap->p.inp_path == GST_WFD_UIBC_INPUT_PATH_NOSP) + g_string_append_printf (lines, "No-SP"); + temp_cap = temp_cap->next; + if (temp_cap) + g_string_append_printf (lines, ", "); + } + } else + g_string_append_printf (lines, "none"); + g_string_append_printf (lines, ";"); + if (msg->uibc_capability->tcp_port) + g_string_append_printf (lines, "port=%u", + msg->uibc_capability->tcp_port); + else + g_string_append_printf (lines, "port=none"); + } else + g_string_append_printf (lines, " none"); + g_string_append_printf (lines, "\r\n"); + } + + if (msg->uibc_setting) { + g_string_append_printf (lines, "wfd_uibc_setting"); + g_string_append_printf (lines, ":"); + if (msg->uibc_setting->uibc_setting) + g_string_append_printf (lines, " enable"); + else + g_string_append_printf (lines, " disable"); + g_string_append_printf (lines, "\r\n"); + } + + if (msg->standby_resume_capability) { + g_string_append_printf (lines, "wfd_standby_resume_capability"); + g_string_append_printf (lines, ":"); + if (msg->standby_resume_capability->standby_resume_cap) + g_string_append_printf (lines, " supported"); + else + g_string_append_printf (lines, " none"); + g_string_append_printf (lines, "\r\n"); + } + + if (msg->standby) { + g_string_append_printf (lines, "wfd_standby"); + g_string_append_printf (lines, "\r\n"); + } + + if (msg->connector_type) { + g_string_append_printf (lines, "wfd_connector_type"); + g_string_append_printf (lines, ":"); + if (msg->connector_type->connector_type) + g_string_append_printf (lines, " %02x", + msg->connector_type->connector_type); + else + g_string_append_printf (lines, " none"); + g_string_append_printf (lines, "\r\n"); + } + + if (msg->idr_request) { + g_string_append_printf (lines, "wfd_idr_request"); + g_string_append_printf (lines, "\r\n"); + } + + return g_string_free (lines, FALSE); +} + +gchar * +gst_wfd_message_param_names_as_text (const GstWFDMessage * msg) +{ + /* change all vars so they match rfc? */ + GString *lines; + g_return_val_if_fail (msg != NULL, NULL); + + lines = g_string_new (""); + + /* list of audio codecs */ + if (msg->audio_codecs) { + g_string_append_printf (lines, "wfd_audio_codecs"); + g_string_append_printf (lines, "\r\n"); + } + /* list of video codecs */ + if (msg->video_formats) { + g_string_append_printf (lines, "wfd_video_formats"); + g_string_append_printf (lines, "\r\n"); + } + /* list of video 3D codecs */ + if (msg->video_3d_formats) { + g_string_append_printf (lines, "wfd_3d_video_formats"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->content_protection) { + g_string_append_printf (lines, "wfd_content_protection"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->display_edid) { + g_string_append_printf (lines, "wfd_display_edid"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->coupled_sink) { + g_string_append_printf (lines, "wfd_coupled_sink"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->trigger_method) { + g_string_append_printf (lines, "wfd_trigger_method"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->presentation_url) { + g_string_append_printf (lines, "wfd_presentation_URL"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->client_rtp_ports) { + g_string_append_printf (lines, "wfd_client_rtp_ports"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->route) { + g_string_append_printf (lines, "wfd_route"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->I2C) { + g_string_append_printf (lines, "wfd_I2C"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->av_format_change_timing) { + g_string_append_printf (lines, "wfd_av_format_change_timing"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->preferred_display_mode) { + g_string_append_printf (lines, "wfd_preferred_display_mode"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->uibc_capability) { + g_string_append_printf (lines, "wfd_uibc_capability"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->uibc_setting) { + g_string_append_printf (lines, "wfd_uibc_setting"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->standby_resume_capability) { + g_string_append_printf (lines, "wfd_standby_resume_capability"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->standby) { + g_string_append_printf (lines, "wfd_standby"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->connector_type) { + g_string_append_printf (lines, "wfd_connector_type"); + g_string_append_printf (lines, "\r\n"); + } + if (msg->idr_request) { + g_string_append_printf (lines, "wfd_idr_request"); + g_string_append_printf (lines, "\r\n"); + } + + return g_string_free (lines, FALSE); +} + +/** + * gst_wfd_message_dump: + * @msg: a #GstWFDMessage + * + * Dump the parsed contents of @msg to stdout. + * + * Returns: a #GstWFDResult. + */ +GstWFDResult +gst_wfd_message_dump (const GstWFDMessage * msg) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + if (msg->audio_codecs) { + guint i = 0; + g_print ("Audio supported formats : \n"); + for (; i < msg->audio_codecs->count; i++) { + g_print ("Codec: %s\n", msg->audio_codecs->list[i].audio_format); + if (!strcmp (msg->audio_codecs->list[i].audio_format, "LPCM")) { + if (msg->audio_codecs->list[i].modes & GST_WFD_FREQ_44100) + g_print (" Freq: %d\n", 44100); + if (msg->audio_codecs->list[i].modes & GST_WFD_FREQ_48000) + g_print (" Freq: %d\n", 48000); + g_print (" Channels: %d\n", 2); + } + if (!strcmp (msg->audio_codecs->list[i].audio_format, "AAC")) { + g_print (" Freq: %d\n", 48000); + if (msg->audio_codecs->list[i].modes & GST_WFD_CHANNEL_2) + g_print (" Channels: %d\n", 2); + if (msg->audio_codecs->list[i].modes & GST_WFD_CHANNEL_4) + g_print (" Channels: %d\n", 4); + if (msg->audio_codecs->list[i].modes & GST_WFD_CHANNEL_6) + g_print (" Channels: %d\n", 6); + if (msg->audio_codecs->list[i].modes & GST_WFD_CHANNEL_8) + g_print (" Channels: %d\n", 8); + } + if (!strcmp (msg->audio_codecs->list[i].audio_format, "AC3")) { + g_print (" Freq: %d\n", 48000); + if (msg->audio_codecs->list[i].modes & GST_WFD_CHANNEL_2) + g_print (" Channels: %d\n", 2); + if (msg->audio_codecs->list[i].modes & GST_WFD_CHANNEL_4) + g_print (" Channels: %d\n", 4); + if (msg->audio_codecs->list[i].modes & GST_WFD_CHANNEL_6) + g_print (" Channels: %d\n", 6); + } + g_print (" Bitwidth: %d\n", 16); + g_print (" Latency: %d\n", msg->audio_codecs->list[i].latency); + } + } + + + if (msg->video_formats) { + g_print ("Video supported formats : \n"); + if (msg->video_formats->list) { + guint nativeindex = 0; + g_print ("Codec: H264\n"); + if ((msg->video_formats->list->native & 0x7) == + GST_WFD_VIDEO_CEA_RESOLUTION) { + g_print (" Native type: CEA\n"); + } else if ((msg->video_formats->list->native & 0x7) == + GST_WFD_VIDEO_VESA_RESOLUTION) { + g_print (" Native type: VESA\n"); + } else if ((msg->video_formats->list->native & 0x7) == + GST_WFD_VIDEO_HH_RESOLUTION) { + g_print (" Native type: HH\n"); + } + nativeindex = msg->video_formats->list->native >> 3; + g_print (" Resolution: %d\n", (1 << nativeindex)); + + if (msg->video_formats->list-> + H264_codec.profile & GST_WFD_H264_BASE_PROFILE) { + g_print (" Profile: BASE\n"); + } else if (msg->video_formats->list-> + H264_codec.profile & GST_WFD_H264_HIGH_PROFILE) { + g_print (" Profile: HIGH\n"); + } + if (msg->video_formats->list->H264_codec.level & GST_WFD_H264_LEVEL_3_1) { + g_print (" Level: 3.1\n"); + } else if (msg->video_formats->list-> + H264_codec.level & GST_WFD_H264_LEVEL_3_2) { + g_print (" Level: 3.2\n"); + } else if (msg->video_formats->list-> + H264_codec.level & GST_WFD_H264_LEVEL_4) { + g_print (" Level: 4\n"); + } else if (msg->video_formats->list-> + H264_codec.level & GST_WFD_H264_LEVEL_4_1) { + g_print (" Level: 4.1\n"); + } else if (msg->video_formats->list-> + H264_codec.level & GST_WFD_H264_LEVEL_4_2) { + g_print (" Level: 4.2\n"); + } + g_print (" Latency: %d\n", + msg->video_formats->list->H264_codec.misc_params.latency); + g_print (" min_slice_size: %x\n", + msg->video_formats->list->H264_codec.misc_params.min_slice_size); + g_print (" slice_enc_params: %x\n", + msg->video_formats->list->H264_codec.misc_params.slice_enc_params); + g_print (" frame_rate_control_support: %x\n", + msg->video_formats->list->H264_codec. + misc_params.frame_rate_control_support); + if (msg->video_formats->list->H264_codec.max_hres) { + g_print (" Max Height: %04d\n", + msg->video_formats->list->H264_codec.max_hres); + } + if (msg->video_formats->list->H264_codec.max_vres) { + g_print (" Max Width: %04d\n", + msg->video_formats->list->H264_codec.max_vres); + } + } + } + + if (msg->video_3d_formats) { + g_print ("wfd_3d_formats"); + g_print ("\r\n"); + } + + if (msg->content_protection) { + g_print ("wfd_content_protection"); + g_print ("\r\n"); + } + + if (msg->display_edid) { + g_print ("wfd_display_edid"); + g_print ("\r\n"); + } + + if (msg->coupled_sink) { + g_print ("wfd_coupled_sink"); + g_print ("\r\n"); + } + + if (msg->trigger_method) { + g_print (" Trigger type: %s\n", msg->trigger_method->wfd_trigger_method); + } + + if (msg->presentation_url) { + g_print ("wfd_presentation_URL"); + g_print ("\r\n"); + } + + if (msg->client_rtp_ports) { + g_print (" Client RTP Ports : \n"); + if (msg->client_rtp_ports->profile) { + g_print ("%s\n", msg->client_rtp_ports->profile); + g_print (" %d\n", msg->client_rtp_ports->rtp_port0); + g_print (" %d\n", msg->client_rtp_ports->rtp_port1); + g_print (" %s\n", msg->client_rtp_ports->mode); + } + g_print ("\r\n"); + } + + if (msg->route) { + g_print ("wfd_route"); + g_print ("\r\n"); + } + + if (msg->I2C) { + g_print ("wfd_I2C"); + g_print ("\r\n"); + } + + if (msg->av_format_change_timing) { + g_print ("wfd_av_format_change_timing"); + g_print ("\r\n"); + } + + if (msg->preferred_display_mode) { + g_print ("wfd_preferred_display_mode"); + g_print ("\r\n"); + } + + if (msg->uibc_capability) { + g_print ("wfd_uibc_capability \r\n"); + g_print ("input category list:"); + if (msg->uibc_capability-> + input_category_list.input_cat & GST_WFD_UIBC_INPUT_CAT_GENERIC) + g_print ("GENERIC"); + if (msg->uibc_capability-> + input_category_list.input_cat & GST_WFD_UIBC_INPUT_CAT_HIDC) + g_print ("HIDC"); + if (!msg->uibc_capability->input_category_list.input_cat) + g_print ("none"); + if (msg->uibc_capability-> + input_category_list.input_cat & GST_WFD_UIBC_INPUT_CAT_GENERIC) { + g_print ("generic cap list: "); + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_KEYBOARD) + g_print ("keyboard "); + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_MOUSE) + g_print ("mouse "); + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_SINGLETOUCH) + g_print ("single-touch "); + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_MULTITOUCH) + g_print ("multi-touch "); + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_JOYSTICK) + g_print ("joystick "); + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_CAMERA) + g_print ("camera "); + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_GESTURE) + g_print ("gesture "); + if (msg->uibc_capability-> + generic_cap_list.inp_type & GST_WFD_UIBC_INPUT_TYPE_REMOTECONTROL) + g_print ("remote control "); + if (!msg->uibc_capability->generic_cap_list.inp_type) + g_print ("none "); + } + if (msg->uibc_capability-> + input_category_list.input_cat & GST_WFD_UIBC_INPUT_CAT_HIDC) { + g_print ("hidc cap list:"); + if (msg->uibc_capability->hidc_cap_list.cap_count) { + detailed_cap *temp_cap = msg->uibc_capability->hidc_cap_list.next; + while (temp_cap) { + if (temp_cap->p.inp_type & GST_WFD_UIBC_INPUT_TYPE_KEYBOARD) { + g_print ("keyboard "); + } else if (temp_cap->p.inp_type & GST_WFD_UIBC_INPUT_TYPE_MOUSE) { + g_print ("mouse "); + } else if (temp_cap->p.inp_type & GST_WFD_UIBC_INPUT_TYPE_SINGLETOUCH) { + g_print ("single-touch "); + } else if (temp_cap->p.inp_type & GST_WFD_UIBC_INPUT_TYPE_MULTITOUCH) { + g_print ("multi-touch "); + } else if (temp_cap->p.inp_type & GST_WFD_UIBC_INPUT_TYPE_JOYSTICK) { + g_print ("joystick "); + } else if (temp_cap->p.inp_type & GST_WFD_UIBC_INPUT_TYPE_CAMERA) { + g_print ("camera "); + } else if (temp_cap->p.inp_type & GST_WFD_UIBC_INPUT_TYPE_GESTURE) { + g_print ("gesture "); + } else if (temp_cap-> + p.inp_type & GST_WFD_UIBC_INPUT_TYPE_REMOTECONTROL) { + g_print ("remote control "); + } else if (!temp_cap->p.inp_type) { + g_print ("none "); + } + if (temp_cap->p.inp_path & GST_WFD_UIBC_INPUT_PATH_INFRARED) { + g_print ("infrared"); + } else if (temp_cap->p.inp_path & GST_WFD_UIBC_INPUT_PATH_USB) { + g_print ("usb"); + } else if (temp_cap->p.inp_path & GST_WFD_UIBC_INPUT_PATH_BT) { + g_print ("bluetooth"); + } else if (temp_cap->p.inp_path & GST_WFD_UIBC_INPUT_PATH_WIFI) { + g_print ("Wi-Fi"); + } else if (temp_cap->p.inp_path & GST_WFD_UIBC_INPUT_PATH_ZIGBEE) { + g_print ("Zigbee"); + } else if (temp_cap->p.inp_path & GST_WFD_UIBC_INPUT_PATH_NOSP) { + g_print ("No-SP"); + } else if (!temp_cap->p.inp_path) { + g_print ("none"); + } + temp_cap = temp_cap->next; + } + } + } + if (msg->uibc_capability->tcp_port) + g_print ("tcp port:%u", msg->uibc_capability->tcp_port); + if (!msg->uibc_capability->tcp_port) + g_print ("tcp port: none"); + g_print ("\r\n"); + } + + if (msg->uibc_setting) { + g_print ("wfd_uibc_setting: "); + if (msg->uibc_setting->uibc_setting) { + g_print ("true"); + } else + g_print ("false"); + g_print ("\r\n"); + } + + if (msg->standby_resume_capability) { + g_print ("wfd_standby_resume_capability"); + g_print ("\r\n"); + } + + if (msg->standby) { + g_print ("wfd_standby"); + g_print ("\r\n"); + } + + if (msg->connector_type) { + g_print ("wfd_connector_type"); + g_print ("\r\n"); + } + + if (msg->idr_request) { + g_print ("wfd_idr_request"); + g_print ("\r\n"); + } + + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_set_supported_audio_format (GstWFDMessage * msg, + GstWFDAudioFormats a_codec, + guint a_freq, guint a_channels, guint a_bitwidth, guint32 a_latency) +{ + guint temp = a_codec; + guint i = 0; + guint pcm = 0, aac = 0, ac3 = 0; + + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + if (!msg->audio_codecs) + msg->audio_codecs = g_new0 (GstWFDAudioCodeclist, 1); + + if (a_codec != GST_WFD_AUDIO_UNKNOWN) { + while (temp) { + msg->audio_codecs->count++; + temp >>= 1; + } + msg->audio_codecs->list = + g_new0 (GstWFDAudioCodec, msg->audio_codecs->count); + for (; i < msg->audio_codecs->count; i++) { + if ((a_codec & GST_WFD_AUDIO_LPCM) && (!pcm)) { + msg->audio_codecs->list[i].audio_format = g_strdup ("LPCM"); + msg->audio_codecs->list[i].modes = a_freq; + msg->audio_codecs->list[i].latency = a_latency; + pcm = 1; + } else if ((a_codec & GST_WFD_AUDIO_AAC) && (!aac)) { + msg->audio_codecs->list[i].audio_format = g_strdup ("AAC"); + msg->audio_codecs->list[i].modes = a_channels; + msg->audio_codecs->list[i].latency = a_latency; + aac = 1; + } else if ((a_codec & GST_WFD_AUDIO_AC3) && (!ac3)) { + msg->audio_codecs->list[i].audio_format = g_strdup ("AC3"); + msg->audio_codecs->list[i].modes = a_channels; + msg->audio_codecs->list[i].latency = a_latency; + ac3 = 1; + } + } + } + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_set_prefered_audio_format (GstWFDMessage * msg, + GstWFDAudioFormats a_codec, + GstWFDAudioFreq a_freq, + GstWFDAudioChannels a_channels, guint a_bitwidth, guint32 a_latency) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + if (!msg->audio_codecs) + msg->audio_codecs = g_new0 (GstWFDAudioCodeclist, 1); + + msg->audio_codecs->list = g_new0 (GstWFDAudioCodec, 1); + msg->audio_codecs->count = 1; + if (a_codec == GST_WFD_AUDIO_LPCM) { + msg->audio_codecs->list->audio_format = g_strdup ("LPCM"); + msg->audio_codecs->list->modes = a_freq; + msg->audio_codecs->list->latency = a_latency; + } else if (a_codec == GST_WFD_AUDIO_AAC) { + msg->audio_codecs->list->audio_format = g_strdup ("AAC"); + msg->audio_codecs->list->modes = a_channels; + msg->audio_codecs->list->latency = a_latency; + } else if (a_codec == GST_WFD_AUDIO_AC3) { + msg->audio_codecs->list->audio_format = g_strdup ("AC3"); + msg->audio_codecs->list->modes = a_channels; + msg->audio_codecs->list->latency = a_latency; + } + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_get_supported_audio_format (GstWFDMessage * msg, + guint * a_codec, + guint * a_freq, guint * a_channels, guint * a_bitwidth, guint32 * a_latency) +{ + guint i = 0; + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + g_return_val_if_fail (msg->audio_codecs != NULL, GST_WFD_EINVAL); + + for (; i < msg->audio_codecs->count; i++) { + if (!g_strcmp0 (msg->audio_codecs->list[i].audio_format, "LPCM")) { + *a_codec |= GST_WFD_AUDIO_LPCM; + *a_freq |= msg->audio_codecs->list[i].modes; + *a_channels |= GST_WFD_CHANNEL_2; + *a_bitwidth = 16; + *a_latency = msg->audio_codecs->list[i].latency; + } else if (!g_strcmp0 (msg->audio_codecs->list[i].audio_format, "AAC")) { + *a_codec |= GST_WFD_AUDIO_AAC; + *a_freq |= GST_WFD_FREQ_48000; + *a_channels |= msg->audio_codecs->list[i].modes; + *a_bitwidth = 16; + *a_latency = msg->audio_codecs->list[i].latency; + } else if (!g_strcmp0 (msg->audio_codecs->list[i].audio_format, "AC3")) { + *a_codec |= GST_WFD_AUDIO_AC3; + *a_freq |= GST_WFD_FREQ_48000; + *a_channels |= msg->audio_codecs->list[i].modes; + *a_bitwidth = 16; + *a_latency = msg->audio_codecs->list[i].latency; + } + } + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_get_prefered_audio_format (GstWFDMessage * msg, + GstWFDAudioFormats * a_codec, + GstWFDAudioFreq * a_freq, + GstWFDAudioChannels * a_channels, guint * a_bitwidth, guint32 * a_latency) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + if (!g_strcmp0 (msg->audio_codecs->list->audio_format, "LPCM")) { + *a_codec = GST_WFD_AUDIO_LPCM; + *a_freq = msg->audio_codecs->list->modes; + *a_channels = GST_WFD_CHANNEL_2; + *a_bitwidth = 16; + *a_latency = msg->audio_codecs->list->latency; + } else if (!g_strcmp0 (msg->audio_codecs->list->audio_format, "AAC")) { + *a_codec = GST_WFD_AUDIO_AAC; + *a_freq = GST_WFD_FREQ_48000; + *a_channels = msg->audio_codecs->list->modes; + *a_bitwidth = 16; + *a_latency = msg->audio_codecs->list->latency; + } else if (!g_strcmp0 (msg->audio_codecs->list->audio_format, "AC3")) { + *a_codec = GST_WFD_AUDIO_AC3; + *a_freq = GST_WFD_FREQ_48000; + *a_channels = msg->audio_codecs->list->modes; + *a_bitwidth = 16; + *a_latency = msg->audio_codecs->list->latency; + } + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_set_supported_video_format (GstWFDMessage * msg, + GstWFDVideoCodecs v_codec, + GstWFDVideoNativeResolution v_native, + guint64 v_native_resolution, + guint64 v_cea_resolution, + guint64 v_vesa_resolution, + guint64 v_hh_resolution, + guint v_profile, + guint v_level, + guint32 v_latency, + guint32 v_max_height, + guint32 v_max_width, + guint32 min_slice_size, guint32 slice_enc_params, guint frame_rate_control) +{ + guint nativeindex = 0; + guint64 temp = v_native_resolution; + + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + if (!msg->video_formats) + msg->video_formats = g_new0 (GstWFDVideoCodeclist, 1); + + if (v_codec != GST_WFD_VIDEO_UNKNOWN) { + msg->video_formats->list = g_new0 (GstWFDVideoCodec, 1); + while (temp) { + nativeindex++; + temp >>= 1; + } + + msg->video_formats->list->native = nativeindex - 1; + msg->video_formats->list->native <<= 3; + + if (v_native == GST_WFD_VIDEO_VESA_RESOLUTION) + msg->video_formats->list->native |= 1; + else if (v_native == GST_WFD_VIDEO_HH_RESOLUTION) + msg->video_formats->list->native |= 2; + + msg->video_formats->list->preferred_display_mode_supported = 1; + msg->video_formats->list->H264_codec.profile = v_profile; + msg->video_formats->list->H264_codec.level = v_level; + msg->video_formats->list->H264_codec.max_hres = v_max_height; + msg->video_formats->list->H264_codec.max_vres = v_max_width; + msg->video_formats->list->H264_codec.misc_params.CEA_Support = + v_cea_resolution; + msg->video_formats->list->H264_codec.misc_params.VESA_Support = + v_vesa_resolution; + msg->video_formats->list->H264_codec.misc_params.HH_Support = + v_hh_resolution; + msg->video_formats->list->H264_codec.misc_params.latency = v_latency; + msg->video_formats->list->H264_codec.misc_params.min_slice_size = + min_slice_size; + msg->video_formats->list->H264_codec.misc_params.slice_enc_params = + slice_enc_params; + msg->video_formats->list->H264_codec. + misc_params.frame_rate_control_support = frame_rate_control; + } + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_set_prefered_video_format (GstWFDMessage * msg, + GstWFDVideoCodecs v_codec, + GstWFDVideoNativeResolution v_native, + guint64 v_native_resolution, + GstWFDVideoCEAResolution v_cea_resolution, + GstWFDVideoVESAResolution v_vesa_resolution, + GstWFDVideoHHResolution v_hh_resolution, + GstWFDVideoH264Profile v_profile, + GstWFDVideoH264Level v_level, + guint32 v_latency, + guint32 v_max_height, + guint32 v_max_width, + guint32 min_slice_size, guint32 slice_enc_params, guint frame_rate_control) +{ + guint nativeindex = 0; + guint64 temp = v_native_resolution; + + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + if (!msg->video_formats) + msg->video_formats = g_new0 (GstWFDVideoCodeclist, 1); + msg->video_formats->list = g_new0 (GstWFDVideoCodec, 1); + + while (temp) { + nativeindex++; + temp >>= 1; + } + + if (nativeindex) + msg->video_formats->list->native = nativeindex - 1; + msg->video_formats->list->native <<= 3; + + if (v_native == GST_WFD_VIDEO_VESA_RESOLUTION) + msg->video_formats->list->native |= 1; + else if (v_native == GST_WFD_VIDEO_HH_RESOLUTION) + msg->video_formats->list->native |= 2; + + msg->video_formats->list->preferred_display_mode_supported = 0; + msg->video_formats->list->H264_codec.profile = v_profile; + msg->video_formats->list->H264_codec.level = v_level; + msg->video_formats->list->H264_codec.max_hres = v_max_height; + msg->video_formats->list->H264_codec.max_vres = v_max_width; + msg->video_formats->list->H264_codec.misc_params.CEA_Support = + v_cea_resolution; + msg->video_formats->list->H264_codec.misc_params.VESA_Support = + v_vesa_resolution; + msg->video_formats->list->H264_codec.misc_params.HH_Support = v_hh_resolution; + msg->video_formats->list->H264_codec.misc_params.latency = v_latency; + msg->video_formats->list->H264_codec.misc_params.min_slice_size = + min_slice_size; + msg->video_formats->list->H264_codec.misc_params.slice_enc_params = + slice_enc_params; + msg->video_formats->list->H264_codec.misc_params.frame_rate_control_support = + frame_rate_control; + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_get_supported_video_format (GstWFDMessage * msg, + GstWFDVideoCodecs * v_codec, + GstWFDVideoNativeResolution * v_native, + guint64 * v_native_resolution, + guint64 * v_cea_resolution, + guint64 * v_vesa_resolution, + guint64 * v_hh_resolution, + guint * v_profile, + guint * v_level, + guint32 * v_latency, + guint32 * v_max_height, + guint32 * v_max_width, + guint32 * min_slice_size, + guint32 * slice_enc_params, guint * frame_rate_control) +{ + guint nativeindex = 0; + + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + *v_codec = GST_WFD_VIDEO_H264; + *v_native = msg->video_formats->list->native & 0x7; + nativeindex = msg->video_formats->list->native >> 3; + *v_native_resolution = 1 << nativeindex; + *v_profile = msg->video_formats->list->H264_codec.profile; + *v_level = msg->video_formats->list->H264_codec.level; + *v_max_height = msg->video_formats->list->H264_codec.max_hres; + *v_max_width = msg->video_formats->list->H264_codec.max_vres; + *v_cea_resolution = + msg->video_formats->list->H264_codec.misc_params.CEA_Support; + *v_vesa_resolution = + msg->video_formats->list->H264_codec.misc_params.VESA_Support; + *v_hh_resolution = + msg->video_formats->list->H264_codec.misc_params.HH_Support; + *v_latency = msg->video_formats->list->H264_codec.misc_params.latency; + *min_slice_size = + msg->video_formats->list->H264_codec.misc_params.min_slice_size; + *slice_enc_params = + msg->video_formats->list->H264_codec.misc_params.slice_enc_params; + *frame_rate_control = + msg->video_formats->list->H264_codec. + misc_params.frame_rate_control_support; + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_get_prefered_video_format (GstWFDMessage * msg, + GstWFDVideoCodecs * v_codec, + GstWFDVideoNativeResolution * v_native, + guint64 * v_native_resolution, + GstWFDVideoCEAResolution * v_cea_resolution, + GstWFDVideoVESAResolution * v_vesa_resolution, + GstWFDVideoHHResolution * v_hh_resolution, + GstWFDVideoH264Profile * v_profile, + GstWFDVideoH264Level * v_level, + guint32 * v_latency, + guint32 * v_max_height, + guint32 * v_max_width, + guint32 * min_slice_size, + guint32 * slice_enc_params, guint * frame_rate_control) +{ + guint nativeindex = 0; + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + *v_codec = GST_WFD_VIDEO_H264; + *v_native = msg->video_formats->list->native & 0x7; + nativeindex = msg->video_formats->list->native >> 3; + *v_native_resolution = 1 << nativeindex; + *v_profile = msg->video_formats->list->H264_codec.profile; + *v_level = msg->video_formats->list->H264_codec.level; + *v_max_height = msg->video_formats->list->H264_codec.max_hres; + *v_max_width = msg->video_formats->list->H264_codec.max_vres; + *v_cea_resolution = + msg->video_formats->list->H264_codec.misc_params.CEA_Support; + *v_vesa_resolution = + msg->video_formats->list->H264_codec.misc_params.VESA_Support; + *v_hh_resolution = + msg->video_formats->list->H264_codec.misc_params.HH_Support; + *v_latency = msg->video_formats->list->H264_codec.misc_params.latency; + *min_slice_size = + msg->video_formats->list->H264_codec.misc_params.min_slice_size; + *slice_enc_params = + msg->video_formats->list->H264_codec.misc_params.slice_enc_params; + *frame_rate_control = + msg->video_formats->list->H264_codec. + misc_params.frame_rate_control_support; + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_set_display_edid (GstWFDMessage * msg, + gboolean edid_supported, guint32 edid_blockcount, gchar * edid_playload) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + if (!msg->display_edid) + msg->display_edid = g_new0 (GstWFDDisplayEdid, 1); + msg->display_edid->edid_supported = edid_supported; + if (!edid_supported) + return GST_WFD_OK; + msg->display_edid->edid_block_count = edid_blockcount; + if (edid_blockcount) { + msg->display_edid->edid_payload = g_malloc (128 * edid_blockcount); + if (!msg->display_edid->edid_payload) + memcpy (msg->display_edid->edid_payload, edid_playload, + 128 * edid_blockcount); + } else + msg->display_edid->edid_payload = g_strdup ("none"); + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_get_display_edid (GstWFDMessage * msg, + gboolean * edid_supported, + guint32 * edid_blockcount, gchar ** edid_playload) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + if (msg->display_edid) { + if (msg->display_edid->edid_supported) { + *edid_blockcount = msg->display_edid->edid_block_count; + if (msg->display_edid->edid_block_count) { + char *temp; + temp = g_malloc (EDID_BLOCK_SIZE * msg->display_edid->edid_block_count); + if (temp) { + memset (temp, 0, + EDID_BLOCK_SIZE * msg->display_edid->edid_block_count); + memcpy (temp, msg->display_edid->edid_payload, + EDID_BLOCK_SIZE * msg->display_edid->edid_block_count); + *edid_playload = temp; + *edid_supported = TRUE; + } + } else + *edid_playload = g_strdup ("none"); + } + } else + *edid_supported = FALSE; + return GST_WFD_OK; +} + + +GstWFDResult +gst_wfd_message_set_contentprotection_type (GstWFDMessage * msg, + GstWFDHDCPProtection hdcpversion, guint32 TCPPort) +{ + char str[11] = { 0, }; + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + if (!msg->content_protection) + msg->content_protection = g_new0 (GstWFDContentProtection, 1); + if (hdcpversion == GST_WFD_HDCP_NONE) + return GST_WFD_OK; + msg->content_protection->hdcp2_spec = g_new0 (GstWFDHdcp2Spec, 1); + if (hdcpversion == GST_WFD_HDCP_2_0) + msg->content_protection->hdcp2_spec->hdcpversion = g_strdup ("HDCP2.0"); + else if (hdcpversion == GST_WFD_HDCP_2_1) + msg->content_protection->hdcp2_spec->hdcpversion = g_strdup ("HDCP2.1"); + snprintf (str, sizeof (str), "port=%d", TCPPort); + msg->content_protection->hdcp2_spec->TCPPort = g_strdup (str); + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_get_contentprotection_type (GstWFDMessage * msg, + GstWFDHDCPProtection * hdcpversion, guint32 * TCPPort) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + if (msg->content_protection && msg->content_protection->hdcp2_spec) { + char *result = NULL; + if (!g_strcmp0 (msg->content_protection->hdcp2_spec->hdcpversion, "none")) { + *hdcpversion = GST_WFD_HDCP_NONE; + *TCPPort = 0; + return GST_WFD_OK; + } + if (!g_strcmp0 (msg->content_protection->hdcp2_spec->hdcpversion, + "HDCP2.0")) + *hdcpversion = GST_WFD_HDCP_2_0; + else if (!g_strcmp0 (msg->content_protection->hdcp2_spec->hdcpversion, + "HDCP2.1")) + *hdcpversion = GST_WFD_HDCP_2_1; + else { + *hdcpversion = GST_WFD_HDCP_NONE; + *TCPPort = 0; + return GST_WFD_OK; + } + + result = strtok (msg->content_protection->hdcp2_spec->TCPPort, "="); + while (result != NULL) { + result = strtok (NULL, "="); + *TCPPort = atoi (result); + break; + } + } else + *hdcpversion = GST_WFD_HDCP_NONE; + return GST_WFD_OK; +} + + +GstWFDResult +gst_wfd_messge_set_prefered_rtp_ports (GstWFDMessage * msg, + GstWFDRTSPTransMode trans, + GstWFDRTSPProfile profile, + GstWFDRTSPLowerTrans lowertrans, guint32 rtp_port0, guint32 rtp_port1) +{ + GString *lines; + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + if (!msg->client_rtp_ports) + msg->client_rtp_ports = g_new0 (GstWFDClientRtpPorts, 1); + + if (trans != GST_WFD_RTSP_TRANS_UNKNOWN) { + lines = g_string_new (""); + if (trans == GST_WFD_RTSP_TRANS_RTP) + g_string_append_printf (lines, "RTP"); + else if (trans == GST_WFD_RTSP_TRANS_RDT) + g_string_append_printf (lines, "RDT"); + + if (profile == GST_WFD_RTSP_PROFILE_AVP) + g_string_append_printf (lines, "/AVP"); + else if (profile == GST_WFD_RTSP_PROFILE_SAVP) + g_string_append_printf (lines, "/SAVP"); + + if (lowertrans == GST_WFD_RTSP_LOWER_TRANS_UDP) + g_string_append_printf (lines, "/UDP;unicast"); + else if (lowertrans == GST_WFD_RTSP_LOWER_TRANS_UDP_MCAST) + g_string_append_printf (lines, "/UDP;multicast"); + else if (lowertrans == GST_WFD_RTSP_LOWER_TRANS_TCP) + g_string_append_printf (lines, "/TCP;unicast"); + else if (lowertrans == GST_WFD_RTSP_LOWER_TRANS_HTTP) + g_string_append_printf (lines, "/HTTP"); + + msg->client_rtp_ports->profile = g_string_free (lines, FALSE); + msg->client_rtp_ports->rtp_port0 = rtp_port0; + msg->client_rtp_ports->rtp_port1 = rtp_port1; + msg->client_rtp_ports->mode = g_strdup ("mode=play"); + } + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_get_prefered_rtp_ports (GstWFDMessage * msg, + GstWFDRTSPTransMode * trans, + GstWFDRTSPProfile * profile, + GstWFDRTSPLowerTrans * lowertrans, guint32 * rtp_port0, guint32 * rtp_port1) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + g_return_val_if_fail (msg->client_rtp_ports != NULL, GST_WFD_EINVAL); + + if (g_strrstr (msg->client_rtp_ports->profile, "RTP")) + *trans = GST_WFD_RTSP_TRANS_RTP; + if (g_strrstr (msg->client_rtp_ports->profile, "RDT")) + *trans = GST_WFD_RTSP_TRANS_RDT; + if (g_strrstr (msg->client_rtp_ports->profile, "AVP")) + *profile = GST_WFD_RTSP_PROFILE_AVP; + if (g_strrstr (msg->client_rtp_ports->profile, "SAVP")) + *profile = GST_WFD_RTSP_PROFILE_SAVP; + if (g_strrstr (msg->client_rtp_ports->profile, "UDP;unicast")) + *lowertrans = GST_WFD_RTSP_LOWER_TRANS_UDP; + if (g_strrstr (msg->client_rtp_ports->profile, "UDP;multicast")) + *lowertrans = GST_WFD_RTSP_LOWER_TRANS_UDP_MCAST; + if (g_strrstr (msg->client_rtp_ports->profile, "TCP;unicast")) + *lowertrans = GST_WFD_RTSP_LOWER_TRANS_TCP; + if (g_strrstr (msg->client_rtp_ports->profile, "HTTP")) + *lowertrans = GST_WFD_RTSP_LOWER_TRANS_HTTP; + + *rtp_port0 = msg->client_rtp_ports->rtp_port0; + *rtp_port1 = msg->client_rtp_ports->rtp_port1; + + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_set_presentation_url (GstWFDMessage * msg, gchar * wfd_url0, + gchar * wfd_url1) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + if (!msg->presentation_url) + msg->presentation_url = g_new0 (GstWFDPresentationUrl, 1); + if (wfd_url0) + msg->presentation_url->wfd_url0 = g_strdup (wfd_url0); + if (wfd_url1) + msg->presentation_url->wfd_url1 = g_strdup (wfd_url1); + return GST_WFD_OK; +} + +GstWFDResult +gst_wfd_message_get_presentation_url (GstWFDMessage * msg, gchar ** wfd_url0, + gchar ** wfd_url1) +{ + g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL); + + if (msg->presentation_url) { + *wfd_url0 = g_strdup (msg->presentation_url->wfd_url0); + *wfd_url1 = g_strdup (msg->presentation_url->wfd_url1); + } + return GST_WFD_OK; +} diff --git a/gst/rtsp-server/gstwfdmessage.h b/gst/rtsp-server/gstwfdmessage.h new file mode 100644 index 0000000..4de4811 --- /dev/null +++ b/gst/rtsp-server/gstwfdmessage.h @@ -0,0 +1,660 @@ +/* GStreamer + * Copyright (C) <2005,2006> Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/* + * Unless otherwise indicated, Source Code is licensed under MIT license. + * See further explanation attached in License Statement (distributed in the file + * LICENSE). + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished to do + * so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef __GST_WFD_MESSAGE_H__ +#define __GST_WFD_MESSAGE_H__ + +#include +#include + +G_BEGIN_DECLS + +/** + * GstWFDResult: + * @GST_WFD_OK: A successful return value + * @GST_WFD_EINVAL: a function was given invalid parameters + * + * Return values for the WFD functions. + */ +typedef enum { + GST_WFD_OK = 0, + GST_WFD_EINVAL = -1 +} GstWFDResult; + + +typedef enum { + GST_WFD_AUDIO_UNKNOWN = 0, + GST_WFD_AUDIO_LPCM = (1 << 0), + GST_WFD_AUDIO_AAC = (1 << 1), + GST_WFD_AUDIO_AC3 = (1 << 2) +} GstWFDAudioFormats; + +typedef enum { + GST_WFD_FREQ_UNKNOWN = 0, + GST_WFD_FREQ_44100 = (1 << 0), + GST_WFD_FREQ_48000 = (1 << 1) +} GstWFDAudioFreq; + +typedef enum { + GST_WFD_CHANNEL_UNKNOWN = 0, + GST_WFD_CHANNEL_2 = (1 << 0), + GST_WFD_CHANNEL_4 = (1 << 1), + GST_WFD_CHANNEL_6 = (1 << 2), + GST_WFD_CHANNEL_8 = (1 << 3) +} GstWFDAudioChannels; + + +typedef enum { + GST_WFD_VIDEO_UNKNOWN = 0, + GST_WFD_VIDEO_H264 = (1 << 0) +} GstWFDVideoCodecs; + +typedef enum { + GST_WFD_VIDEO_CEA_RESOLUTION = 0, + GST_WFD_VIDEO_VESA_RESOLUTION, + GST_WFD_VIDEO_HH_RESOLUTION +} GstWFDVideoNativeResolution; + +typedef enum { + GST_WFD_CEA_UNKNOWN = 0, + GST_WFD_CEA_640x480P60 = (1 << 0), + GST_WFD_CEA_720x480P60 = (1 << 1), + GST_WFD_CEA_720x480I60 = (1 << 2), + GST_WFD_CEA_720x576P50 = (1 << 3), + GST_WFD_CEA_720x576I50 = (1 << 4), + GST_WFD_CEA_1280x720P30 = (1 << 5), + GST_WFD_CEA_1280x720P60 = (1 << 6), + GST_WFD_CEA_1920x1080P30= (1 << 7), + GST_WFD_CEA_1920x1080P60= (1 << 8), + GST_WFD_CEA_1920x1080I60= (1 << 9), + GST_WFD_CEA_1280x720P25 = (1 << 10), + GST_WFD_CEA_1280x720P50 = (1 << 11), + GST_WFD_CEA_1920x1080P25= (1 << 12), + GST_WFD_CEA_1920x1080P50= (1 << 13), + GST_WFD_CEA_1920x1080I50= (1 << 14), + GST_WFD_CEA_1280x720P24 = (1 << 15), + GST_WFD_CEA_1920x1080P24= (1 << 16) +} GstWFDVideoCEAResolution; + +typedef enum { + GST_WFD_VESA_UNKNOWN = 0, + GST_WFD_VESA_800x600P30 = (1 << 0), + GST_WFD_VESA_800x600P60 = (1 << 1), + GST_WFD_VESA_1024x768P30 = (1 << 2), + GST_WFD_VESA_1024x768P60 = (1 << 3), + GST_WFD_VESA_1152x864P30 = (1 << 4), + GST_WFD_VESA_1152x864P60 = (1 << 5), + GST_WFD_VESA_1280x768P30 = (1 << 6), + GST_WFD_VESA_1280x768P60 = (1 << 7), + GST_WFD_VESA_1280x800P30 = (1 << 8), + GST_WFD_VESA_1280x800P60 = (1 << 9), + GST_WFD_VESA_1360x768P30 = (1 << 10), + GST_WFD_VESA_1360x768P60 = (1 << 11), + GST_WFD_VESA_1366x768P30 = (1 << 12), + GST_WFD_VESA_1366x768P60 = (1 << 13), + GST_WFD_VESA_1280x1024P30 = (1 << 14), + GST_WFD_VESA_1280x1024P60 = (1 << 15), + GST_WFD_VESA_1400x1050P30 = (1 << 16), + GST_WFD_VESA_1400x1050P60 = (1 << 17), + GST_WFD_VESA_1440x900P30 = (1 << 18), + GST_WFD_VESA_1440x900P60 = (1 << 19), + GST_WFD_VESA_1600x900P30 = (1 << 20), + GST_WFD_VESA_1600x900P60 = (1 << 21), + GST_WFD_VESA_1600x1200P30 = (1 << 22), + GST_WFD_VESA_1600x1200P60 = (1 << 23), + GST_WFD_VESA_1680x1024P30 = (1 << 24), + GST_WFD_VESA_1680x1024P60 = (1 << 25), + GST_WFD_VESA_1680x1050P30 = (1 << 26), + GST_WFD_VESA_1680x1050P60 = (1 << 27), + GST_WFD_VESA_1920x1200P30 = (1 << 28), + GST_WFD_VESA_1920x1200P60 = (1 << 29) +} GstWFDVideoVESAResolution; + +typedef enum { + GST_WFD_HH_UNKNOWN = 0, + GST_WFD_HH_800x480P30 = (1 << 0), + GST_WFD_HH_800x480P60 = (1 << 1), + GST_WFD_HH_854x480P30 = (1 << 2), + GST_WFD_HH_854x480P60 = (1 << 3), + GST_WFD_HH_864x480P30 = (1 << 4), + GST_WFD_HH_864x480P60 = (1 << 5), + GST_WFD_HH_640x360P30 = (1 << 6), + GST_WFD_HH_640x360P60 = (1 << 7), + GST_WFD_HH_960x540P30 = (1 << 8), + GST_WFD_HH_960x540P60 = (1 << 9), + GST_WFD_HH_848x480P30 = (1 << 10), + GST_WFD_HH_848x480P60 = (1 << 11) +} GstWFDVideoHHResolution; + +typedef enum { + GST_WFD_H264_UNKNOWN_PROFILE= 0, + GST_WFD_H264_BASE_PROFILE = (1 << 0), + GST_WFD_H264_HIGH_PROFILE = (1 << 1) +} GstWFDVideoH264Profile; + +typedef enum { + GST_WFD_H264_LEVEL_UNKNOWN = 0, + GST_WFD_H264_LEVEL_3_1 = (1 << 0), + GST_WFD_H264_LEVEL_3_2 = (1 << 1), + GST_WFD_H264_LEVEL_4 = (1 << 2), + GST_WFD_H264_LEVEL_4_1 = (1 << 3), + GST_WFD_H264_LEVEL_4_2 = (1 << 4) +} GstWFDVideoH264Level; + +typedef enum { + GST_WFD_HDCP_NONE = 0, + GST_WFD_HDCP_2_0 = (1 << 0), + GST_WFD_HDCP_2_1 = (1 << 1) +} GstWFDHDCPProtection; + +typedef enum { + GST_WFD_SINK_UNKNOWN = -1, + GST_WFD_SINK_NOT_COUPLED = 0, + GST_WFD_SINK_COUPLED, + GST_WFD_SINK_TEARDOWN_COUPLING, + GST_WFD_SINK_RESERVED +} GstWFDCoupledSinkStatus; + +typedef enum { + GST_WFD_TRIGGER_UNKNOWN = 0, + GST_WFD_TRIGGER_SETUP, + GST_WFD_TRIGGER_PAUSE, + GST_WFD_TRIGGER_TEARDOWN, + GST_WFD_TRIGGER_PLAY +} GstWFDTrigger; + +typedef enum { + GST_WFD_RTSP_TRANS_UNKNOWN = 0, + GST_WFD_RTSP_TRANS_RTP = (1 << 0), + GST_WFD_RTSP_TRANS_RDT = (1 << 1) +} GstWFDRTSPTransMode; + +typedef enum { + GST_WFD_RTSP_PROFILE_UNKNOWN = 0, + GST_WFD_RTSP_PROFILE_AVP = (1 << 0), + GST_WFD_RTSP_PROFILE_SAVP = (1 << 1) +} GstWFDRTSPProfile; + +typedef enum { + GST_WFD_RTSP_LOWER_TRANS_UNKNOWN = 0, + GST_WFD_RTSP_LOWER_TRANS_UDP = (1 << 0), + GST_WFD_RTSP_LOWER_TRANS_UDP_MCAST = (1 << 1), + GST_WFD_RTSP_LOWER_TRANS_TCP = (1 << 2), + GST_WFD_RTSP_LOWER_TRANS_HTTP = (1 << 3) +} GstWFDRTSPLowerTrans; + +typedef enum { + GST_WFD_PRIMARY_SINK = 0, + GST_WFD_SECONDARY_SINK +} GstWFDSinkType; + +typedef enum { + GST_WFD_UIBC_INPUT_CAT_UNKNOWN = 0, + GST_WFD_UIBC_INPUT_CAT_GENERIC = (1 << 0), + GST_WFD_UIBC_INPUT_CAT_HIDC = (1 << 1), +} GstWFDUibcinput_cat; + +typedef enum { + GST_WFD_UIBC_INPUT_TYPE_UNKNOWN = 0, + GST_WFD_UIBC_INPUT_TYPE_KEYBOARD = (1 << 0), + GST_WFD_UIBC_INPUT_TYPE_MOUSE = (1 << 1), + GST_WFD_UIBC_INPUT_TYPE_SINGLETOUCH = (1 << 2), + GST_WFD_UIBC_INPUT_TYPE_MULTITOUCH = (1 << 3), + GST_WFD_UIBC_INPUT_TYPE_JOYSTICK = (1 << 4), + GST_WFD_UIBC_INPUT_TYPE_CAMERA = (1 << 5), + GST_WFD_UIBC_INPUT_TYPE_GESTURE = (1 << 6), + GST_WFD_UIBC_INPUT_TYPE_REMOTECONTROL = (1 << 7) +} GstWFDUibcinp_type; + +typedef enum { + GST_WFD_UIBC_INPUT_PATH_UNKNOWN = 0, + GST_WFD_UIBC_INPUT_PATH_INFRARED = (1 << 0), + GST_WFD_UIBC_INPUT_PATH_USB = (1 << 1), + GST_WFD_UIBC_INPUT_PATH_BT = (1 << 2), + GST_WFD_UIBC_INPUT_PATH_ZIGBEE = (1 << 3), + GST_WFD_UIBC_INPUT_PATH_WIFI = (1 << 4), + GST_WFD_UIBC_INPUT_PATH_NOSP = (1 << 5) +} GstWFDUibcinp_path; + +typedef enum { + GST_WFD_CONNECTOR_VGA = 0, + GST_WFD_CONNECTOR_S, + GST_WFD_CONNECTOR_COMPOSITE, + GST_WFD_CONNECTOR_COMPONENT, + GST_WFD_CONNECTOR_DVI, + GST_WFD_CONNECTOR_HDMI, + GST_WFD_CONNECTOR_LVDS, + GST_WFD_CONNECTOR_RESERVED_7, + GST_WFD_CONNECTOR_JAPANESE_D, + GST_WFD_CONNECTOR_SDI, + GST_WFD_CONNECTOR_DP, + GST_WFD_CONNECTOR_RESERVED_11, + GST_WFD_CONNECTOR_UDI, + GST_WFD_CONNECTOR_NO = 254, + GST_WFD_CONNECTOR_PHYSICAL = 255 +} GstWFDConnector; + + +typedef struct { + gchar *audio_format; + guint32 modes; + guint latency; +} GstWFDAudioCodec; + +typedef struct { + guint count; + GstWFDAudioCodec *list; +} GstWFDAudioCodeclist; + + +typedef struct { + guint CEA_Support; + guint VESA_Support; + guint HH_Support; + guint latency; + guint min_slice_size; + guint slice_enc_params; + guint frame_rate_control_support; +} GstWFDVideoH264MiscParams; + +typedef struct { + guint profile; + guint level; + guint max_hres; + guint max_vres; + GstWFDVideoH264MiscParams misc_params; +} GstWFDVideoH264Codec; + +typedef struct { + guint native; + guint preferred_display_mode_supported; + GstWFDVideoH264Codec H264_codec; +} GstWFDVideoCodec; + +typedef struct { + guint count; + GstWFDVideoCodec *list; +} GstWFDVideoCodeclist; + +typedef struct { + guint video_3d_capability; + guint latency; + guint min_slice_size; + guint slice_enc_params; + guint frame_rate_control_support; +} GstWFD3DVideoH264MiscParams; + +typedef struct { + guint profile; + guint level; + GstWFD3DVideoH264MiscParams misc_params; + guint max_hres; + guint max_vres; +} GstWFD3DVideoH264Codec; + +typedef struct { + guint native; + guint preferred_display_mode_supported; + GstWFD3DVideoH264Codec H264_codec; +} GstWFD3dCapList; + +typedef struct { + guint count; + GstWFD3dCapList *list; +} GstWFD3DFormats; + +typedef struct { + gchar *hdcpversion; + gchar *TCPPort; +} GstWFDHdcp2Spec; + +typedef struct { + GstWFDHdcp2Spec *hdcp2_spec; +} GstWFDContentProtection; + +typedef struct { + guint edid_supported; + guint edid_block_count; + gchar *edid_payload; +} GstWFDDisplayEdid; + + +typedef struct { + guint status; + gchar *sink_address; +} GstWFDCoupled_sink_cap; + +typedef struct { + GstWFDCoupled_sink_cap *coupled_sink_cap; +} GstWFDCoupledSink; + +typedef struct { + gchar *wfd_trigger_method; +} GstWFDTriggerMethod; + +typedef struct { + gchar *wfd_url0; + gchar *wfd_url1; +} GstWFDPresentationUrl; + +typedef struct { + gchar *profile; + guint32 rtp_port0; + guint32 rtp_port1; + gchar *mode; +} GstWFDClientRtpPorts; + +typedef struct { + gchar *destination; +} GstWFDRoute; + +typedef struct { + gboolean I2CPresent; + guint32 I2C_port; +} GstWFDI2C; + +typedef struct { + guint64 PTS; + guint64 DTS; +} GstWFDAVFormatChangeTiming; + +typedef struct { + gboolean displaymodesupported; + guint64 p_clock; + guint32 H; + guint32 HB; + guint32 HSPOL_HSOFF; + guint32 HSW; + guint32 V; + guint32 VB; + guint32 VSPOL_VSOFF; + guint32 VSW; + guint VBS3D; + guint R; + guint V2d_s3d_modes; + guint P_depth; + GstWFDVideoH264Codec H264_codec; +} GstWFDPreferredDisplayMode; + +typedef struct { + guint32 input_cat; +} GstWFDInputCategoryList; + +typedef struct { + guint32 inp_type; +} GstWFDGenericCategoryList; + +typedef struct _detailed_cap detailed_cap; + +typedef struct { + GstWFDUibcinp_type inp_type; + GstWFDUibcinp_path inp_path; +} GstWFDHIDCTypePathPair; + +struct _detailed_cap { + GstWFDHIDCTypePathPair p; + detailed_cap *next; +}; + +typedef struct { + guint cap_count; + detailed_cap *next; +} GstWFDHIDCCategoryList; + +typedef struct { + gboolean uibcsupported; + GstWFDInputCategoryList input_category_list; + GstWFDGenericCategoryList generic_cap_list; + GstWFDHIDCCategoryList hidc_cap_list; + guint32 tcp_port; +} GstWFDUibcCapability; + +typedef struct { + gboolean uibc_setting; +} GstWFDUibcSetting; + +typedef struct { + gboolean standby_resume_cap; +} GstWFDStandbyResumeCapability; + +typedef struct { + gboolean wfd_standby; +} GstWFDStandby; + +typedef struct { + gboolean supported; + gint32 connector_type; +} GstWFDConnectorType; + +typedef struct { + gboolean idr_request; +} GstWFDIdrRequest; + +/** + * GstWFDMessage: + * @version: the protocol version + * @origin: owner/creator and session identifier + * @session_name: session name + * @information: session information + * @uri: URI of description + * @emails: array of #gchar with email addresses + * @phones: array of #gchar with phone numbers + * @connection: connection information for the session + * @bandwidths: array of #GstWFDBandwidth with bandwidth information + * @times: array of #GstWFDTime with time descriptions + * @zones: array of #GstWFDZone with time zone adjustments + * @key: encryption key + * @attributes: array of #GstWFDAttribute with session attributes + * @medias: array of #GstWFDMedia with media descriptions + * + * The contents of the WFD message. + */ +typedef struct { + GstWFDAudioCodeclist *audio_codecs; + GstWFDVideoCodeclist *video_formats; + GstWFD3DFormats *video_3d_formats; + GstWFDContentProtection *content_protection; + GstWFDDisplayEdid *display_edid; + GstWFDCoupledSink *coupled_sink; + GstWFDTriggerMethod *trigger_method; + GstWFDPresentationUrl *presentation_url; + GstWFDClientRtpPorts *client_rtp_ports; + GstWFDRoute *route; + GstWFDI2C *I2C; + GstWFDAVFormatChangeTiming *av_format_change_timing; + GstWFDPreferredDisplayMode *preferred_display_mode; + GstWFDUibcCapability *uibc_capability; + GstWFDUibcSetting *uibc_setting; + GstWFDStandbyResumeCapability *standby_resume_capability; + GstWFDStandby *standby; + GstWFDConnectorType *connector_type; + GstWFDIdrRequest *idr_request; +} GstWFDMessage; + +GType gst_wfd_message_get_type (void); + +#define GST_TYPE_WFD_MESSAGE (gst_wfd_message_get_type()) +#define GST_WFD_MESSAGE_CAST(object) ((GstWFDMessage *)(object)) +#define GST_WFD_MESSAGE(object) (GST_WFD_MESSAGE_CAST(object)) + +/* Session descriptions */ +GstWFDResult gst_wfd_message_new (GstWFDMessage **msg); +GstWFDResult gst_wfd_message_init (GstWFDMessage *msg); +GstWFDResult gst_wfd_message_uninit (GstWFDMessage *msg); +GstWFDResult gst_wfd_message_free (GstWFDMessage *msg); +GstWFDResult gst_wfd_message_copy (const GstWFDMessage *msg, GstWFDMessage **copy); + +GstWFDResult gst_wfd_message_parse_buffer (const guint8 *data, guint size, GstWFDMessage *msg); +gchar* gst_wfd_message_as_text (const GstWFDMessage *msg); +gchar* gst_wfd_message_param_names_as_text (const GstWFDMessage *msg); +GstWFDResult gst_wfd_message_dump (const GstWFDMessage *msg); + + +GstWFDResult gst_wfd_message_set_supported_audio_format(GstWFDMessage *msg, + GstWFDAudioFormats a_codec, + guint a_freq, guint a_channels, + guint a_bitwidth, guint32 a_latency); + +GstWFDResult gst_wfd_message_set_prefered_audio_format(GstWFDMessage *msg, + GstWFDAudioFormats a_codec, + GstWFDAudioFreq a_freq, + GstWFDAudioChannels a_channels, + guint a_bitwidth, guint32 a_latency); + +GstWFDResult gst_wfd_message_get_supported_audio_format (GstWFDMessage *msg, + guint *a_codec, + guint *a_freq, + guint *a_channels, + guint *a_bitwidth, + guint32 *a_latency); + +GstWFDResult gst_wfd_message_get_prefered_audio_format (GstWFDMessage *msg, + GstWFDAudioFormats *a_codec, + GstWFDAudioFreq *a_freq, + GstWFDAudioChannels *a_channels, + guint *a_bitwidth, guint32 *a_latency); + +GstWFDResult gst_wfd_message_set_supported_video_format (GstWFDMessage *msg, + GstWFDVideoCodecs v_codec, + GstWFDVideoNativeResolution v_native, + guint64 v_native_resolution, + guint64 v_cea_resolution, + guint64 v_vesa_resolution, + guint64 v_hh_resolution, + guint v_profile, + guint v_level, + guint32 v_latency, + guint32 v_max_height, + guint32 v_max_width, + guint32 min_slice_size, + guint32 slice_enc_params, + guint frame_rate_control); + +GstWFDResult gst_wfd_message_set_prefered_video_format(GstWFDMessage *msg, + GstWFDVideoCodecs v_codec, + GstWFDVideoNativeResolution v_native, + guint64 v_native_resolution, + GstWFDVideoCEAResolution v_cea_resolution, + GstWFDVideoVESAResolution v_vesa_resolution, + GstWFDVideoHHResolution v_hh_resolution, + GstWFDVideoH264Profile v_profile, + GstWFDVideoH264Level v_level, + guint32 v_latency, + guint32 v_max_height, + guint32 v_max_width, + guint32 min_slice_size, + guint32 slice_enc_params, + guint frame_rate_control); + +GstWFDResult gst_wfd_message_get_supported_video_format(GstWFDMessage *msg, + GstWFDVideoCodecs *v_codec, + GstWFDVideoNativeResolution *v_native, + guint64 *v_native_resolution, + guint64 *v_cea_resolution, + guint64 *v_vesa_resolution, + guint64 *v_hh_resolution, + guint *v_profile, + guint *v_level, + guint32 *v_latency, + guint32 *v_max_height, + guint32 *v_max_width, + guint32 *min_slice_size, + guint32 *slice_enc_params, + guint *frame_rate_control); + +GstWFDResult gst_wfd_message_get_prefered_video_format(GstWFDMessage *msg, + GstWFDVideoCodecs *v_codec, + GstWFDVideoNativeResolution *v_native, + guint64 *v_native_resolution, + GstWFDVideoCEAResolution *v_cea_resolution, + GstWFDVideoVESAResolution *v_vesa_resolution, + GstWFDVideoHHResolution *v_hh_resolution, + GstWFDVideoH264Profile *v_profile, + GstWFDVideoH264Level *v_level, + guint32 *v_latency, + guint32 *v_max_height, + guint32 *v_max_width, + guint32 *min_slice_size, + guint32 *slice_enc_params, + guint *frame_rate_control); + +GstWFDResult gst_wfd_message_set_display_edid (GstWFDMessage *msg, + gboolean edid_supported, + guint32 edid_blockcount, + gchar *edid_playload); + +GstWFDResult gst_wfd_message_get_display_edid (GstWFDMessage *msg, + gboolean *edid_supported, + guint32 *edid_blockcount, + gchar **edid_playload); + +GstWFDResult gst_wfd_message_set_contentprotection_type (GstWFDMessage *msg, + GstWFDHDCPProtection hdcpversion, + guint32 TCPPort); + +GstWFDResult gst_wfd_message_get_contentprotection_type (GstWFDMessage *msg, + GstWFDHDCPProtection *hdcpversion, + guint32 *TCPPort); + +GstWFDResult gst_wfd_messge_set_prefered_rtp_ports (GstWFDMessage *msg, + GstWFDRTSPTransMode trans, + GstWFDRTSPProfile profile, + GstWFDRTSPLowerTrans lowertrans, + guint32 rtp_port0, + guint32 rtp_port1); + +GstWFDResult gst_wfd_message_get_prefered_rtp_ports (GstWFDMessage *msg, + GstWFDRTSPTransMode *trans, + GstWFDRTSPProfile *profile, + GstWFDRTSPLowerTrans *lowertrans, + guint32 *rtp_port0, + guint32 *rtp_port1); + +GstWFDResult gst_wfd_message_set_presentation_url(GstWFDMessage *msg, + gchar *wfd_url0, gchar *wfd_url1); + +GstWFDResult gst_wfd_message_get_presentation_url(GstWFDMessage *msg, gchar **wfd_url0, + gchar **wfd_url1); + +G_END_DECLS + +#endif /* __GST_WFD_MESSAGE_H__ */ diff --git a/gst/rtsp-server/rtsp-address-pool.c b/gst/rtsp-server/rtsp-address-pool.c new file mode 100644 index 0000000..1343839 --- /dev/null +++ b/gst/rtsp-server/rtsp-address-pool.c @@ -0,0 +1,751 @@ +/* GStreamer + * Copyright (C) 2012 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-address-pool + * @short_description: A pool of network addresses + * @see_also: #GstRTSPStream, #GstRTSPStreamTransport + * + * The #GstRTSPAddressPool is an object that maintains a collection of network + * addresses. It is used to allocate server ports and server multicast addresses + * but also to reserve client provided destination addresses. + * + * A range of addresses can be added with gst_rtsp_address_pool_add_range(). + * Both multicast and unicast addresses can be added. + * + * With gst_rtsp_address_pool_acquire_address() an unused address and port range + * can be acquired from the pool. With gst_rtsp_address_pool_reserve_address() a + * specific address can be retrieved. Both methods return a boxed + * #GstRTSPAddress that should be freed with gst_rtsp_address_free() after + * usage, which brings the address back into the pool. + * + * Last reviewed on 2013-07-16 (1.0.0) + */ + +#include +#include + +#include "rtsp-address-pool.h" + +/** + * gst_rtsp_address_copy: + * @addr: a #GstRTSPAddress + * + * Make a copy of @addr. + * + * Returns: a copy of @addr. + */ +GstRTSPAddress * +gst_rtsp_address_copy (GstRTSPAddress * addr) +{ + GstRTSPAddress *copy; + + g_return_val_if_fail (addr != NULL, NULL); + + copy = g_slice_dup (GstRTSPAddress, addr); + /* only release to the pool when the original is freed. It's a bit + * weird but this will do for now as it avoid us to use refcounting. */ + copy->pool = NULL; + copy->address = g_strdup (copy->address); + + return copy; +} + +static void gst_rtsp_address_pool_release_address (GstRTSPAddressPool * pool, + GstRTSPAddress * addr); + +/** + * gst_rtsp_address_free: + * @addr: a #GstRTSPAddress + * + * Free @addr and releasing it back into the pool when owned by a + * pool. + */ +void +gst_rtsp_address_free (GstRTSPAddress * addr) +{ + g_return_if_fail (addr != NULL); + + if (addr->pool) { + /* unrefs the pool and sets it to NULL */ + gst_rtsp_address_pool_release_address (addr->pool, addr); + } + g_free (addr->address); + g_slice_free (GstRTSPAddress, addr); +} + +G_DEFINE_BOXED_TYPE (GstRTSPAddress, gst_rtsp_address, + (GBoxedCopyFunc) gst_rtsp_address_copy, + (GBoxedFreeFunc) gst_rtsp_address_free); + +GST_DEBUG_CATEGORY_STATIC (rtsp_address_pool_debug); +#define GST_CAT_DEFAULT rtsp_address_pool_debug + +#define GST_RTSP_ADDRESS_POOL_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_ADDRESS_POOL, GstRTSPAddressPoolPrivate)) + +struct _GstRTSPAddressPoolPrivate +{ + GMutex lock; /* protects everything in this struct */ + GList *addresses; + GList *allocated; + + gboolean has_unicast_addresses; +}; + +#define ADDR_IS_IPV4(a) ((a)->size == 4) +#define ADDR_IS_IPV6(a) ((a)->size == 16) +#define ADDR_IS_EVEN_PORT(a) (((a)->port & 1) == 0) + +typedef struct +{ + guint8 bytes[16]; + gsize size; + guint16 port; +} Addr; + +typedef struct +{ + Addr min; + Addr max; + guint8 ttl; +} AddrRange; + +#define RANGE_IS_SINGLE(r) (memcmp ((r)->min.bytes, (r)->max.bytes, (r)->min.size) == 0) + +#define gst_rtsp_address_pool_parent_class parent_class +G_DEFINE_TYPE (GstRTSPAddressPool, gst_rtsp_address_pool, G_TYPE_OBJECT); + +static void gst_rtsp_address_pool_finalize (GObject * obj); + +static void +gst_rtsp_address_pool_class_init (GstRTSPAddressPoolClass * klass) +{ + GObjectClass *gobject_class; + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = gst_rtsp_address_pool_finalize; + + g_type_class_add_private (klass, sizeof (GstRTSPAddressPoolPrivate)); + + GST_DEBUG_CATEGORY_INIT (rtsp_address_pool_debug, "rtspaddresspool", 0, + "GstRTSPAddressPool"); +} + +static void +gst_rtsp_address_pool_init (GstRTSPAddressPool * pool) +{ + pool->priv = GST_RTSP_ADDRESS_POOL_GET_PRIVATE (pool); + + g_mutex_init (&pool->priv->lock); +} + +static void +free_range (AddrRange * range) +{ + g_slice_free (AddrRange, range); +} + +static void +gst_rtsp_address_pool_finalize (GObject * obj) +{ + GstRTSPAddressPool *pool; + + pool = GST_RTSP_ADDRESS_POOL (obj); + + g_list_free_full (pool->priv->addresses, (GDestroyNotify) free_range); + g_list_free_full (pool->priv->allocated, (GDestroyNotify) free_range); + g_mutex_clear (&pool->priv->lock); + + G_OBJECT_CLASS (parent_class)->finalize (obj); +} + +/** + * gst_rtsp_address_pool_new: + * + * Make a new #GstRTSPAddressPool. + * + * Returns: (transfer full): a new #GstRTSPAddressPool + */ +GstRTSPAddressPool * +gst_rtsp_address_pool_new (void) +{ + GstRTSPAddressPool *pool; + + pool = g_object_new (GST_TYPE_RTSP_ADDRESS_POOL, NULL); + + return pool; +} + +/** + * gst_rtsp_address_pool_clear: + * @pool: a #GstRTSPAddressPool + * + * Clear all addresses in @pool. There should be no outstanding + * allocations. + */ +void +gst_rtsp_address_pool_clear (GstRTSPAddressPool * pool) +{ + GstRTSPAddressPoolPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_ADDRESS_POOL (pool)); + g_return_if_fail (pool->priv->allocated == NULL); + + priv = pool->priv; + + g_mutex_lock (&priv->lock); + g_list_free_full (priv->addresses, (GDestroyNotify) free_range); + priv->addresses = NULL; + g_mutex_unlock (&priv->lock); +} + +static gboolean +fill_address (const gchar * address, guint16 port, Addr * addr, + gboolean is_multicast) +{ + GInetAddress *inet; + + inet = g_inet_address_new_from_string (address); + if (inet == NULL) + return FALSE; + + if (is_multicast != g_inet_address_get_is_multicast (inet)) { + g_object_unref (inet); + return FALSE; + } + + addr->size = g_inet_address_get_native_size (inet); + memcpy (addr->bytes, g_inet_address_to_bytes (inet), addr->size); + g_object_unref (inet); + addr->port = port; + + return TRUE; +} + +static gchar * +get_address_string (Addr * addr) +{ + gchar *res; + GInetAddress *inet; + + inet = g_inet_address_new_from_bytes (addr->bytes, + addr->size == 4 ? G_SOCKET_FAMILY_IPV4 : G_SOCKET_FAMILY_IPV6); + res = g_inet_address_to_string (inet); + g_object_unref (inet); + + return res; +} + +/** + * gst_rtsp_address_pool_add_range: + * @pool: a #GstRTSPAddressPool + * @min_address: a minimum address to add + * @max_address: a maximum address to add + * @min_port: the minimum port + * @max_port: the maximum port + * @ttl: a TTL or 0 for unicast addresses + * + * Adds the addresses from @min_addess to @max_address (inclusive) + * to @pool. The valid port range for the addresses will be from @min_port to + * @max_port inclusive. + * + * When @ttl is 0, @min_address and @max_address should be unicast addresses. + * @min_address and @max_address can be set to + * #GST_RTSP_ADDRESS_POOL_ANY_IPV4 or #GST_RTSP_ADDRESS_POOL_ANY_IPV6 to bind + * to all available IPv4 or IPv6 addresses. + * + * When @ttl > 0, @min_address and @max_address should be multicast addresses. + * + * Returns: %TRUE if the addresses could be added. + */ +gboolean +gst_rtsp_address_pool_add_range (GstRTSPAddressPool * pool, + const gchar * min_address, const gchar * max_address, + guint16 min_port, guint16 max_port, guint8 ttl) +{ + AddrRange *range; + GstRTSPAddressPoolPrivate *priv; + gboolean is_multicast; + + g_return_val_if_fail (GST_IS_RTSP_ADDRESS_POOL (pool), FALSE); + g_return_val_if_fail (min_port <= max_port, FALSE); + + priv = pool->priv; + + is_multicast = ttl != 0; + + range = g_slice_new0 (AddrRange); + + if (!fill_address (min_address, min_port, &range->min, is_multicast)) + goto invalid; + if (!fill_address (max_address, max_port, &range->max, is_multicast)) + goto invalid; + + if (range->min.size != range->max.size) + goto invalid; + if (memcmp (range->min.bytes, range->max.bytes, range->min.size) > 0) + goto invalid; + + range->ttl = ttl; + + GST_DEBUG_OBJECT (pool, "adding %s-%s:%u-%u ttl %u", min_address, max_address, + min_port, max_port, ttl); + + g_mutex_lock (&priv->lock); + priv->addresses = g_list_prepend (priv->addresses, range); + + if (!is_multicast) + priv->has_unicast_addresses = TRUE; + g_mutex_unlock (&priv->lock); + + return TRUE; + + /* ERRORS */ +invalid: + { + GST_ERROR_OBJECT (pool, "invalid address range %s-%s", min_address, + max_address); + g_slice_free (AddrRange, range); + return FALSE; + } +} + +static void +inc_address (Addr * addr, guint count) +{ + gint i; + guint carry; + + carry = count; + for (i = addr->size - 1; i >= 0 && carry > 0; i--) { + carry += addr->bytes[i]; + addr->bytes[i] = carry & 0xff; + carry >>= 8; + } +} + +/* tells us the number of addresses between min_addr and max_addr */ +static guint +diff_address (Addr * max_addr, Addr * min_addr) +{ + gint i; + guint result = 0; + + g_return_val_if_fail (min_addr->size == max_addr->size, 0); + + for (i = 0; i < min_addr->size; i++) { + g_return_val_if_fail (result < (1 << 24), result); + + result <<= 8; + result += max_addr->bytes[i] - min_addr->bytes[i]; + } + + return result; +} + +static AddrRange * +split_range (GstRTSPAddressPool * pool, AddrRange * range, guint skip_addr, + guint skip_port, gint n_ports) +{ + GstRTSPAddressPoolPrivate *priv = pool->priv; + AddrRange *temp; + + if (skip_addr) { + temp = g_slice_dup (AddrRange, range); + memcpy (temp->max.bytes, temp->min.bytes, temp->min.size); + inc_address (&temp->max, skip_addr - 1); + priv->addresses = g_list_prepend (priv->addresses, temp); + + inc_address (&range->min, skip_addr); + } + + if (!RANGE_IS_SINGLE (range)) { + /* min and max are not the same, we have more than one address. */ + temp = g_slice_dup (AddrRange, range); + /* increment the range min address */ + inc_address (&temp->min, 1); + /* and store back in pool */ + priv->addresses = g_list_prepend (priv->addresses, temp); + + /* adjust range with only the first address */ + memcpy (range->max.bytes, range->min.bytes, range->min.size); + } + + /* range now contains only one single address */ + if (skip_port > 0) { + /* make a range with the skipped ports */ + temp = g_slice_dup (AddrRange, range); + temp->max.port = temp->min.port + skip_port - 1; + /* and store back in pool */ + priv->addresses = g_list_prepend (priv->addresses, temp); + + /* increment range port */ + range->min.port += skip_port; + } + /* range now contains single address with desired port number */ + if (range->max.port - range->min.port + 1 > n_ports) { + /* make a range with the remaining ports */ + temp = g_slice_dup (AddrRange, range); + temp->min.port += n_ports; + /* and store back in pool */ + priv->addresses = g_list_prepend (priv->addresses, temp); + + /* and truncate port */ + range->max.port = range->min.port + n_ports - 1; + } + return range; +} + +/** + * gst_rtsp_address_pool_acquire_address: + * @pool: a #GstRTSPAddressPool + * @flags: flags + * @n_ports: the amount of ports + * + * Take an address and ports from @pool. @flags can be used to control the + * allocation. @n_ports consecutive ports will be allocated of which the first + * one can be found in @port. + * + * Returns: (nullable): a #GstRTSPAddress that should be freed with + * gst_rtsp_address_free after use or %NULL when no address could be + * acquired. + */ +GstRTSPAddress * +gst_rtsp_address_pool_acquire_address (GstRTSPAddressPool * pool, + GstRTSPAddressFlags flags, gint n_ports) +{ + GstRTSPAddressPoolPrivate *priv; + GList *walk, *next; + AddrRange *result; + GstRTSPAddress *addr; + + g_return_val_if_fail (GST_IS_RTSP_ADDRESS_POOL (pool), NULL); + g_return_val_if_fail (n_ports > 0, NULL); + + priv = pool->priv; + result = NULL; + addr = NULL; + + g_mutex_lock (&priv->lock); + /* go over available ranges */ + for (walk = priv->addresses; walk; walk = next) { + AddrRange *range; + gint ports, skip; + + range = walk->data; + next = walk->next; + + /* check address type when given */ + if (flags & GST_RTSP_ADDRESS_FLAG_IPV4 && !ADDR_IS_IPV4 (&range->min)) + continue; + if (flags & GST_RTSP_ADDRESS_FLAG_IPV6 && !ADDR_IS_IPV6 (&range->min)) + continue; + if (flags & GST_RTSP_ADDRESS_FLAG_MULTICAST && range->ttl == 0) + continue; + if (flags & GST_RTSP_ADDRESS_FLAG_UNICAST && range->ttl != 0) + continue; + + /* check for enough ports */ + ports = range->max.port - range->min.port + 1; + if (flags & GST_RTSP_ADDRESS_FLAG_EVEN_PORT + && !ADDR_IS_EVEN_PORT (&range->min)) + skip = 1; + else + skip = 0; + if (ports - skip < n_ports) + continue; + + /* we found a range, remove from the list */ + priv->addresses = g_list_delete_link (priv->addresses, walk); + /* now split and exit our loop */ + result = split_range (pool, range, 0, skip, n_ports); + priv->allocated = g_list_prepend (priv->allocated, result); + break; + } + g_mutex_unlock (&priv->lock); + + if (result) { + addr = g_slice_new0 (GstRTSPAddress); + addr->pool = g_object_ref (pool); + addr->address = get_address_string (&result->min); + addr->n_ports = n_ports; + addr->port = result->min.port; + addr->ttl = result->ttl; + addr->priv = result; + + GST_DEBUG_OBJECT (pool, "got address %s:%u ttl %u", addr->address, + addr->port, addr->ttl); + } + + return addr; +} + +/** + * gst_rtsp_address_pool_release_address: + * @pool: a #GstRTSPAddressPool + * @id: an address id + * + * Release a previously acquired address (with + * gst_rtsp_address_pool_acquire_address()) back into @pool. + */ +static void +gst_rtsp_address_pool_release_address (GstRTSPAddressPool * pool, + GstRTSPAddress * addr) +{ + GstRTSPAddressPoolPrivate *priv; + GList *find; + AddrRange *range; + + g_return_if_fail (GST_IS_RTSP_ADDRESS_POOL (pool)); + g_return_if_fail (addr != NULL); + g_return_if_fail (addr->pool == pool); + + priv = pool->priv; + range = addr->priv; + + /* we don't want to free twice */ + addr->priv = NULL; + addr->pool = NULL; + + g_mutex_lock (&priv->lock); + find = g_list_find (priv->allocated, range); + if (find == NULL) + goto not_found; + + priv->allocated = g_list_delete_link (priv->allocated, find); + + /* FIXME, merge and do something clever */ + priv->addresses = g_list_prepend (priv->addresses, range); + g_mutex_unlock (&priv->lock); + + g_object_unref (pool); + + return; + + /* ERRORS */ +not_found: + { + g_warning ("Released unknown address %p", addr); + g_mutex_unlock (&priv->lock); + return; + } +} + +static void +dump_range (AddrRange * range, GstRTSPAddressPool * pool) +{ + gchar *addr1, *addr2; + + addr1 = get_address_string (&range->min); + addr2 = get_address_string (&range->max); + g_print (" address %s-%s, port %u-%u, ttl %u\n", addr1, addr2, + range->min.port, range->max.port, range->ttl); + g_free (addr1); + g_free (addr2); +} + +/** + * gst_rtsp_address_pool_dump: + * @pool: a #GstRTSPAddressPool + * + * Dump the free and allocated addresses to stdout. + */ +void +gst_rtsp_address_pool_dump (GstRTSPAddressPool * pool) +{ + GstRTSPAddressPoolPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_ADDRESS_POOL (pool)); + + priv = pool->priv; + + g_mutex_lock (&priv->lock); + g_print ("free:\n"); + g_list_foreach (priv->addresses, (GFunc) dump_range, pool); + g_print ("allocated:\n"); + g_list_foreach (priv->allocated, (GFunc) dump_range, pool); + g_mutex_unlock (&priv->lock); +} + +static GList * +find_address_in_ranges (GList * addresses, Addr * addr, guint port, + guint n_ports, guint ttl) +{ + GList *walk, *next; + + /* go over available ranges */ + for (walk = addresses; walk; walk = next) { + AddrRange *range; + + range = walk->data; + next = walk->next; + + /* Not the right type of address */ + if (range->min.size != addr->size) + continue; + + /* Check that the address is in the interval */ + if (memcmp (range->min.bytes, addr->bytes, addr->size) > 0 || + memcmp (range->max.bytes, addr->bytes, addr->size) < 0) + continue; + + /* Make sure the requested ports are inside the range */ + if (port < range->min.port || port + n_ports - 1 > range->max.port) + continue; + + if (ttl != range->ttl) + continue; + + break; + } + + return walk; +} + +/** + * gst_rtsp_address_pool_reserve_address: + * @pool: a #GstRTSPAddressPool + * @ip_address: The IP address to reserve + * @port: The first port to reserve + * @n_ports: The number of ports + * @ttl: The requested ttl + * @address: (out): storage for a #GstRTSPAddress + * + * Take a specific address and ports from @pool. @n_ports consecutive + * ports will be allocated of which the first one can be found in + * @port. + * + * If @ttl is 0, @address should be a unicast address. If @ttl > 0, @address + * should be a valid multicast address. + * + * Returns: #GST_RTSP_ADDRESS_POOL_OK if an address was reserved. The address + * is returned in @address and should be freed with gst_rtsp_address_free + * after use. + */ +GstRTSPAddressPoolResult +gst_rtsp_address_pool_reserve_address (GstRTSPAddressPool * pool, + const gchar * ip_address, guint port, guint n_ports, guint ttl, + GstRTSPAddress ** address) +{ + GstRTSPAddressPoolPrivate *priv; + Addr input_addr; + GList *list; + AddrRange *addr_range; + GstRTSPAddress *addr; + gboolean is_multicast; + GstRTSPAddressPoolResult result; + + g_return_val_if_fail (GST_IS_RTSP_ADDRESS_POOL (pool), + GST_RTSP_ADDRESS_POOL_EINVAL); + g_return_val_if_fail (ip_address != NULL, GST_RTSP_ADDRESS_POOL_EINVAL); + g_return_val_if_fail (port > 0, GST_RTSP_ADDRESS_POOL_EINVAL); + g_return_val_if_fail (n_ports > 0, GST_RTSP_ADDRESS_POOL_EINVAL); + g_return_val_if_fail (address != NULL, GST_RTSP_ADDRESS_POOL_EINVAL); + + priv = pool->priv; + addr_range = NULL; + addr = NULL; + is_multicast = ttl != 0; + + if (!fill_address (ip_address, port, &input_addr, is_multicast)) + goto invalid; + + g_mutex_lock (&priv->lock); + list = find_address_in_ranges (priv->addresses, &input_addr, port, n_ports, + ttl); + if (list != NULL) { + AddrRange *range = list->data; + guint skip_port, skip_addr; + + skip_addr = diff_address (&input_addr, &range->min); + skip_port = port - range->min.port; + + GST_DEBUG_OBJECT (pool, "diff 0x%08x/%u", skip_addr, skip_port); + + /* we found a range, remove from the list */ + priv->addresses = g_list_delete_link (priv->addresses, list); + /* now split and exit our loop */ + addr_range = split_range (pool, range, skip_addr, skip_port, n_ports); + priv->allocated = g_list_prepend (priv->allocated, addr_range); + } + + if (addr_range) { + addr = g_slice_new0 (GstRTSPAddress); + addr->pool = g_object_ref (pool); + addr->address = get_address_string (&addr_range->min); + addr->n_ports = n_ports; + addr->port = addr_range->min.port; + addr->ttl = addr_range->ttl; + addr->priv = addr_range; + + result = GST_RTSP_ADDRESS_POOL_OK; + GST_DEBUG_OBJECT (pool, "reserved address %s:%u ttl %u", addr->address, + addr->port, addr->ttl); + } else { + /* We failed to reserve the address. Check if it was because the address + * was already in use or if it wasn't in the pool to begin with */ + list = find_address_in_ranges (priv->allocated, &input_addr, port, n_ports, + ttl); + if (list != NULL) { + result = GST_RTSP_ADDRESS_POOL_ERESERVED; + } else { + result = GST_RTSP_ADDRESS_POOL_ERANGE; + } + } + g_mutex_unlock (&priv->lock); + + *address = addr; + return result; + + /* ERRORS */ +invalid: + { + GST_ERROR_OBJECT (pool, "invalid address %s:%u/%u/%u", ip_address, + port, n_ports, ttl); + *address = NULL; + return GST_RTSP_ADDRESS_POOL_EINVAL; + } +} + +/** + * gst_rtsp_address_pool_has_unicast_addresses: + * @pool: a #GstRTSPAddressPool + * + * Used to know if the pool includes any unicast addresses. + * + * Returns: %TRUE if the pool includes any unicast addresses, %FALSE otherwise + */ + +gboolean +gst_rtsp_address_pool_has_unicast_addresses (GstRTSPAddressPool * pool) +{ + GstRTSPAddressPoolPrivate *priv; + gboolean has_unicast_addresses; + + g_return_val_if_fail (GST_IS_RTSP_ADDRESS_POOL (pool), FALSE); + + priv = pool->priv; + + g_mutex_lock (&priv->lock); + has_unicast_addresses = priv->has_unicast_addresses; + g_mutex_unlock (&priv->lock); + + return has_unicast_addresses; +} diff --git a/gst/rtsp-server/rtsp-address-pool.h b/gst/rtsp-server/rtsp-address-pool.h new file mode 100644 index 0000000..a473bdf --- /dev/null +++ b/gst/rtsp-server/rtsp-address-pool.h @@ -0,0 +1,182 @@ +/* GStreamer + * Copyright (C) 2012 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#ifndef __GST_RTSP_ADDRESS_POOL_H__ +#define __GST_RTSP_ADDRESS_POOL_H__ + +G_BEGIN_DECLS + +#define GST_TYPE_RTSP_ADDRESS_POOL (gst_rtsp_address_pool_get_type ()) +#define GST_IS_RTSP_ADDRESS_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_ADDRESS_POOL)) +#define GST_IS_RTSP_ADDRESS_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_ADDRESS_POOL)) +#define GST_RTSP_ADDRESS_POOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_ADDRESS_POOL, GstRTSPAddressPoolClass)) +#define GST_RTSP_ADDRESS_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_ADDRESS_POOL, GstRTSPAddressPool)) +#define GST_RTSP_ADDRESS_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_ADDRESS_POOL, GstRTSPAddressPoolClass)) +#define GST_RTSP_ADDRESS_POOL_CAST(obj) ((GstRTSPAddressPool*)(obj)) +#define GST_RTSP_ADDRESS_POOL_CLASS_CAST(klass) ((GstRTSPAddressPoolClass*)(klass)) + +/** + * GstRTSPAddressPoolResult: + * @GST_RTSP_ADDRESS_POOL_OK: no error + * @GST_RTSP_ADDRESS_POOL_EINVAL:invalid arguments were provided to a function + * @GST_RTSP_ADDRESS_POOL_ERESERVED: the addres has already been reserved + * @GST_RTSP_ADDRESS_POOL_ERANGE: the address is not in the pool + * @GST_RTSP_ADDRESS_POOL_ELAST: last error + * + * Result codes from RTSP address pool functions. + */ +typedef enum { + GST_RTSP_ADDRESS_POOL_OK = 0, + /* errors */ + GST_RTSP_ADDRESS_POOL_EINVAL = -1, + GST_RTSP_ADDRESS_POOL_ERESERVED = -2, + GST_RTSP_ADDRESS_POOL_ERANGE = -3, + + GST_RTSP_ADDRESS_POOL_ELAST = -4, +} GstRTSPAddressPoolResult; + + +typedef struct _GstRTSPAddress GstRTSPAddress; + +typedef struct _GstRTSPAddressPool GstRTSPAddressPool; +typedef struct _GstRTSPAddressPoolClass GstRTSPAddressPoolClass; +typedef struct _GstRTSPAddressPoolPrivate GstRTSPAddressPoolPrivate; + +/** + * GstRTSPAddress: + * @pool: the #GstRTSPAddressPool owner of this address + * @address: the address + * @port: the port number + * @n_ports: number of ports + * @ttl: TTL or 0 for unicast addresses + * + * An address + */ +struct _GstRTSPAddress { + GstRTSPAddressPool *pool; + + gchar *address; + guint16 port; + gint n_ports; + guint8 ttl; + + /**/ + gpointer priv; +}; + +GType gst_rtsp_address_get_type (void); + +GstRTSPAddress * gst_rtsp_address_copy (GstRTSPAddress *addr); +void gst_rtsp_address_free (GstRTSPAddress *addr); + +/** + * GstRTSPAddressFlags: + * @GST_RTSP_ADDRESS_FLAG_NONE: no flags + * @GST_RTSP_ADDRESS_FLAG_IPV4: an IPv4 address + * @GST_RTSP_ADDRESS_FLAG_IPV6: and IPv6 address + * @GST_RTSP_ADDRESS_FLAG_EVEN_PORT: address with an even port + * @GST_RTSP_ADDRESS_FLAG_MULTICAST: a multicast address + * @GST_RTSP_ADDRESS_FLAG_UNICAST: a unicast address + * + * Flags used to control allocation of addresses + */ +typedef enum { + GST_RTSP_ADDRESS_FLAG_NONE = 0, + GST_RTSP_ADDRESS_FLAG_IPV4 = (1 << 0), + GST_RTSP_ADDRESS_FLAG_IPV6 = (1 << 1), + GST_RTSP_ADDRESS_FLAG_EVEN_PORT = (1 << 2), + GST_RTSP_ADDRESS_FLAG_MULTICAST = (1 << 3), + GST_RTSP_ADDRESS_FLAG_UNICAST = (1 << 4), +} GstRTSPAddressFlags; + +/** + * GST_RTSP_ADDRESS_POOL_ANY_IPV4: + * + * Used with gst_rtsp_address_pool_add_range() to bind to all + * IPv4 addresses + */ +#define GST_RTSP_ADDRESS_POOL_ANY_IPV4 "0.0.0.0" + +/** + * GST_RTSP_ADDRESS_POOL_ANY_IPV6: + * + * Used with gst_rtsp_address_pool_add_range() to bind to all + * IPv6 addresses + */ +#define GST_RTSP_ADDRESS_POOL_ANY_IPV6 "::" + +/** + * GstRTSPAddressPool: + * @parent: the parent GObject + * + * An address pool, all member are private + */ +struct _GstRTSPAddressPool { + GObject parent; + + /*< private >*/ + GstRTSPAddressPoolPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPAddressPoolClass: + * + * Opaque Address pool class. + */ +struct _GstRTSPAddressPoolClass { + GObjectClass parent_class; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +GType gst_rtsp_address_pool_get_type (void); + +/* create a new address pool */ +GstRTSPAddressPool * gst_rtsp_address_pool_new (void); + +void gst_rtsp_address_pool_clear (GstRTSPAddressPool * pool); +void gst_rtsp_address_pool_dump (GstRTSPAddressPool * pool); + +gboolean gst_rtsp_address_pool_add_range (GstRTSPAddressPool * pool, + const gchar *min_address, + const gchar *max_address, + guint16 min_port, + guint16 max_port, + guint8 ttl); + +GstRTSPAddress * gst_rtsp_address_pool_acquire_address (GstRTSPAddressPool * pool, + GstRTSPAddressFlags flags, + gint n_ports); + +GstRTSPAddressPoolResult gst_rtsp_address_pool_reserve_address (GstRTSPAddressPool * pool, + const gchar *ip_address, + guint port, + guint n_ports, + guint ttl, + GstRTSPAddress ** address); + +gboolean gst_rtsp_address_pool_has_unicast_addresses (GstRTSPAddressPool * pool); + +G_END_DECLS + +#endif /* __GST_RTSP_ADDRESS_POOL_H__ */ diff --git a/gst/rtsp-server/rtsp-auth.c b/gst/rtsp-server/rtsp-auth.c new file mode 100644 index 0000000..b0e924e --- /dev/null +++ b/gst/rtsp-server/rtsp-auth.c @@ -0,0 +1,636 @@ +/* GStreamer + * Copyright (C) 2010 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-auth + * @short_description: Authentication and authorization + * @see_also: #GstRTSPPermissions, #GstRTSPToken + * + * The #GstRTSPAuth object is responsible for checking if the current user is + * allowed to perform requested actions. The default implementation has some + * reasonable checks but subclasses can implement custom security policies. + * + * A new auth object is made with gst_rtsp_auth_new(). It is usually configured + * on the #GstRTSPServer object. + * + * The RTSP server will call gst_rtsp_auth_check() with a string describing the + * check to perform. The possible checks are prefixed with + * GST_RTSP_AUTH_CHECK_*. Depending on the check, the default implementation + * will use the current #GstRTSPToken, #GstRTSPContext and + * #GstRTSPPermissions on the object to check if an operation is allowed. + * + * The default #GstRTSPAuth object has support for basic authentication. With + * gst_rtsp_auth_add_basic() you can add a basic authentication string together + * with the #GstRTSPToken that will become active when successfully + * authenticated. + * + * When a TLS certificate has been set with gst_rtsp_auth_set_tls_certificate(), + * the default auth object will require the client to connect with a TLS + * connection. + * + * Last reviewed on 2013-07-16 (1.0.0) + */ + +#include + +#include "rtsp-auth.h" + +#define GST_RTSP_AUTH_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_AUTH, GstRTSPAuthPrivate)) + +struct _GstRTSPAuthPrivate +{ + GMutex lock; + + /* the TLS certificate */ + GTlsCertificate *certificate; + GHashTable *basic; /* protected by lock */ + GstRTSPToken *default_token; + GstRTSPMethod methods; +}; + +enum +{ + PROP_0, + PROP_LAST +}; + +GST_DEBUG_CATEGORY_STATIC (rtsp_auth_debug); +#define GST_CAT_DEFAULT rtsp_auth_debug + +static void gst_rtsp_auth_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec); +static void gst_rtsp_auth_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec); +static void gst_rtsp_auth_finalize (GObject * obj); + +static gboolean default_authenticate (GstRTSPAuth * auth, GstRTSPContext * ctx); +static gboolean default_check (GstRTSPAuth * auth, GstRTSPContext * ctx, + const gchar * check); + +G_DEFINE_TYPE (GstRTSPAuth, gst_rtsp_auth, G_TYPE_OBJECT); + +static void +gst_rtsp_auth_class_init (GstRTSPAuthClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPAuthPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->get_property = gst_rtsp_auth_get_property; + gobject_class->set_property = gst_rtsp_auth_set_property; + gobject_class->finalize = gst_rtsp_auth_finalize; + + klass->authenticate = default_authenticate; + klass->check = default_check; + + GST_DEBUG_CATEGORY_INIT (rtsp_auth_debug, "rtspauth", 0, "GstRTSPAuth"); +} + +static void +gst_rtsp_auth_init (GstRTSPAuth * auth) +{ + GstRTSPAuthPrivate *priv; + + auth->priv = priv = GST_RTSP_AUTH_GET_PRIVATE (auth); + + g_mutex_init (&priv->lock); + + priv->basic = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, + (GDestroyNotify) gst_rtsp_token_unref); + + /* bitwise or of all methods that need authentication */ + priv->methods = 0; +} + +static void +gst_rtsp_auth_finalize (GObject * obj) +{ + GstRTSPAuth *auth = GST_RTSP_AUTH (obj); + GstRTSPAuthPrivate *priv = auth->priv; + + GST_INFO ("finalize auth %p", auth); + + if (priv->certificate) + g_object_unref (priv->certificate); + g_hash_table_unref (priv->basic); + g_mutex_clear (&priv->lock); + + G_OBJECT_CLASS (gst_rtsp_auth_parent_class)->finalize (obj); +} + +static void +gst_rtsp_auth_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + switch (propid) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_auth_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + switch (propid) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +/** + * gst_rtsp_auth_new: + * + * Create a new #GstRTSPAuth instance. + * + * Returns: (transfer full): a new #GstRTSPAuth + */ +GstRTSPAuth * +gst_rtsp_auth_new (void) +{ + GstRTSPAuth *result; + + result = g_object_new (GST_TYPE_RTSP_AUTH, NULL); + + return result; +} + +/** + * gst_rtsp_auth_set_tls_certificate: + * @auth: a #GstRTSPAuth + * @cert: (transfer none) (allow-none): a #GTlsCertificate + * + * Set the TLS certificate for the auth. Client connections will only + * be accepted when TLS is negotiated. + */ +void +gst_rtsp_auth_set_tls_certificate (GstRTSPAuth * auth, GTlsCertificate * cert) +{ + GstRTSPAuthPrivate *priv; + GTlsCertificate *old; + + g_return_if_fail (GST_IS_RTSP_AUTH (auth)); + + priv = auth->priv; + + if (cert) + g_object_ref (cert); + + g_mutex_lock (&priv->lock); + old = priv->certificate; + priv->certificate = cert; + g_mutex_unlock (&priv->lock); + + if (old) + g_object_unref (old); +} + +/** + * gst_rtsp_auth_get_tls_certificate: + * @auth: a #GstRTSPAuth + * + * Get the #GTlsCertificate used for negotiating TLS @auth. + * + * Returns: (transfer full): the #GTlsCertificate of @auth. g_object_unref() after + * usage. + */ +GTlsCertificate * +gst_rtsp_auth_get_tls_certificate (GstRTSPAuth * auth) +{ + GstRTSPAuthPrivate *priv; + GTlsCertificate *result; + + g_return_val_if_fail (GST_IS_RTSP_AUTH (auth), NULL); + + priv = auth->priv; + + g_mutex_lock (&priv->lock); + if ((result = priv->certificate)) + g_object_ref (result); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_auth_set_default_token: + * @auth: a #GstRTSPAuth + * @token: (transfer none) (allow-none): a #GstRTSPToken + * + * Set the default #GstRTSPToken to @token in @auth. The default token will + * be used for unauthenticated users. + */ +void +gst_rtsp_auth_set_default_token (GstRTSPAuth * auth, GstRTSPToken * token) +{ + GstRTSPAuthPrivate *priv; + GstRTSPToken *old; + + g_return_if_fail (GST_IS_RTSP_AUTH (auth)); + + priv = auth->priv; + + if (token) + gst_rtsp_token_ref (token); + + g_mutex_lock (&priv->lock); + old = priv->default_token; + priv->default_token = token; + g_mutex_unlock (&priv->lock); + + if (old) + gst_rtsp_token_unref (old); +} + +/** + * gst_rtsp_auth_get_default_token: + * @auth: a #GstRTSPAuth + * + * Get the default token for @auth. This token will be used for unauthenticated + * users. + * + * Returns: (transfer full): the #GstRTSPToken of @auth. gst_rtsp_token_unref() after + * usage. + */ +GstRTSPToken * +gst_rtsp_auth_get_default_token (GstRTSPAuth * auth) +{ + GstRTSPAuthPrivate *priv; + GstRTSPToken *result; + + g_return_val_if_fail (GST_IS_RTSP_AUTH (auth), NULL); + + priv = auth->priv; + + g_mutex_lock (&priv->lock); + if ((result = priv->default_token)) + gst_rtsp_token_ref (result); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_auth_add_basic: + * @auth: a #GstRTSPAuth + * @basic: the basic token + * @token: (transfer none): authorisation token + * + * Add a basic token for the default authentication algorithm that + * enables the client with privileges listed in @token. + */ +void +gst_rtsp_auth_add_basic (GstRTSPAuth * auth, const gchar * basic, + GstRTSPToken * token) +{ + GstRTSPAuthPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_AUTH (auth)); + g_return_if_fail (basic != NULL); + g_return_if_fail (GST_IS_RTSP_TOKEN (token)); + + priv = auth->priv; + + g_mutex_lock (&priv->lock); + g_hash_table_replace (priv->basic, g_strdup (basic), + gst_rtsp_token_ref (token)); + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_auth_remove_basic: + * @auth: a #GstRTSPAuth + * @basic: (transfer none): the basic token + * + * Add a basic token for the default authentication algorithm that + * enables the client with privileges from @authgroup. + */ +void +gst_rtsp_auth_remove_basic (GstRTSPAuth * auth, const gchar * basic) +{ + GstRTSPAuthPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_AUTH (auth)); + g_return_if_fail (basic != NULL); + + priv = auth->priv; + + g_mutex_lock (&priv->lock); + g_hash_table_remove (priv->basic, basic); + g_mutex_unlock (&priv->lock); +} + +static gboolean +default_authenticate (GstRTSPAuth * auth, GstRTSPContext * ctx) +{ + GstRTSPAuthPrivate *priv = auth->priv; + GstRTSPResult res; + gchar *authorization; + + GST_DEBUG_OBJECT (auth, "authenticate"); + + g_mutex_lock (&priv->lock); + /* FIXME, need to ref but we have no way to unref when the ctx is + * popped */ + ctx->token = priv->default_token; + g_mutex_unlock (&priv->lock); + + res = + gst_rtsp_message_get_header (ctx->request, GST_RTSP_HDR_AUTHORIZATION, + &authorization, 0); + if (res < 0) + goto no_auth; + + /* parse type */ + if (g_ascii_strncasecmp (authorization, "basic ", 6) == 0) { + GstRTSPToken *token; + + GST_DEBUG_OBJECT (auth, "check Basic auth"); + g_mutex_lock (&priv->lock); + if ((token = g_hash_table_lookup (priv->basic, &authorization[6]))) { + GST_DEBUG_OBJECT (auth, "setting token %p", token); + ctx->token = token; + } + g_mutex_unlock (&priv->lock); + } else if (g_ascii_strncasecmp (authorization, "digest ", 7) == 0) { + GST_DEBUG_OBJECT (auth, "check Digest auth"); + /* not implemented yet */ + } + return TRUE; + +no_auth: + { + GST_DEBUG_OBJECT (auth, "no authorization header found"); + return TRUE; + } +} + +static void +send_response (GstRTSPAuth * auth, GstRTSPStatusCode code, GstRTSPContext * ctx) +{ + gst_rtsp_message_init_response (ctx->response, code, + gst_rtsp_status_as_text (code), ctx->request); + + if (code == GST_RTSP_STS_UNAUTHORIZED) { + /* we only have Basic for now */ + gst_rtsp_message_add_header (ctx->response, GST_RTSP_HDR_WWW_AUTHENTICATE, + "Basic realm=\"GStreamer RTSP Server\""); + } + gst_rtsp_client_send_message (ctx->client, ctx->session, ctx->response); +} + +static gboolean +ensure_authenticated (GstRTSPAuth * auth, GstRTSPContext * ctx) +{ + GstRTSPAuthClass *klass; + + klass = GST_RTSP_AUTH_GET_CLASS (auth); + + /* we need a token to check */ + if (ctx->token == NULL) { + if (klass->authenticate) { + if (!klass->authenticate (auth, ctx)) + goto authenticate_failed; + } + } + if (ctx->token == NULL) + goto no_auth; + + return TRUE; + +/* ERRORS */ +authenticate_failed: + { + GST_DEBUG_OBJECT (auth, "authenticate failed"); + send_response (auth, GST_RTSP_STS_UNAUTHORIZED, ctx); + return FALSE; + } +no_auth: + { + GST_DEBUG_OBJECT (auth, "no authorization token found"); + send_response (auth, GST_RTSP_STS_UNAUTHORIZED, ctx); + return FALSE; + } +} + +/* new connection */ +static gboolean +check_connect (GstRTSPAuth * auth, GstRTSPContext * ctx, const gchar * check) +{ + GstRTSPAuthPrivate *priv = auth->priv; + + if (priv->certificate) { + GTlsConnection *tls; + + /* configure the connection */ + tls = gst_rtsp_connection_get_tls (ctx->conn, NULL); + g_tls_connection_set_certificate (tls, priv->certificate); + } + return TRUE; +} + +/* check url and methods */ +static gboolean +check_url (GstRTSPAuth * auth, GstRTSPContext * ctx, const gchar * check) +{ + GstRTSPAuthPrivate *priv = auth->priv; + + if ((ctx->method & priv->methods) != 0) + if (!ensure_authenticated (auth, ctx)) + goto not_authenticated; + + return TRUE; + + /* ERRORS */ +not_authenticated: + { + return FALSE; + } +} + +/* check access to media factory */ +static gboolean +check_factory (GstRTSPAuth * auth, GstRTSPContext * ctx, const gchar * check) +{ + const gchar *role; + GstRTSPPermissions *perms; + + if (!ensure_authenticated (auth, ctx)) + return FALSE; + + if (!(role = gst_rtsp_token_get_string (ctx->token, + GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE))) + goto no_media_role; + if (!(perms = gst_rtsp_media_factory_get_permissions (ctx->factory))) + goto no_permissions; + + if (g_str_equal (check, GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS)) { + if (!gst_rtsp_permissions_is_allowed (perms, role, + GST_RTSP_PERM_MEDIA_FACTORY_ACCESS)) + goto no_access; + } else if (g_str_equal (check, GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT)) { + if (!gst_rtsp_permissions_is_allowed (perms, role, + GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT)) + goto no_construct; + } + + gst_rtsp_permissions_unref (perms); + + return TRUE; + + /* ERRORS */ +no_media_role: + { + GST_DEBUG_OBJECT (auth, "no media factory role found"); + send_response (auth, GST_RTSP_STS_UNAUTHORIZED, ctx); + return FALSE; + } +no_permissions: + { + GST_DEBUG_OBJECT (auth, "no permissions on media factory found"); + send_response (auth, GST_RTSP_STS_UNAUTHORIZED, ctx); + return FALSE; + } +no_access: + { + GST_DEBUG_OBJECT (auth, "no permissions to access media factory"); + gst_rtsp_permissions_unref (perms); + send_response (auth, GST_RTSP_STS_NOT_FOUND, ctx); + return FALSE; + } +no_construct: + { + GST_DEBUG_OBJECT (auth, "no permissions to construct media factory"); + gst_rtsp_permissions_unref (perms); + send_response (auth, GST_RTSP_STS_UNAUTHORIZED, ctx); + return FALSE; + } +} + +static gboolean +check_client_settings (GstRTSPAuth * auth, GstRTSPContext * ctx, + const gchar * check) +{ + if (!ensure_authenticated (auth, ctx)) + return FALSE; + + return gst_rtsp_token_is_allowed (ctx->token, + GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS); +} + +static gboolean +default_check (GstRTSPAuth * auth, GstRTSPContext * ctx, const gchar * check) +{ + gboolean res = FALSE; + + /* FIXME, use hastable or so */ + if (g_str_equal (check, GST_RTSP_AUTH_CHECK_CONNECT)) { + res = check_connect (auth, ctx, check); + } else if (g_str_equal (check, GST_RTSP_AUTH_CHECK_URL)) { + res = check_url (auth, ctx, check); + } else if (g_str_has_prefix (check, "auth.check.media.factory.")) { + res = check_factory (auth, ctx, check); + } else if (g_str_equal (check, GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS)) { + res = check_client_settings (auth, ctx, check); + } + return res; +} + +static gboolean +no_auth_check (const gchar * check) +{ + gboolean res; + + if (g_str_equal (check, GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS)) + res = FALSE; + else + res = TRUE; + + return res; +} + +/** + * gst_rtsp_auth_check: + * @check: the item to check + * + * Check if @check is allowed in the current context. + * + * Returns: FALSE if check failed. + */ +gboolean +gst_rtsp_auth_check (const gchar * check) +{ + gboolean result = FALSE; + GstRTSPAuthClass *klass; + GstRTSPContext *ctx; + GstRTSPAuth *auth; + + g_return_val_if_fail (check != NULL, FALSE); + + if (!(ctx = gst_rtsp_context_get_current ())) + goto no_context; + + /* no auth, we don't need to check */ + if (!(auth = ctx->auth)) + return no_auth_check (check); + + klass = GST_RTSP_AUTH_GET_CLASS (auth); + + GST_DEBUG_OBJECT (auth, "check authorization '%s'", check); + + if (klass->check) + result = klass->check (auth, ctx, check); + + return result; + + /* ERRORS */ +no_context: + { + GST_ERROR ("no context found"); + return FALSE; + } +} + +/** + * gst_rtsp_auth_make_basic: + * @user: a userid + * @pass: a password + * + * Construct a Basic authorisation token from @user and @pass. + * + * Returns: (transfer full): the base64 encoding of the string @user:@pass. + * g_free() after usage. + */ +gchar * +gst_rtsp_auth_make_basic (const gchar * user, const gchar * pass) +{ + gchar *user_pass; + gchar *result; + + g_return_val_if_fail (user != NULL, NULL); + g_return_val_if_fail (pass != NULL, NULL); + + user_pass = g_strjoin (":", user, pass, NULL); + result = g_base64_encode ((guchar *) user_pass, strlen (user_pass)); + g_free (user_pass); + + return result; +} diff --git a/gst/rtsp-server/rtsp-auth.h b/gst/rtsp-server/rtsp-auth.h new file mode 100644 index 0000000..cb281f0 --- /dev/null +++ b/gst/rtsp-server/rtsp-auth.h @@ -0,0 +1,173 @@ +/* GStreamer + * Copyright (C) 2010 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#ifndef __GST_RTSP_AUTH_H__ +#define __GST_RTSP_AUTH_H__ + +typedef struct _GstRTSPAuth GstRTSPAuth; +typedef struct _GstRTSPAuthClass GstRTSPAuthClass; +typedef struct _GstRTSPAuthPrivate GstRTSPAuthPrivate; + +#include "rtsp-client.h" +#include "rtsp-token.h" + +G_BEGIN_DECLS + +#define GST_TYPE_RTSP_AUTH (gst_rtsp_auth_get_type ()) +#define GST_IS_RTSP_AUTH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_AUTH)) +#define GST_IS_RTSP_AUTH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_AUTH)) +#define GST_RTSP_AUTH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_AUTH, GstRTSPAuthClass)) +#define GST_RTSP_AUTH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_AUTH, GstRTSPAuth)) +#define GST_RTSP_AUTH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_AUTH, GstRTSPAuthClass)) +#define GST_RTSP_AUTH_CAST(obj) ((GstRTSPAuth*)(obj)) +#define GST_RTSP_AUTH_CLASS_CAST(klass) ((GstRTSPAuthClass*)(klass)) + +/** + * GstRTSPAuth: + * + * The authentication structure. + */ +struct _GstRTSPAuth { + GObject parent; + + /*< private >*/ + GstRTSPAuthPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPAuthClass: + * @authenticate: check the authentication of a client. The default implementation + * checks if the authentication in the header matches one of the basic + * authentication tokens. This function should set the authgroup field + * in the context. + * @check: check if a resource can be accessed. this function should + * call authenticate to authenticate the client when needed. The method + * should also construct and send an appropriate response message on + * error. + * + * The authentication class. + */ +struct _GstRTSPAuthClass { + GObjectClass parent_class; + + gboolean (*authenticate) (GstRTSPAuth *auth, GstRTSPContext *ctx); + gboolean (*check) (GstRTSPAuth *auth, GstRTSPContext *ctx, + const gchar *check); + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +GType gst_rtsp_auth_get_type (void); + +GstRTSPAuth * gst_rtsp_auth_new (void); + +void gst_rtsp_auth_set_tls_certificate (GstRTSPAuth *auth, GTlsCertificate *cert); +GTlsCertificate * gst_rtsp_auth_get_tls_certificate (GstRTSPAuth *auth); + +void gst_rtsp_auth_set_default_token (GstRTSPAuth *auth, GstRTSPToken *token); +GstRTSPToken * gst_rtsp_auth_get_default_token (GstRTSPAuth *auth); + +void gst_rtsp_auth_add_basic (GstRTSPAuth *auth, const gchar * basic, + GstRTSPToken *token); +void gst_rtsp_auth_remove_basic (GstRTSPAuth *auth, const gchar * basic); + +gboolean gst_rtsp_auth_check (const gchar *check); + + +/* helpers */ +gchar * gst_rtsp_auth_make_basic (const gchar * user, const gchar * pass); + +/* checks */ +/** + * GST_RTSP_AUTH_CHECK_CONNECT: + * + * Check a new connection + */ +#define GST_RTSP_AUTH_CHECK_CONNECT "auth.check.connect" +/** + * GST_RTSP_AUTH_CHECK_URL: + * + * Check the URL and methods + */ +#define GST_RTSP_AUTH_CHECK_URL "auth.check.url" +/** + * GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS: + * + * Check if access is allowed to a factory. + * When access is not allowed an 404 Not Found is sent in the response. + */ +#define GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS "auth.check.media.factory.access" +/** + * GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT: + * + * Check if media can be constructed from a media factory + * A response should be sent on error. + */ +#define GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT "auth.check.media.factory.construct" +/** + * GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS: + * + * Check if the client can specify TTL, destination and + * port pair in multicast. No response is sent when the check returns + * %FALSE. + */ +#define GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS "auth.check.transport.client-settings" + + +/* tokens */ +/** + * GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE: + * + * G_TYPE_STRING, the role to use when dealing with media factories + * + * The default #GstRTSPAuth object uses this string in the token to find the + * role of the media factory. It will then retrieve the #GstRTSPPermissions of + * the media factory and retrieve the role with the same name. + */ +#define GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE "media.factory.role" +/** + * GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS: + * + * G_TYPE_BOOLEAN, %TRUE if the client can specify TTL, destination and + * port pair in multicast. + */ +#define GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS "transport.client-settings" + +/* permissions */ +/** + * GST_RTSP_PERM_MEDIA_FACTORY_ACCESS: + * + * G_TYPE_BOOLEAN, %TRUE if the media can be accessed, %FALSE will + * return a 404 Not Found error when trying to access the media. + */ +#define GST_RTSP_PERM_MEDIA_FACTORY_ACCESS "media.factory.access" +/** + * GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT: + * + * G_TYPE_BOOLEAN, %TRUE if the media can be constructed, %FALSE will + * return a 404 Not Found error when trying to access the media. + */ +#define GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT "media.factory.construct" + +G_END_DECLS + +#endif /* __GST_RTSP_AUTH_H__ */ diff --git a/gst/rtsp-server/rtsp-client-wfd.c b/gst/rtsp-server/rtsp-client-wfd.c new file mode 100644 index 0000000..75a5202 --- /dev/null +++ b/gst/rtsp-server/rtsp-client-wfd.c @@ -0,0 +1,2087 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-client + * @short_description: A client connection state + * @see_also: #GstRTSPServer, #GstRTSPThreadPool + * + * The client object handles the connection with a client for as long as a TCP + * connection is open. + * + * A #GstRTSPWFDClient is created by #GstRTSPServer when a new connection is + * accepted and it inherits the #GstRTSPMountPoints, #GstRTSPSessionPool, + * #GstRTSPAuth and #GstRTSPThreadPool from the server. + * + * The client connection should be configured with the #GstRTSPConnection using + * gst_rtsp_wfd_client_set_connection() before it can be attached to a #GMainContext + * using gst_rtsp_wfd_client_attach(). From then on the client will handle requests + * on the connection. + * + * Use gst_rtsp_wfd_client_session_filter() to iterate or modify all the + * #GstRTSPSession objects managed by the client object. + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include +#include + +#include "rtsp-client-wfd.h" +#include "rtsp-media-factory-wfd.h" +#include "rtsp-sdp.h" +#include "rtsp-params.h" +#include "gstwfdmessage.h" + +#define GST_RTSP_WFD_CLIENT_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_WFD_CLIENT, GstRTSPWFDClientPrivate)) + +/* locking order: + * send_lock, lock, tunnels_lock + */ + +struct _GstRTSPWFDClientPrivate +{ + GstRTSPWFDClientSendFunc send_func; /* protected by send_lock */ + gpointer send_data; /* protected by send_lock */ + GDestroyNotify send_notify; /* protected by send_lock */ + + /* used to cache the media in the last requested DESCRIBE so that + * we can pick it up in the next SETUP immediately */ + gchar *path; + GstRTSPMedia *media; + + GList *transports; + GList *sessions; + + guint8 m1_done; + guint8 m3_done; + guint8 m4_done; + + /* Parameters for WIFI-DISPLAY */ + guint caCodec; + guint cFreq; + guint cChanels; + guint cBitwidth; + guint caLatency; + guint cvCodec; + guint cNative; + guint64 cNativeResolution; + guint64 video_resolution_supported; + gint video_native_resolution; + guint cCEAResolution; + guint cVESAResolution; + guint cHHResolution; + guint cProfile; + guint cLevel; + guint32 cMaxHeight; + guint32 cMaxWidth; + guint32 cFramerate; + guint32 cInterleaved; + guint32 cmin_slice_size; + guint32 cslice_enc_params; + guint cframe_rate_control; + guint cvLatency; + guint ctrans; + guint cprofile; + guint clowertrans; + guint32 crtp_port0; + guint32 crtp_port1; + + gboolean protection_enabled; + GstWFDHDCPProtection hdcp_version; + guint32 hdcp_tcpport; + + gboolean edid_supported; + guint32 edid_hres; + guint32 edid_vres; + + guint8 keep_alive_flag; + GMutex keep_alive_lock; +}; + +#define DEFAULT_WFD_TIMEOUT 60 +#define WFD_MOUNT_POINT "/wfd1.0/streamid=0" + +enum +{ + SIGNAL_WFD_OPTIONS_REQUEST, + SIGNAL_WFD_GET_PARAMETER_REQUEST, + SIGNAL_WFD_LAST +}; + +GST_DEBUG_CATEGORY_STATIC (rtsp_wfd_client_debug); +#define GST_CAT_DEFAULT rtsp_wfd_client_debug + +static guint gst_rtsp_client_wfd_signals[SIGNAL_WFD_LAST] = { 0 }; + +static void gst_rtsp_wfd_client_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec); +static void gst_rtsp_wfd_client_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec); +static void gst_rtsp_wfd_client_finalize (GObject * obj); + +static gboolean handle_wfd_options_request (GstRTSPClient * client, + GstRTSPContext * ctx); +static gboolean handle_wfd_set_param_request (GstRTSPClient * client, + GstRTSPContext * ctx); +static gboolean handle_wfd_get_param_request (GstRTSPClient * client, + GstRTSPContext * ctx); + +static void send_generic_wfd_response (GstRTSPWFDClient * client, + GstRTSPStatusCode code, GstRTSPContext * ctx); +static gchar *wfd_make_path_from_uri (GstRTSPClient * client, + const GstRTSPUrl * uri); +static void wfd_options_request_done (GstRTSPWFDClient * client); +static void wfd_get_param_request_done (GstRTSPWFDClient * client); +static void handle_wfd_response (GstRTSPClient * client, GstRTSPContext * ctx); +static void handle_wfd_play (GstRTSPClient * client, GstRTSPContext * ctx); +static void wfd_set_keep_alive_condition(GstRTSPClient * client); +static gboolean wfd_ckeck_keep_alive_response (gpointer userdata); +static gboolean keep_alive_condition(gpointer userdata); + +GstRTSPResult prepare_trigger_request (GstRTSPWFDClient * client, + GstRTSPMessage * request, GstWFDTriggerType trigger_type, gchar * url); + +GstRTSPResult prepare_request (GstRTSPWFDClient * client, + GstRTSPMessage * request, GstRTSPMethod method, gchar * url); + +void +send_request (GstRTSPWFDClient * client, GstRTSPSession * session, + GstRTSPMessage * request); + +GstRTSPResult +prepare_response (GstRTSPWFDClient * client, GstRTSPMessage * request, + GstRTSPMessage * response, GstRTSPMethod method); + +static GstRTSPResult handle_M1_message (GstRTSPWFDClient * client); +static GstRTSPResult handle_M3_message (GstRTSPWFDClient * client); +static GstRTSPResult handle_M4_message (GstRTSPWFDClient * client); +static GstRTSPResult handle_M16_message (GstRTSPWFDClient * client); + +G_DEFINE_TYPE (GstRTSPWFDClient, gst_rtsp_wfd_client, GST_TYPE_RTSP_CLIENT); + +static void +gst_rtsp_wfd_client_class_init (GstRTSPWFDClientClass * klass) +{ + GObjectClass *gobject_class; + GstRTSPClientClass *rtsp_client_class; + + g_type_class_add_private (klass, sizeof (GstRTSPWFDClientPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + rtsp_client_class = GST_RTSP_CLIENT_CLASS (klass); + + gobject_class->get_property = gst_rtsp_wfd_client_get_property; + gobject_class->set_property = gst_rtsp_wfd_client_set_property; + gobject_class->finalize = gst_rtsp_wfd_client_finalize; + + //klass->create_sdp = create_sdp; + //klass->configure_client_media = default_configure_client_media; + //klass->configure_client_transport = default_configure_client_transport; + //klass->params_set = default_params_set; + //klass->params_get = default_params_get; + + rtsp_client_class->handle_options_request = handle_wfd_options_request; + rtsp_client_class->handle_set_param_request = handle_wfd_set_param_request; + rtsp_client_class->handle_get_param_request = handle_wfd_get_param_request; + rtsp_client_class->make_path_from_uri = wfd_make_path_from_uri; + + rtsp_client_class->handle_response = handle_wfd_response; + rtsp_client_class->play_request = handle_wfd_play; + + gst_rtsp_client_wfd_signals[SIGNAL_WFD_OPTIONS_REQUEST] = + g_signal_new ("wfd-options-request", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPWFDClientClass, + wfd_options_request), NULL, NULL, g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); + + gst_rtsp_client_wfd_signals[SIGNAL_WFD_GET_PARAMETER_REQUEST] = + g_signal_new ("wfd-get-parameter-request", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPWFDClientClass, + wfd_get_param_request), NULL, NULL, g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); + + klass->wfd_options_request = wfd_options_request_done; + klass->wfd_get_param_request = wfd_get_param_request_done; + + GST_DEBUG_CATEGORY_INIT (rtsp_wfd_client_debug, "rtspwfdclient", 0, + "GstRTSPWFDClient"); +} + +static void +gst_rtsp_wfd_client_init (GstRTSPWFDClient * client) +{ + GstRTSPWFDClientPrivate *priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client); + + client->priv = priv; + priv->protection_enabled = FALSE; + priv->video_native_resolution = GST_WFD_VIDEO_CEA_RESOLUTION; + priv->video_resolution_supported = GST_WFD_CEA_640x480P60; + g_mutex_init (&priv->keep_alive_lock); + GST_INFO_OBJECT (client, "Client is initialized"); +} + +/* A client is finalized when the connection is broken */ +static void +gst_rtsp_wfd_client_finalize (GObject * obj) +{ + GstRTSPWFDClient *client = GST_RTSP_WFD_CLIENT (obj); + GstRTSPWFDClientPrivate *priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client); + + GST_INFO ("finalize client %p", client); + + g_mutex_clear (&priv->keep_alive_lock); + G_OBJECT_CLASS (gst_rtsp_wfd_client_parent_class)->finalize (obj); +} + +static void +gst_rtsp_wfd_client_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + //GstRTSPWFDClient *client = GST_RTSP_WFD_CLIENT (object); + + switch (propid) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_wfd_client_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + //GstRTSPWFDClient *client = GST_RTSP_WFD_CLIENT (object); + + switch (propid) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +/** + * gst_rtsp_wfd_client_new: + * + * Create a new #GstRTSPWFDClient instance. + * + * Returns: a new #GstRTSPWFDClient + */ +GstRTSPWFDClient * +gst_rtsp_wfd_client_new (void) +{ + GstRTSPWFDClient *result; + + result = g_object_new (GST_TYPE_RTSP_WFD_CLIENT, NULL); + + return result; +} + +void +gst_rtsp_wfd_client_start_wfd (GstRTSPWFDClient * client) +{ + GstRTSPResult res = GST_RTSP_OK; + GST_INFO_OBJECT (client, "gst_rtsp_wfd_client_start_wfd"); + + res = handle_M1_message (client); + if (res < GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "handle_M1_message failed : %d", res); + } + + return; +} + +static void +wfd_options_request_done (GstRTSPWFDClient * client) +{ + GstRTSPResult res = GST_RTSP_OK; + GST_INFO_OBJECT (client, "M2 done.."); + + res = handle_M3_message (client); + if (res < GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "handle_M3_message failed : %d", res); + } + + return; +} + +static void +wfd_get_param_request_done (GstRTSPWFDClient * client) +{ + GstRTSPResult res = GST_RTSP_OK; + GstRTSPWFDClientPrivate *priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client); + priv->m3_done = TRUE; + GST_INFO_OBJECT (client, "M3 done.."); + + res = handle_M4_message (client); + if (res < GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "handle_M4_message failed : %d", res); + } + + return; +} + +static guint64 +wfd_get_prefered_resolution (guint64 srcResolution, + guint64 sinkResolution, + GstWFDVideoNativeResolution native, + guint32 * cMaxWidth, + guint32 * cMaxHeight, guint32 * cFramerate, guint32 * interleaved) +{ + int i = 0; + guint64 resolution = 0; + for (i = 0; i < 32; i++) { + if (((sinkResolution << i) & 0x80000000) + && ((srcResolution << i) & 0x80000000)) { + resolution = (0x00000001 << (31 - i)); + break; + } + } + switch (native) { + case GST_WFD_VIDEO_CEA_RESOLUTION: + { + switch (resolution) { + case GST_WFD_CEA_640x480P60: + *cMaxWidth = 640; + *cMaxHeight = 480; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_CEA_720x480P60: + *cMaxWidth = 720; + *cMaxHeight = 480; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_CEA_720x480I60: + *cMaxWidth = 720; + *cMaxHeight = 480; + *cFramerate = 60; + *interleaved = 1; + break; + case GST_WFD_CEA_720x576P50: + *cMaxWidth = 720; + *cMaxHeight = 576; + *cFramerate = 50; + *interleaved = 0; + break; + case GST_WFD_CEA_720x576I50: + *cMaxWidth = 720; + *cMaxHeight = 576; + *cFramerate = 50; + *interleaved = 1; + break; + case GST_WFD_CEA_1280x720P30: + *cMaxWidth = 1280; + *cMaxHeight = 720; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_CEA_1280x720P60: + *cMaxWidth = 1280; + *cMaxHeight = 720; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_CEA_1920x1080P30: + *cMaxWidth = 1920; + *cMaxHeight = 1080; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_CEA_1920x1080P60: + *cMaxWidth = 1920; + *cMaxHeight = 1080; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_CEA_1920x1080I60: + *cMaxWidth = 1920; + *cMaxHeight = 1080; + *cFramerate = 60; + *interleaved = 1; + break; + case GST_WFD_CEA_1280x720P25: + *cMaxWidth = 1280; + *cMaxHeight = 720; + *cFramerate = 25; + *interleaved = 0; + break; + case GST_WFD_CEA_1280x720P50: + *cMaxWidth = 1280; + *cMaxHeight = 720; + *cFramerate = 50; + *interleaved = 0; + break; + case GST_WFD_CEA_1920x1080P25: + *cMaxWidth = 1920; + *cMaxHeight = 1080; + *cFramerate = 25; + *interleaved = 0; + break; + case GST_WFD_CEA_1920x1080P50: + *cMaxWidth = 1920; + *cMaxHeight = 1080; + *cFramerate = 50; + *interleaved = 0; + break; + case GST_WFD_CEA_1920x1080I50: + *cMaxWidth = 1920; + *cMaxHeight = 1080; + *cFramerate = 50; + *interleaved = 1; + break; + case GST_WFD_CEA_1280x720P24: + *cMaxWidth = 1280; + *cMaxHeight = 720; + *cFramerate = 24; + *interleaved = 0; + break; + case GST_WFD_CEA_1920x1080P24: + *cMaxWidth = 1920; + *cMaxHeight = 1080; + *cFramerate = 24; + *interleaved = 0; + break; + default: + *cMaxWidth = 0; + *cMaxHeight = 0; + *cFramerate = 0; + *interleaved = 0; + break; + } + } + break; + case GST_WFD_VIDEO_VESA_RESOLUTION: + { + switch (resolution) { + case GST_WFD_VESA_800x600P30: + *cMaxWidth = 800; + *cMaxHeight = 600; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_800x600P60: + *cMaxWidth = 800; + *cMaxHeight = 600; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1024x768P30: + *cMaxWidth = 1024; + *cMaxHeight = 768; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1024x768P60: + *cMaxWidth = 1024; + *cMaxHeight = 768; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1152x864P30: + *cMaxWidth = 1152; + *cMaxHeight = 864; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1152x864P60: + *cMaxWidth = 1152; + *cMaxHeight = 864; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1280x768P30: + *cMaxWidth = 1280; + *cMaxHeight = 768; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1280x768P60: + *cMaxWidth = 1280; + *cMaxHeight = 768; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1280x800P30: + *cMaxWidth = 1280; + *cMaxHeight = 800; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1280x800P60: + *cMaxWidth = 1280; + *cMaxHeight = 800; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1360x768P30: + *cMaxWidth = 1360; + *cMaxHeight = 768; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1360x768P60: + *cMaxWidth = 1360; + *cMaxHeight = 768; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1366x768P30: + *cMaxWidth = 1366; + *cMaxHeight = 768; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1366x768P60: + *cMaxWidth = 1366; + *cMaxHeight = 768; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1280x1024P30: + *cMaxWidth = 1280; + *cMaxHeight = 1024; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1280x1024P60: + *cMaxWidth = 1280; + *cMaxHeight = 1024; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1400x1050P30: + *cMaxWidth = 1400; + *cMaxHeight = 1050; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1400x1050P60: + *cMaxWidth = 1400; + *cMaxHeight = 1050; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1440x900P30: + *cMaxWidth = 1440; + *cMaxHeight = 900; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1440x900P60: + *cMaxWidth = 1440; + *cMaxHeight = 900; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1600x900P30: + *cMaxWidth = 1600; + *cMaxHeight = 900; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1600x900P60: + *cMaxWidth = 1600; + *cMaxHeight = 900; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1600x1200P30: + *cMaxWidth = 1600; + *cMaxHeight = 1200; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1600x1200P60: + *cMaxWidth = 1600; + *cMaxHeight = 1200; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1680x1024P30: + *cMaxWidth = 1680; + *cMaxHeight = 1024; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1680x1024P60: + *cMaxWidth = 1680; + *cMaxHeight = 1024; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1680x1050P30: + *cMaxWidth = 1680; + *cMaxHeight = 1050; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1680x1050P60: + *cMaxWidth = 1680; + *cMaxHeight = 1050; + *cFramerate = 60; + *interleaved = 0; + break; + case GST_WFD_VESA_1920x1200P30: + *cMaxWidth = 1920; + *cMaxHeight = 1200; + *cFramerate = 30; + *interleaved = 0; + break; + case GST_WFD_VESA_1920x1200P60: + *cMaxWidth = 1920; + *cMaxHeight = 1200; + *cFramerate = 60; + *interleaved = 0; + break; + default: + *cMaxWidth = 0; + *cMaxHeight = 0; + *cFramerate = 0; + *interleaved = 0; + break; + } + } + break; + case GST_WFD_VIDEO_HH_RESOLUTION: + { + *interleaved = 0; + switch (resolution) { + case GST_WFD_HH_800x480P30: + *cMaxWidth = 800; + *cMaxHeight = 480; + *cFramerate = 30; + break; + case GST_WFD_HH_800x480P60: + *cMaxWidth = 800; + *cMaxHeight = 480; + *cFramerate = 60; + break; + case GST_WFD_HH_854x480P30: + *cMaxWidth = 854; + *cMaxHeight = 480; + *cFramerate = 30; + break; + case GST_WFD_HH_854x480P60: + *cMaxWidth = 854; + *cMaxHeight = 480; + *cFramerate = 60; + break; + case GST_WFD_HH_864x480P30: + *cMaxWidth = 864; + *cMaxHeight = 480; + *cFramerate = 30; + break; + case GST_WFD_HH_864x480P60: + *cMaxWidth = 864; + *cMaxHeight = 480; + *cFramerate = 60; + break; + case GST_WFD_HH_640x360P30: + *cMaxWidth = 640; + *cMaxHeight = 360; + *cFramerate = 30; + break; + case GST_WFD_HH_640x360P60: + *cMaxWidth = 640; + *cMaxHeight = 360; + *cFramerate = 60; + break; + case GST_WFD_HH_960x540P30: + *cMaxWidth = 960; + *cMaxHeight = 540; + *cFramerate = 30; + break; + case GST_WFD_HH_960x540P60: + *cMaxWidth = 960; + *cMaxHeight = 540; + *cFramerate = 60; + break; + case GST_WFD_HH_848x480P30: + *cMaxWidth = 848; + *cMaxHeight = 480; + *cFramerate = 30; + break; + case GST_WFD_HH_848x480P60: + *cMaxWidth = 848; + *cMaxHeight = 480; + *cFramerate = 60; + break; + default: + *cMaxWidth = 0; + *cMaxHeight = 0; + *cFramerate = 0; + *interleaved = 0; + break; + } + } + break; + *cMaxWidth = 0; + *cMaxHeight = 0; + *cFramerate = 0; + *interleaved = 0; + break; + } + return resolution; +} + +static gchar * +wfd_make_path_from_uri (GstRTSPClient * client, const GstRTSPUrl * uri) +{ + gchar *path; + + GST_DEBUG_OBJECT (client, "Got URI abspath : %s", uri->abspath); + path = g_strdup ("/wfd1.0/streamid=0"); + + return path; +} + +static void +handle_wfd_play (GstRTSPClient * client, GstRTSPContext * ctx) +{ + wfd_set_keep_alive_condition(client); +} + +static void +handle_wfd_response (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPResult res = GST_RTSP_OK; + guint8 *data = NULL; + guint size = 0; + + GstRTSPWFDClient *_client = GST_RTSP_WFD_CLIENT (client); + GstRTSPWFDClientPrivate *priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client); + + GST_INFO_OBJECT (_client, "Handling response.."); + + if (!ctx) + GST_ERROR_OBJECT (_client, "Context is NULL"); + if (!ctx->response) + GST_ERROR_OBJECT (_client, "Response is NULL"); + + /* parsing the GET_PARAMTER response */ + res = gst_rtsp_message_get_body (ctx->response, (guint8 **) & data, &size); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (_client, "Failed to get body of response..."); + return; + } + + GST_INFO_OBJECT (_client, "Response body is %d", size); + if (size > 0) { + if (!priv->m3_done) { + GstWFDResult wfd_res; + GstWFDMessage *msg = NULL; + /* Parse M3 response from sink */ + wfd_res = gst_wfd_message_new (&msg); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, "Failed to create wfd message..."); + goto error; + } + + wfd_res = gst_wfd_message_init (msg); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, "Failed to init wfd message..."); + goto error; + } + + wfd_res = gst_wfd_message_parse_buffer (data, size, msg); + + GST_DEBUG_OBJECT (client, "M3 response server side message body: %s", + gst_wfd_message_as_text (msg)); + + /* Get the audio formats supported by WFDSink */ + if (msg->audio_codecs) { + wfd_res = + gst_wfd_message_get_supported_audio_format (msg, &priv->caCodec, + &priv->cFreq, &priv->cChanels, &priv->cBitwidth, &priv->caLatency); + if (wfd_res != GST_WFD_OK) { + GST_WARNING_OBJECT (client, + "Failed to get wfd support audio formats..."); + goto error; + } + } + + /* Get the Video formats supported by WFDSink */ + wfd_res = + gst_wfd_message_get_supported_video_format (msg, &priv->cvCodec, + &priv->cNative, &priv->cNativeResolution, + (guint64 *) & priv->cCEAResolution, + (guint64 *) & priv->cVESAResolution, + (guint64 *) & priv->cHHResolution, &priv->cProfile, &priv->cLevel, + &priv->cvLatency, &priv->cMaxHeight, &priv->cMaxWidth, + &priv->cmin_slice_size, &priv->cslice_enc_params, + &priv->cframe_rate_control); + if (wfd_res != GST_WFD_OK) { + GST_WARNING_OBJECT (client, + "Failed to get wfd supported video formats..."); + goto error; + } + + if (msg->client_rtp_ports) { + /* Get the RTP ports preferred by WFDSink */ + wfd_res = + gst_wfd_message_get_prefered_rtp_ports (msg, &priv->ctrans, + &priv->cprofile, &priv->clowertrans, &priv->crtp_port0, + &priv->crtp_port1); + if (wfd_res != GST_WFD_OK) { + GST_WARNING_OBJECT (client, + "Failed to get wfd prefered RTP ports..."); + goto error; + } + } + + if (msg->display_edid) { + guint32 edid_block_count = 0; + gchar *edid_payload = NULL; + priv->edid_supported = FALSE; + /* Get the display edid preferred by WFDSink */ + GST_DEBUG_OBJECT (client, "Going to gst_wfd_message_get_display_edid"); + wfd_res = + gst_wfd_message_get_display_edid (msg, &priv->edid_supported, + &edid_block_count, &edid_payload); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, "Failed to get wfd display edid..."); + goto error; + } + GST_DEBUG_OBJECT (client, " edid supported: %d edid_block_count: %d", + priv->edid_supported, edid_block_count); + if (priv->edid_supported) { + priv->edid_hres = 0; + priv->edid_vres = 0; + priv->edid_hres = + (guint32) (((edid_payload[54 + 4] >> 4) << 8) | edid_payload[54 + + 2]); + priv->edid_vres = + (guint32) (((edid_payload[54 + 7] >> 4) << 8) | edid_payload[54 + + 5]); + GST_DEBUG_OBJECT (client, " edid supported Hres: %d Wres: %d", + priv->edid_hres, priv->edid_vres); + if ((priv->edid_hres < 640) || (priv->edid_vres < 480) + || (priv->edid_hres > 1920) || (priv->edid_vres > 1080)) { + priv->edid_hres = 0; + priv->edid_vres = 0; + priv->edid_supported = FALSE; + GST_WARNING_OBJECT (client, " edid invalid resolutions"); + } + } + } + + if (msg->content_protection) { +#if 0 + /*Get the hdcp version and tcp port by WFDSink */ + wfd_res = + gst_wfd_message_get_contentprotection_type (msg, + &priv->hdcp_version, &priv->hdcp_tcpport); + GST_DEBUG ("hdcp version =%d, tcp port = %d", priv->hdcp_version, + priv->hdcp_tcpport); + if (priv->hdcp_version > 0 && priv->hdcp_tcpport > 0) + priv->protection_enabled = TRUE; + + if (wfd_res != GST_WFD_OK) { + GST_WARNING_OBJECT (client, + "Failed to get wfd content protection..."); + goto error; + } +#else + GST_WARNING_OBJECT (client, "Don't use content protection"); +#endif + } + + g_signal_emit (_client, + gst_rtsp_client_wfd_signals[SIGNAL_WFD_GET_PARAMETER_REQUEST], 0, + ctx); + } else { + /* TODO-WFD: Handle another GET_PARAMETER response with body */ + } + } else if (size == 0) { + if (!priv->m1_done) { + GST_INFO_OBJECT (_client, "M1 response is done"); + priv->m1_done = TRUE; + } else if (!priv->m4_done) { + GST_INFO_OBJECT (_client, "M4 response is done"); + priv->m4_done = TRUE; + + gst_rtsp_wfd_client_trigger_request (_client, WFD_TRIGGER_SETUP); + } else { + g_mutex_lock(&priv->keep_alive_lock); + if (priv->keep_alive_flag == FALSE) { + GST_INFO_OBJECT (_client, "M16 response is done"); + priv->keep_alive_flag = TRUE; + } + g_mutex_unlock(&priv->keep_alive_lock); + } + } + + return; + +error: + return; +} + +static gboolean +handle_wfd_options_request (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPResult res = GST_RTSP_OK; + GstRTSPMethod options; + gchar *tmp = NULL; + gchar *str = NULL; + gchar *user_agent = NULL; + + options = GST_RTSP_OPTIONS | + GST_RTSP_PAUSE | + GST_RTSP_PLAY | + GST_RTSP_SETUP | + GST_RTSP_GET_PARAMETER | GST_RTSP_SET_PARAMETER | GST_RTSP_TEARDOWN; + + str = gst_rtsp_options_as_text (options); + + /*append WFD specific method */ + tmp = g_strdup (", org.wfa.wfd1.0"); + g_strlcat (str, tmp, strlen (tmp) + strlen (str) + 1); + + gst_rtsp_message_init_response (ctx->response, GST_RTSP_STS_OK, + gst_rtsp_status_as_text (GST_RTSP_STS_OK), ctx->request); + + gst_rtsp_message_add_header (ctx->response, GST_RTSP_HDR_PUBLIC, str); + g_free (str); + str = NULL; + + res = + gst_rtsp_message_get_header (ctx->request, GST_RTSP_HDR_USER_AGENT, + &user_agent, 0); + if (res == GST_RTSP_OK) { + gst_rtsp_message_add_header (ctx->response, GST_RTSP_HDR_USER_AGENT, + user_agent); + } else { + return FALSE; + } + + res = gst_rtsp_client_send_message (client, NULL, ctx->response); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "gst_rtsp_client_send_message failed : %d", res); + return FALSE; + } + + GST_DEBUG_OBJECT (client, "Sent M2 response..."); + + g_signal_emit (client, + gst_rtsp_client_wfd_signals[SIGNAL_WFD_OPTIONS_REQUEST], 0, ctx); + + return TRUE; +} + +static gboolean +handle_wfd_get_param_request (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPResult res = GST_RTSP_OK; + guint8 *data = NULL; + guint size = 0; + + GstRTSPWFDClient *_client = GST_RTSP_WFD_CLIENT (client); + + /* parsing the GET_PARAMTER request */ + res = gst_rtsp_message_get_body (ctx->request, (guint8 **) & data, &size); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (_client, "Failed to get body of request..."); + return FALSE; + } + + if (size == 0) { + send_generic_wfd_response (_client, GST_RTSP_STS_OK, ctx); + } else { + /* TODO-WFD: Handle other GET_PARAMETER request from sink */ + } + + return TRUE; +} + +static gboolean +handle_wfd_set_param_request (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPResult res = GST_RTSP_OK; + guint8 *data = NULL; + guint size = 0; + + GstRTSPWFDClient *_client = GST_RTSP_WFD_CLIENT (client); + + res = gst_rtsp_message_get_body (ctx->request, &data, &size); + if (res != GST_RTSP_OK) + goto bad_request; + + if (size == 0) { + /* no body, keep-alive request */ + send_generic_wfd_response (_client, GST_RTSP_STS_OK, ctx); + } else { + if (data != NULL) { + GST_INFO_OBJECT (_client, "SET_PARAMETER Request : %s(%d)", data, size); + if (g_strcmp0 ((const gchar *) data, "wfd_idr_request")) + send_generic_wfd_response (_client, GST_RTSP_STS_OK, ctx); + else + /* TODO-WFD : Handle other set param request */ + send_generic_wfd_response (_client, GST_RTSP_STS_OK, ctx); + } else { + goto bad_request; + } + } + + return TRUE; + + /* ERRORS */ +bad_request: + { + GST_ERROR ("_client %p: bad request", _client); + send_generic_wfd_response (_client, GST_RTSP_STS_BAD_REQUEST, ctx); + return FALSE; + } +} + +#if 0 +static gboolean +gst_rtsp_wfd_client_parse_methods (GstRTSPWFDClient * client, + GstRTSPMessage * response) +{ + GstRTSPHeaderField field; + gchar *respoptions; + gchar **options; + gint indx = 0; + gint i; + gboolean found_wfd_method = FALSE; + + /* reset supported methods */ + client->supported_methods = 0; + + /* Try Allow Header first */ + field = GST_RTSP_HDR_ALLOW; + while (TRUE) { + respoptions = NULL; + gst_rtsp_message_get_header (response, field, &respoptions, indx); + if (indx == 0 && !respoptions) { + /* if no Allow header was found then try the Public header... */ + field = GST_RTSP_HDR_PUBLIC; + gst_rtsp_message_get_header (response, field, &respoptions, indx); + } + if (!respoptions) + break; + + /* If we get here, the server gave a list of supported methods, parse + * them here. The string is like: + * + * OPTIONS, PLAY, SETUP, ... + */ + options = g_strsplit (respoptions, ",", 0); + + for (i = 0; options[i]; i++) { + gchar *stripped; + gint method; + + stripped = g_strstrip (options[i]); + method = gst_rtsp_find_method (stripped); + + if (!g_ascii_strcasecmp ("org.wfa.wfd1.0", stripped)) + found_wfd_method = TRUE; + + /* keep bitfield of supported methods */ + if (method != GST_RTSP_INVALID) + client->supported_methods |= method; + } + g_strfreev (options); + + indx++; + } + + if (!found_wfd_method) { + GST_ERROR_OBJECT (client, + "WFD client is not supporting WFD mandatory message : org.wfa.wfd1.0..."); + goto no_required_methods; + } + + /* Checking mandatory method */ + if (!(client->supported_methods & GST_RTSP_SET_PARAMETER)) { + GST_ERROR_OBJECT (client, + "WFD client is not supporting WFD mandatory message : SET_PARAMETER..."); + goto no_required_methods; + } + + /* Checking mandatory method */ + if (!(client->supported_methods & GST_RTSP_GET_PARAMETER)) { + GST_ERROR_OBJECT (client, + "WFD client is not supporting WFD mandatory message : GET_PARAMETER..."); + goto no_required_methods; + } + + if (!(client->supported_methods & GST_RTSP_OPTIONS)) { + GST_INFO_OBJECT (client, "assuming OPTIONS is supported by client..."); + client->supported_methods |= GST_RTSP_OPTIONS; + } + + return TRUE; + +/* ERRORS */ +no_required_methods: + { + GST_ELEMENT_ERROR (client, RESOURCE, OPEN_READ, (NULL), + ("WFD Client does not support mandatory methods.")); + return FALSE; + } +} +#endif + +typedef enum +{ + M1_REQ_MSG, + M1_RES_MSG, + M2_REQ_MSG, + M2_RES_MSG, + M3_REQ_MSG, + M3_RES_MSG, + M4_REQ_MSG, + M4_RES_MSG, + M5_REQ_MSG, + TEARDOWN_TRIGGER, +} GstWFDMessageType; + +static gboolean +_set_negotiated_resolution(GstRTSPWFDClient *client, + guint32 width, guint32 height) +{ + GstRTSPClient *parent_client = GST_RTSP_CLIENT_CAST (client); + + GstRTSPMediaFactory *factory = NULL; + GstRTSPMountPoints *mount_points = NULL; + gchar *path = NULL; + gint matched = 0; + gboolean ret = TRUE; + + if (!(mount_points = gst_rtsp_client_get_mount_points (parent_client))) { + ret = FALSE; + GST_ERROR_OBJECT (client, "Failed to set negotiated resolution: no mount points..."); + goto no_mount_points; + } + + path = g_strdup(WFD_MOUNT_POINT); + if (!path) { + ret = FALSE; + GST_ERROR_OBJECT (client, "Failed to set negotiated resolution: no path..."); + goto no_path; + } + + if (!(factory = gst_rtsp_mount_points_match (mount_points, + path, &matched))) { + GST_ERROR_OBJECT (client, "Failed to set negotiated resolution: no factory..."); + ret = FALSE; + goto no_factory; + } + + gst_rtsp_media_factory_wfd_set_negotiated_resolution(factory, + width, height); + ret = TRUE; + + g_object_unref(factory); + +no_factory: + g_free(path); +no_path: + g_object_unref(mount_points); +no_mount_points: + return ret; +} + +static void +_set_wfd_message_body (GstRTSPWFDClient * client, GstWFDMessageType msg_type, + gchar ** data, guint * len) +{ + GString *buf = NULL; + GstWFDMessage *msg = NULL; + GstWFDResult wfd_res = GST_WFD_EINVAL; + GstRTSPWFDClientPrivate *priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client); + + buf = g_string_new (""); + + if (msg_type == M3_REQ_MSG) { + /* create M3 request to be sent */ + wfd_res = gst_wfd_message_new (&msg); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, "Failed to create wfd message..."); + goto error; + } + + wfd_res = gst_wfd_message_init (msg); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, "Failed to init wfd message..."); + goto error; + } + + /* set the supported audio formats by the WFD server */ + wfd_res = + gst_wfd_message_set_supported_audio_format (msg, GST_WFD_AUDIO_UNKNOWN, + GST_WFD_FREQ_UNKNOWN, GST_WFD_CHANNEL_UNKNOWN, 0, 0); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, + "Failed to set supported audio formats on wfd message..."); + goto error; + } + + /* set the supported Video formats by the WFD server */ + wfd_res = + gst_wfd_message_set_supported_video_format (msg, GST_WFD_VIDEO_UNKNOWN, + GST_WFD_VIDEO_CEA_RESOLUTION, GST_WFD_CEA_UNKNOWN, GST_WFD_CEA_UNKNOWN, + GST_WFD_VESA_UNKNOWN, GST_WFD_HH_UNKNOWN, GST_WFD_H264_UNKNOWN_PROFILE, + GST_WFD_H264_LEVEL_UNKNOWN, 0, 0, 0, 0, 0, 0); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, + "Failed to set supported video formats on wfd message..."); + goto error; + } + + wfd_res = gst_wfd_message_set_display_edid (msg, 0, 0, NULL); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, + "Failed to set display edid type on wfd message..."); + goto error; + } + + if (priv->protection_enabled) { + wfd_res = + gst_wfd_message_set_contentprotection_type (msg, GST_WFD_HDCP_NONE, + 0); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, + "Failed to set supported content protection type on wfd message..."); + goto error; + } + } + + /* set the preffered RTP ports for the WFD server */ + wfd_res = + gst_wfd_messge_set_prefered_rtp_ports (msg, GST_WFD_RTSP_TRANS_UNKNOWN, + GST_WFD_RTSP_PROFILE_UNKNOWN, GST_WFD_RTSP_LOWER_TRANS_UNKNOWN, 0, 0); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, + "Failed to set supported video formats on wfd message..."); + goto error; + } + + *data = gst_wfd_message_param_names_as_text (msg); + if (*data == NULL) { + GST_ERROR_OBJECT (client, "Failed to get wfd message as text..."); + goto error; + } else { + *len = strlen (*data); + } + } else if (msg_type == M4_REQ_MSG) { + GstRTSPUrl *url = NULL; + + GstRTSPClient *parent_client = GST_RTSP_CLIENT_CAST (client); + GstRTSPConnection *connection = + gst_rtsp_client_get_connection (parent_client); + + /* Parameters for the preffered audio formats */ + GstWFDAudioFormats taudiocodec = GST_WFD_AUDIO_UNKNOWN; + GstWFDAudioFreq taudiofreq = GST_WFD_FREQ_UNKNOWN; + GstWFDAudioChannels taudiochannels = GST_WFD_CHANNEL_UNKNOWN; + + /* Parameters for the preffered video formats */ + GstWFDVideoCEAResolution tcCEAResolution = GST_WFD_CEA_UNKNOWN; + GstWFDVideoVESAResolution tcVESAResolution = GST_WFD_VESA_UNKNOWN; + GstWFDVideoHHResolution tcHHResolution = GST_WFD_HH_UNKNOWN; + GstWFDVideoH264Profile tcProfile; + GstWFDVideoH264Level tcLevel; + guint64 resolution_supported = 0; + + url = gst_rtsp_connection_get_url (connection); + if (url == NULL) { + GST_ERROR_OBJECT (client, "Failed to get connection URL"); + return; + } + + /* Logic to negotiate with information of M3 response */ + /* create M4 request to be sent */ + wfd_res = gst_wfd_message_new (&msg); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, "Failed to create wfd message..."); + goto error; + } + + wfd_res = gst_wfd_message_init (msg); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, "Failed to init wfd message..."); + goto error; + } + + buf = g_string_new (""); + g_string_append_printf (buf, "rtsp://"); + /* FIXME-WFD : Should set host's URL, but url->host is client's URL */ + g_string_append (buf, url->host); + g_string_append_printf (buf, "/wfd1.0/streamid=0"); + wfd_res = + gst_wfd_message_set_presentation_url (msg, g_string_free (buf, FALSE), + NULL); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, "Failed to set presentation url"); + goto error; + } + + /* set the preffered audio formats */ + if (priv->caCodec & GST_WFD_AUDIO_AC3) { + GST_ERROR_OBJECT (client, "AC3 is not supported"); + goto error; + } else if (priv->caCodec & GST_WFD_AUDIO_AAC) { + taudiocodec = GST_WFD_AUDIO_AAC; + } else if (priv->caCodec & GST_WFD_AUDIO_LPCM) { + taudiocodec = GST_WFD_AUDIO_LPCM; + } + priv->caCodec = taudiocodec; + + if (priv->cFreq & GST_WFD_FREQ_48000) + taudiofreq = GST_WFD_FREQ_48000; + else if (priv->cFreq & GST_WFD_FREQ_44100) + taudiofreq = GST_WFD_FREQ_44100; + priv->cFreq = taudiofreq; + + /* TODO-WFD: Currently only 2 channels is present */ + if (priv->cChanels & GST_WFD_CHANNEL_8) + taudiochannels = GST_WFD_CHANNEL_2; + else if (priv->cChanels & GST_WFD_CHANNEL_6) + taudiochannels = GST_WFD_CHANNEL_2; + else if (priv->cChanels & GST_WFD_CHANNEL_4) + taudiochannels = GST_WFD_CHANNEL_2; + else if (priv->cChanels & GST_WFD_CHANNEL_2) + taudiochannels = GST_WFD_CHANNEL_2; + priv->cChanels = taudiochannels; + + wfd_res = + gst_wfd_message_set_prefered_audio_format (msg, taudiocodec, taudiofreq, + taudiochannels, priv->cBitwidth, priv->caLatency); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (priv, "Failed to set preffered audio formats..."); + goto error; + } + + /* Set the preffered video formats */ + priv->cvCodec = GST_WFD_VIDEO_H264; + priv->cProfile = tcProfile = GST_WFD_H264_BASE_PROFILE; + priv->cLevel = tcLevel = GST_WFD_H264_LEVEL_3_1; + + resolution_supported = priv->video_resolution_supported; + + /* TODO-WFD: Need to verify this logic + if(priv->edid_supported) { + if (priv->edid_hres < 1920) resolution_supported = resolution_supported & 0x8C7F; + if (priv->edid_hres < 1280) resolution_supported = resolution_supported & 0x1F; + if (priv->edid_hres < 720) resolution_supported = resolution_supported & 0x01; + } + */ + + if (priv->video_native_resolution == GST_WFD_VIDEO_CEA_RESOLUTION) { + tcCEAResolution = + wfd_get_prefered_resolution (resolution_supported, + priv->cCEAResolution, priv->video_native_resolution, &priv->cMaxWidth, + &priv->cMaxHeight, &priv->cFramerate, &priv->cInterleaved); + GST_DEBUG + ("wfd negotiated resolution: %08x, width: %d, height: %d, framerate: %d, interleaved: %d", + tcCEAResolution, priv->cMaxWidth, priv->cMaxHeight, priv->cFramerate, + priv->cInterleaved); + } else if (priv->video_native_resolution == GST_WFD_VIDEO_VESA_RESOLUTION) { + tcVESAResolution = + wfd_get_prefered_resolution (resolution_supported, + priv->cVESAResolution, priv->video_native_resolution, + &priv->cMaxWidth, &priv->cMaxHeight, &priv->cFramerate, + &priv->cInterleaved); + GST_DEBUG + ("wfd negotiated resolution: %08x, width: %d, height: %d, framerate: %d, interleaved: %d", + tcVESAResolution, priv->cMaxWidth, priv->cMaxHeight, priv->cFramerate, + priv->cInterleaved); + } else if (priv->video_native_resolution == GST_WFD_VIDEO_HH_RESOLUTION) { + tcHHResolution = + wfd_get_prefered_resolution (resolution_supported, + priv->cHHResolution, priv->video_native_resolution, &priv->cMaxWidth, + &priv->cMaxHeight, &priv->cFramerate, &priv->cInterleaved); + GST_DEBUG + ("wfd negotiated resolution: %08x, width: %d, height: %d, framerate: %d, interleaved: %d", + tcHHResolution, priv->cMaxWidth, priv->cMaxHeight, priv->cFramerate, + priv->cInterleaved); + } + + if (!_set_negotiated_resolution(client, priv->cMaxWidth, + priv->cMaxHeight)) { + GST_ERROR_OBJECT (client, "Failed to set negotiated " + "resolution to media factory..."); + } + + wfd_res = + gst_wfd_message_set_prefered_video_format (msg, priv->cvCodec, + priv->video_native_resolution, GST_WFD_CEA_UNKNOWN, tcCEAResolution, + tcVESAResolution, tcHHResolution, tcProfile, tcLevel, priv->cvLatency, + priv->cMaxWidth, priv->cMaxHeight, priv->cmin_slice_size, + priv->cslice_enc_params, priv->cframe_rate_control); + + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, "Failed to set preffered video formats..."); + goto error; + } + + /* set the preffered RTP ports for the WFD server */ + wfd_res = + gst_wfd_messge_set_prefered_rtp_ports (msg, GST_WFD_RTSP_TRANS_RTP, + GST_WFD_RTSP_PROFILE_AVP, GST_WFD_RTSP_LOWER_TRANS_UDP, priv->crtp_port0, priv->crtp_port1); + if (wfd_res != GST_WFD_OK) { + GST_ERROR_OBJECT (client, + "Failed to set supported video formats on wfd message..."); + goto error; + } + + *data = gst_wfd_message_as_text (msg); + if (*data == NULL) { + GST_ERROR_OBJECT (client, "Failed to get wfd message as text..."); + goto error; + } else { + *len = strlen (*data); + } + } else if (msg_type == M5_REQ_MSG) { + g_string_append (buf, "wfd_trigger_method: SETUP"); + g_string_append (buf, "\r\n"); + *len = buf->len; + *data = g_string_free (buf, FALSE); + } else if (msg_type == TEARDOWN_TRIGGER) { + g_string_append (buf, "wfd_trigger_method: TEARDOWN"); + g_string_append (buf, "\r\n"); + *len = buf->len; + *data = g_string_free (buf, FALSE); + } else { + return; + } + + return; + +error: + *data = NULL; + *len = 0; + + return; +} + +/** +* prepare_request: +* @client: client object +* @request : requst message to be prepared +* @method : RTSP method of the request +* @url : url need to be in the request +* @message_type : WFD message type +* @trigger_type : trigger method to be used for M5 mainly +* +* Prepares request based on @method & @message_type +* +* Returns: a #GstRTSPResult. +*/ +GstRTSPResult +prepare_request (GstRTSPWFDClient * client, GstRTSPMessage * request, + GstRTSPMethod method, gchar * url) +{ + GstRTSPResult res = GST_RTSP_OK; + gchar *str = NULL; + + if (method == GST_RTSP_GET_PARAMETER || method == GST_RTSP_SET_PARAMETER) { + g_free (url); + url = g_strdup ("rtsp://localhost/wfd1.0"); + } + + GST_DEBUG_OBJECT (client, "Preparing request: %d", method); + + /* initialize the request */ + res = gst_rtsp_message_init_request (request, method, url); + if (res < 0) { + GST_ERROR ("init request failed"); + return res; + } + + switch (method) { + /* Prepare OPTIONS request to send */ + case GST_RTSP_OPTIONS:{ + /* add wfd specific require filed "org.wfa.wfd1.0" */ + str = g_strdup ("org.wfa.wfd1.0"); + res = gst_rtsp_message_add_header (request, GST_RTSP_HDR_REQUIRE, str); + if (res < 0) { + GST_ERROR ("Failed to add header"); + g_free (str); + return res; + } + + g_free (str); + break; + } + + /* Prepare GET_PARAMETER request */ + case GST_RTSP_GET_PARAMETER:{ + gchar *msg = NULL; + guint msglen = 0; + GString *msglength; + + /* add content type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_TYPE, + "text/parameters"); + if (res < 0) { + GST_ERROR ("Failed to add header"); + return res; + } + + _set_wfd_message_body (client, M3_REQ_MSG, &msg, &msglen); + msglength = g_string_new (""); + g_string_append_printf (msglength, "%d", msglen); + GST_DEBUG ("M3 server side message body: %s", msg); + + /* add content-length type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_LENGTH, + g_string_free (msglength, FALSE)); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + res = gst_rtsp_message_set_body (request, (guint8 *) msg, msglen); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + g_free (msg); + break; + } + + /* Prepare SET_PARAMETER request */ + case GST_RTSP_SET_PARAMETER:{ + gchar *msg = NULL; + guint msglen = 0; + GString *msglength; + + /* add content type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_TYPE, + "text/parameters"); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp request..."); + goto error; + } + + _set_wfd_message_body (client, M4_REQ_MSG, &msg, &msglen); + msglength = g_string_new (""); + g_string_append_printf (msglength, "%d", msglen); + GST_DEBUG ("M4 server side message body: %s", msg); + + /* add content-length type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_LENGTH, + g_string_free (msglength, FALSE)); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + res = gst_rtsp_message_set_body (request, (guint8 *) msg, msglen); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + g_free (msg); + break; + } + + default:{ + } + } + + return res; + +error: + return GST_RTSP_ERROR; +} + +GstRTSPResult +prepare_trigger_request (GstRTSPWFDClient * client, GstRTSPMessage * request, + GstWFDTriggerType trigger_type, gchar * url) +{ + GstRTSPResult res = GST_RTSP_OK; + + /* initialize the request */ + res = gst_rtsp_message_init_request (request, GST_RTSP_SET_PARAMETER, url); + if (res < 0) { + GST_ERROR ("init request failed"); + return res; + } + + switch (trigger_type) { + case WFD_TRIGGER_SETUP:{ + gchar *msg; + guint msglen = 0; + GString *msglength; + + /* add content type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_TYPE, + "text/parameters"); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp request..."); + goto error; + } + + _set_wfd_message_body (client, M5_REQ_MSG, &msg, &msglen); + msglength = g_string_new (""); + g_string_append_printf (msglength, "%d", msglen); + GST_DEBUG ("M5 server side message body: %s", msg); + + /* add content-length type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_LENGTH, + g_string_free (msglength, FALSE)); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + res = gst_rtsp_message_set_body (request, (guint8 *) msg, msglen); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + g_free (msg); + break; + } + case WFD_TRIGGER_TEARDOWN:{ + gchar *msg; + guint msglen = 0; + GString *msglength; + + /* add content type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_TYPE, + "text/parameters"); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp request..."); + goto error; + } + + _set_wfd_message_body (client, TEARDOWN_TRIGGER, &msg, &msglen); + msglength = g_string_new (""); + g_string_append_printf (msglength, "%d", msglen); + GST_DEBUG ("Trigger TEARDOWN server side message body: %s", msg); + + /* add content-length type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_LENGTH, + g_string_free (msglength, FALSE)); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + res = gst_rtsp_message_set_body (request, (guint8 *) msg, msglen); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + g_free (msg); + break; + } + /* TODO-WFD: implement to handle other trigger type */ + default:{ + } + } + + return res; + +error: + return res; +} + + +void +send_request (GstRTSPWFDClient * client, GstRTSPSession * session, + GstRTSPMessage * request) +{ + GstRTSPResult res = GST_RTSP_OK; + GstRTSPClient *parent_client = GST_RTSP_CLIENT_CAST (client); + + /* remove any previous header */ + gst_rtsp_message_remove_header (request, GST_RTSP_HDR_SESSION, -1); + + /* add the new session header for new session ids */ + if (session) { + guint timeout; + const gchar *sessionid = NULL; + gchar *str; + + sessionid = gst_rtsp_session_get_sessionid (session); + GST_INFO_OBJECT (client, "Session id : %s", sessionid); + + timeout = gst_rtsp_session_get_timeout (session); + if (timeout != DEFAULT_WFD_TIMEOUT) + str = g_strdup_printf ("%s; timeout=%d", sessionid, timeout); + else + str = g_strdup (sessionid); + + gst_rtsp_message_take_header (request, GST_RTSP_HDR_SESSION, str); + } +#if 0 + if (gst_debug_category_get_threshold (rtsp_wfd_client_debug) >= GST_LEVEL_LOG) { + gst_rtsp_message_dump (request); + } +#endif + res = gst_rtsp_client_send_message (parent_client, session, request); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "gst_rtsp_client_send_message failed : %d", res); + } + + gst_rtsp_message_unset (request); +} + +/** +* prepare_response: +* @client: client object +* @request : requst message received +* @response : response to be prepare based on request +* @method : RTSP method +* +* prepare response to the request based on @method & @message_type +* +* Returns: a #GstRTSPResult. +*/ +GstRTSPResult +prepare_response (GstRTSPWFDClient * client, GstRTSPMessage * request, + GstRTSPMessage * response, GstRTSPMethod method) +{ + GstRTSPResult res = GST_RTSP_OK; + + switch (method) { + /* prepare OPTIONS response */ + case GST_RTSP_OPTIONS:{ + GstRTSPMethod options; + gchar *tmp = NULL; + gchar *str = NULL; + gchar *user_agent = NULL; + + options = GST_RTSP_OPTIONS | + GST_RTSP_PAUSE | + GST_RTSP_PLAY | + GST_RTSP_SETUP | + GST_RTSP_GET_PARAMETER | GST_RTSP_SET_PARAMETER | GST_RTSP_TEARDOWN; + + str = gst_rtsp_options_as_text (options); + + /*append WFD specific method */ + tmp = g_strdup (", org.wfa.wfd1.0"); + g_strlcat (str, tmp, strlen (tmp) + strlen (str) + 1); + + gst_rtsp_message_init_response (response, GST_RTSP_STS_OK, + gst_rtsp_status_as_text (GST_RTSP_STS_OK), request); + + gst_rtsp_message_add_header (response, GST_RTSP_HDR_PUBLIC, str); + g_free (str); + str = NULL; + res = + gst_rtsp_message_get_header (request, GST_RTSP_HDR_USER_AGENT, + &user_agent, 0); + if (res == GST_RTSP_OK) { + gst_rtsp_message_add_header (response, GST_RTSP_HDR_USER_AGENT, + user_agent); + } else + res = GST_RTSP_OK; + break; + } + default: + GST_ERROR_OBJECT (client, "Unhandled method..."); + return GST_RTSP_EINVAL; + break; + } + + return res; +} + +static void +send_generic_wfd_response (GstRTSPWFDClient * client, GstRTSPStatusCode code, + GstRTSPContext * ctx) +{ + GstRTSPResult res = GST_RTSP_OK; + GstRTSPClient *parent_client = GST_RTSP_CLIENT_CAST (client); + + gst_rtsp_message_init_response (ctx->response, code, + gst_rtsp_status_as_text (code), ctx->request); + + res = gst_rtsp_client_send_message (parent_client, NULL, ctx->response); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "gst_rtsp_client_send_message failed : %d", res); + } +} + + +static GstRTSPResult +handle_M1_message (GstRTSPWFDClient * client) +{ + GstRTSPResult res = GST_RTSP_OK; + GstRTSPMessage request = { 0 }; + + res = prepare_request (client, &request, GST_RTSP_OPTIONS, (gchar *) "*"); + if (GST_RTSP_OK != res) { + GST_ERROR_OBJECT (client, "Failed to prepare M1 request....\n"); + return res; + } + + GST_DEBUG_OBJECT (client, "Sending M1 request.. (OPTIONS request)"); + + send_request (client, NULL, &request); + + return res; +} + +/** +* handle_M3_message: +* @client: client object +* +* Handles M3 WFD message. +* This API will send M3 message (GET_PARAMETER) to WFDSink to query supported formats by the WFDSink. +* After getting supported formats info, this API will set those values on WFDConfigMessage obj +* +* Returns: a #GstRTSPResult. +*/ +static GstRTSPResult +handle_M3_message (GstRTSPWFDClient * client) +{ + GstRTSPResult res = GST_RTSP_OK; + GstRTSPMessage request = { 0 }; + GstRTSPUrl *url = NULL; + gchar *url_str = NULL; + + GstRTSPClient *parent_client = GST_RTSP_CLIENT_CAST (client); + GstRTSPConnection *connection = + gst_rtsp_client_get_connection (parent_client); + + url = gst_rtsp_connection_get_url (connection); + if (url == NULL) { + GST_ERROR_OBJECT (client, "Failed to get connection URL"); + res = GST_RTSP_ERROR; + goto error; + } + + url_str = gst_rtsp_url_get_request_uri (url); + if (url_str == NULL) { + GST_ERROR_OBJECT (client, "Failed to get connection URL"); + res = GST_RTSP_ERROR; + goto error; + } + + res = prepare_request (client, &request, GST_RTSP_GET_PARAMETER, url_str); + if (GST_RTSP_OK != res) { + GST_ERROR_OBJECT (client, "Failed to prepare M3 request....\n"); + goto error; + } + + GST_DEBUG_OBJECT (client, "Sending GET_PARAMETER request message (M3)..."); + + send_request (client, NULL, &request); + + return res; + +error: + return res; +} + +static GstRTSPResult +handle_M4_message (GstRTSPWFDClient * client) +{ + GstRTSPResult res = GST_RTSP_OK; + GstRTSPMessage request = { 0 }; + GstRTSPUrl *url = NULL; + gchar *url_str = NULL; + + GstRTSPClient *parent_client = GST_RTSP_CLIENT_CAST (client); + GstRTSPConnection *connection = + gst_rtsp_client_get_connection (parent_client); + + url = gst_rtsp_connection_get_url (connection); + if (url == NULL) { + GST_ERROR_OBJECT (client, "Failed to get connection URL"); + res = GST_RTSP_ERROR; + goto error; + } + + url_str = gst_rtsp_url_get_request_uri (url); + if (url_str == NULL) { + GST_ERROR_OBJECT (client, "Failed to get connection URL"); + res = GST_RTSP_ERROR; + goto error; + } + + res = prepare_request (client, &request, GST_RTSP_SET_PARAMETER, url_str); + if (GST_RTSP_OK != res) { + GST_ERROR_OBJECT (client, "Failed to prepare M4 request....\n"); + goto error; + } + + GST_DEBUG_OBJECT (client, "Sending SET_PARAMETER request message (M4)..."); + + send_request (client, NULL, &request); + + return res; + +error: + return res; +} + +GstRTSPResult +gst_rtsp_wfd_client_trigger_request (GstRTSPWFDClient * client, + GstWFDTriggerType type) +{ + GstRTSPResult res = GST_RTSP_OK; + GstRTSPMessage request = { 0 }; + GstRTSPUrl *url = NULL; + gchar *url_str = NULL; + + GstRTSPClient *parent_client = GST_RTSP_CLIENT_CAST (client); + GstRTSPConnection *connection = + gst_rtsp_client_get_connection (parent_client); + + url = gst_rtsp_connection_get_url (connection); + if (url == NULL) { + GST_ERROR_OBJECT (client, "Failed to get connection URL"); + res = GST_RTSP_ERROR; + goto error; + } + + url_str = gst_rtsp_url_get_request_uri (url); + if (url_str == NULL) { + GST_ERROR_OBJECT (client, "Failed to get connection URL"); + res = GST_RTSP_ERROR; + goto error; + } + + res = prepare_trigger_request (client, &request, type, url_str); + if (GST_RTSP_OK != res) { + GST_ERROR_OBJECT (client, "Failed to prepare M5 request....\n"); + goto error; + } + + GST_DEBUG_OBJECT (client, "Sending trigger request message...: %d", type); + + send_request (client, NULL, &request); + + return res; + +error: + return res; +} + +GstRTSPResult +gst_rtsp_wfd_client_set_video_supported_resolution (GstRTSPWFDClient * client, + guint64 supported_reso) +{ + GstRTSPResult res = GST_RTSP_OK; + GstRTSPWFDClientPrivate *priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client); + priv->video_resolution_supported = supported_reso; + GST_DEBUG ("Resolution : %lld", supported_reso); + + return res; +} + +static gboolean +wfd_ckeck_keep_alive_response (gpointer userdata) +{ + GstRTSPWFDClient *client = (GstRTSPWFDClient *)userdata; + GstRTSPWFDClientPrivate *priv; + if (!client) { + return FALSE; + } + priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client); + if (priv->keep_alive_flag) { + return FALSE; + } + else { + GST_INFO ("%p: source error notification", client); + // FIXME Do something here. Maybe emit some signal? + return FALSE; + } +} + +/*Sending keep_alive (M16) message. + Without calling prepare_request function.*/ +static GstRTSPResult +handle_M16_message (GstRTSPWFDClient * client) +{ + GstRTSPResult res = GST_RTSP_OK; + GstRTSPMessage request = { 0 }; + gchar *url_str = NULL; + + url_str = g_strdup("rtsp://localhost/wfd1.0"); + + res = gst_rtsp_message_init_request (&request, GST_RTSP_GET_PARAMETER, url_str); + if (res < 0) { + GST_ERROR ("init request failed"); + return FALSE; + } + + send_request (client, NULL, &request); + return GST_RTSP_OK; +} + +/*CHecking whether source has got response of any request. + * If yes, keep alive message is sent otherwise error message + * will be displayed.*/ +static gboolean +keep_alive_condition(gpointer userdata) +{ + GstRTSPWFDClient *client; + GstRTSPWFDClientPrivate *priv; + GstRTSPResult res; + client = (GstRTSPWFDClient *)userdata; + if (!client) { + return FALSE; + } + priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client); + + g_mutex_lock(&priv->keep_alive_lock); + if(!priv->keep_alive_flag) { + g_timeout_add(5000, wfd_ckeck_keep_alive_response, client); + } + else { + GST_DEBUG_OBJECT (client, "have received last keep alive message response"); + } + + GST_DEBUG("sending keep alive message"); + res = handle_M16_message(client); + if(res) { + priv->keep_alive_flag = FALSE; + } + else { + GST_ERROR_OBJECT (client, "Failed to send Keep Alive Message"); + g_mutex_unlock(&priv->keep_alive_lock); + return FALSE; + } + g_mutex_unlock(&priv->keep_alive_lock); + return TRUE; +} + +static +void wfd_set_keep_alive_condition(GstRTSPClient * client) +{ + GstRTSPWFDClient *wfd_client; + wfd_client = GST_RTSP_WFD_CLIENT(client); + + g_timeout_add((DEFAULT_WFD_TIMEOUT-5)*1000, keep_alive_condition, wfd_client); +} diff --git a/gst/rtsp-server/rtsp-client-wfd.h b/gst/rtsp-server/rtsp-client-wfd.h new file mode 100644 index 0000000..4300181 --- /dev/null +++ b/gst/rtsp-server/rtsp-client-wfd.h @@ -0,0 +1,154 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include + +#ifndef __GST_RTSP_WFD_CLIENT_H__ +#define __GST_RTSP_WFD_CLIENT_H__ + +G_BEGIN_DECLS + +typedef struct _GstRTSPWFDClient GstRTSPWFDClient; +typedef struct _GstRTSPWFDClientClass GstRTSPWFDClientClass; +typedef struct _GstRTSPWFDClientPrivate GstRTSPWFDClientPrivate; + +#include "rtsp-context.h" +#include "rtsp-mount-points.h" +#include "rtsp-sdp.h" +#include "rtsp-auth.h" +#include "rtsp-client.h" + +#define GST_TYPE_RTSP_WFD_CLIENT (gst_rtsp_wfd_client_get_type ()) +#define GST_IS_RTSP_WFD_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_WFD_CLIENT)) +#define GST_IS_RTSP_WFD_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_WFD_CLIENT)) +#define GST_RTSP_WFD_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_WFD_CLIENT, GstRTSPWFDClientClass)) +#define GST_RTSP_WFD_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_WFD_CLIENT, GstRTSPWFDClient)) +#define GST_RTSP_WFD_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_WFD_CLIENT, GstRTSPWFDClientClass)) +#define GST_RTSP_WFD_CLIENT_CAST(obj) ((GstRTSPWFDClient*)(obj)) +#define GST_RTSP_WFD_CLIENT_CLASS_CAST(klass) ((GstRTSPWFDClientClass*)(klass)) + + +/** + * + */ +typedef enum { + WFD_TRIGGER_SETUP, + WFD_TRIGGER_PAUSE, + WFD_TRIGGER_TEARDOWN, + WFD_TRIGGER_PLAY +} GstWFDTriggerType; + +/** + * GstRTSPWFDClientSendFunc: + * @client: a #GstRTSPWFDClient + * @message: a #GstRTSPMessage + * @close: close the connection + * @user_data: user data when registering the callback + * + * This callback is called when @client wants to send @message. When @close is + * %TRUE, the connection should be closed when the message has been sent. + * + * Returns: %TRUE on success. + */ +typedef gboolean (*GstRTSPWFDClientSendFunc) (GstRTSPWFDClient *client, + GstRTSPMessage *message, + gboolean close, + gpointer user_data); + +/** + * GstRTSPWFDClient: + * + * The client object represents the connection and its state with a client. + */ +struct _GstRTSPWFDClient { + GstRTSPClient parent; + + gint supported_methods; + /*< private >*/ + GstRTSPWFDClientPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPWFDClientClass: + * @create_sdp: called when the SDP needs to be created for media. + * @configure_client_media: called when the stream in media needs to be configured. + * The default implementation will configure the blocksize on the payloader when + * spcified in the request headers. + * @configure_client_transport: called when the client transport needs to be + * configured. + * @params_set: set parameters. This function should also initialize the + * RTSP response(ctx->response) via a call to gst_rtsp_message_init_response() + * @params_get: get parameters. This function should also initialize the + * RTSP response(ctx->response) via a call to gst_rtsp_message_init_response() + * + * The client class structure. + */ +struct _GstRTSPWFDClientClass { + GstRTSPClientClass parent_class; + + /* signals */ + void (*wfd_options_request) (GstRTSPWFDClient *client); + void (*wfd_get_param_request) (GstRTSPWFDClient *client); + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING_LARGE]; +}; + +GType gst_rtsp_wfd_client_get_type (void); + +GstRTSPWFDClient * gst_rtsp_wfd_client_new (void); + +void gst_rtsp_wfd_client_start_wfd(GstRTSPWFDClient *client); +GstRTSPResult gst_rtsp_wfd_client_trigger_request ( + GstRTSPWFDClient * client, GstWFDTriggerType type); + +GstRTSPResult gst_rtsp_wfd_client_set_video_supported_resolution ( + GstRTSPWFDClient * client, guint64 supported_reso); + +/** + * GstRTSPWFDClientSessionFilterFunc: + * @client: a #GstRTSPWFDClient object + * @sess: a #GstRTSPSession in @client + * @user_data: user data that has been given to gst_rtsp_wfd_client_session_filter() + * + * This function will be called by the gst_rtsp_wfd_client_session_filter(). An + * implementation should return a value of #GstRTSPFilterResult. + * + * When this function returns #GST_RTSP_FILTER_REMOVE, @sess will be removed + * from @client. + * + * A return value of #GST_RTSP_FILTER_KEEP will leave @sess untouched in + * @client. + * + * A value of #GST_RTSP_FILTER_REF will add @sess to the result #GList of + * gst_rtsp_wfd_client_session_filter(). + * + * Returns: a #GstRTSPFilterResult. + */ +typedef GstRTSPFilterResult (*GstRTSPWFDClientSessionFilterFunc) (GstRTSPWFDClient *client, + GstRTSPSession *sess, + gpointer user_data); + + + +G_END_DECLS + +#endif /* __GST_RTSP_WFD_CLIENT_H__ */ diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c new file mode 100644 index 0000000..45abd90 --- /dev/null +++ b/gst/rtsp-server/rtsp-client.c @@ -0,0 +1,3553 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-client + * @short_description: A client connection state + * @see_also: #GstRTSPServer, #GstRTSPThreadPool + * + * The client object handles the connection with a client for as long as a TCP + * connection is open. + * + * A #GstRTSPClient is created by #GstRTSPServer when a new connection is + * accepted and it inherits the #GstRTSPMountPoints, #GstRTSPSessionPool, + * #GstRTSPAuth and #GstRTSPThreadPool from the server. + * + * The client connection should be configured with the #GstRTSPConnection using + * gst_rtsp_client_set_connection() before it can be attached to a #GMainContext + * using gst_rtsp_client_attach(). From then on the client will handle requests + * on the connection. + * + * Use gst_rtsp_client_session_filter() to iterate or modify all the + * #GstRTSPSession objects managed by the client object. + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include +#include + +#include + +#include "rtsp-client.h" +#include "rtsp-sdp.h" +#include "rtsp-params.h" + +#define GST_RTSP_CLIENT_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_CLIENT, GstRTSPClientPrivate)) + +/* locking order: + * send_lock, lock, tunnels_lock + */ + +struct _GstRTSPClientPrivate +{ + GMutex lock; /* protects everything else */ + GMutex send_lock; + GstRTSPConnection *connection; + GstRTSPWatch *watch; + GMainContext *watch_context; + guint close_seq; + gchar *server_ip; + gboolean is_ipv6; + + GstRTSPClientSendFunc send_func; /* protected by send_lock */ + gpointer send_data; /* protected by send_lock */ + GDestroyNotify send_notify; /* protected by send_lock */ + + GstRTSPSessionPool *session_pool; + gulong session_removed_id; + GstRTSPMountPoints *mount_points; + GstRTSPAuth *auth; + GstRTSPThreadPool *thread_pool; + + /* used to cache the media in the last requested DESCRIBE so that + * we can pick it up in the next SETUP immediately */ + gchar *path; + GstRTSPMedia *media; + + GList *transports; + GList *sessions; + guint sessions_cookie; + + gboolean drop_backlog; +}; + +static GMutex tunnels_lock; +static GHashTable *tunnels; /* protected by tunnels_lock */ + +#define DEFAULT_SESSION_POOL NULL +#define DEFAULT_MOUNT_POINTS NULL +#define DEFAULT_DROP_BACKLOG TRUE + +enum +{ + PROP_0, + PROP_SESSION_POOL, + PROP_MOUNT_POINTS, + PROP_DROP_BACKLOG, + PROP_LAST +}; + +enum +{ + SIGNAL_CLOSED, + SIGNAL_NEW_SESSION, + SIGNAL_OPTIONS_REQUEST, + SIGNAL_DESCRIBE_REQUEST, + SIGNAL_SETUP_REQUEST, + SIGNAL_PLAY_REQUEST, + SIGNAL_PAUSE_REQUEST, + SIGNAL_TEARDOWN_REQUEST, + SIGNAL_SET_PARAMETER_REQUEST, + SIGNAL_GET_PARAMETER_REQUEST, + SIGNAL_HANDLE_RESPONSE, + SIGNAL_SEND_MESSAGE, + SIGNAL_LAST +}; + +GST_DEBUG_CATEGORY_STATIC (rtsp_client_debug); +#define GST_CAT_DEFAULT rtsp_client_debug + +static guint gst_rtsp_client_signals[SIGNAL_LAST] = { 0 }; + +static void gst_rtsp_client_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec); +static void gst_rtsp_client_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec); +static void gst_rtsp_client_finalize (GObject * obj); + +static GstSDPMessage *create_sdp (GstRTSPClient * client, GstRTSPMedia * media); +static void unlink_session_transports (GstRTSPClient * client, + GstRTSPSession * session, GstRTSPSessionMedia * sessmedia); +static gboolean default_configure_client_media (GstRTSPClient * client, + GstRTSPMedia * media, GstRTSPStream * stream, GstRTSPContext * ctx); +static gboolean default_configure_client_transport (GstRTSPClient * client, + GstRTSPContext * ctx, GstRTSPTransport * ct); +static GstRTSPResult default_params_set (GstRTSPClient * client, + GstRTSPContext * ctx); +static GstRTSPResult default_params_get (GstRTSPClient * client, + GstRTSPContext * ctx); +static gchar *default_make_path_from_uri (GstRTSPClient * client, + const GstRTSPUrl * uri); +static gboolean default_handle_options_request (GstRTSPClient * client, + GstRTSPContext * ctx); +static gboolean default_handle_set_param_request (GstRTSPClient * client, + GstRTSPContext * ctx); +static gboolean default_handle_get_param_request (GstRTSPClient * client, + GstRTSPContext * ctx); +static void client_session_removed (GstRTSPSessionPool * pool, + GstRTSPSession * session, GstRTSPClient * client); + +G_DEFINE_TYPE (GstRTSPClient, gst_rtsp_client, G_TYPE_OBJECT); + +static void +gst_rtsp_client_class_init (GstRTSPClientClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPClientPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->get_property = gst_rtsp_client_get_property; + gobject_class->set_property = gst_rtsp_client_set_property; + gobject_class->finalize = gst_rtsp_client_finalize; + + klass->create_sdp = create_sdp; + klass->configure_client_media = default_configure_client_media; + klass->configure_client_transport = default_configure_client_transport; + klass->params_set = default_params_set; + klass->params_get = default_params_get; + klass->make_path_from_uri = default_make_path_from_uri; + klass->handle_options_request = default_handle_options_request; + klass->handle_set_param_request = default_handle_set_param_request; + klass->handle_get_param_request = default_handle_get_param_request; + + g_object_class_install_property (gobject_class, PROP_SESSION_POOL, + g_param_spec_object ("session-pool", "Session Pool", + "The session pool to use for client session", + GST_TYPE_RTSP_SESSION_POOL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_MOUNT_POINTS, + g_param_spec_object ("mount-points", "Mount Points", + "The mount points to use for client session", + GST_TYPE_RTSP_MOUNT_POINTS, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_DROP_BACKLOG, + g_param_spec_boolean ("drop-backlog", "Drop Backlog", + "Drop data when the backlog queue is full", + DEFAULT_DROP_BACKLOG, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_rtsp_client_signals[SIGNAL_CLOSED] = + g_signal_new ("closed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstRTSPClientClass, closed), NULL, NULL, + g_cclosure_marshal_generic, G_TYPE_NONE, 0, G_TYPE_NONE); + + gst_rtsp_client_signals[SIGNAL_NEW_SESSION] = + g_signal_new ("new-session", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstRTSPClientClass, new_session), NULL, NULL, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, GST_TYPE_RTSP_SESSION); + + gst_rtsp_client_signals[SIGNAL_OPTIONS_REQUEST] = + g_signal_new ("options-request", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPClientClass, options_request), + NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, + GST_TYPE_RTSP_CONTEXT); + + gst_rtsp_client_signals[SIGNAL_DESCRIBE_REQUEST] = + g_signal_new ("describe-request", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPClientClass, describe_request), + NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, + GST_TYPE_RTSP_CONTEXT); + + gst_rtsp_client_signals[SIGNAL_SETUP_REQUEST] = + g_signal_new ("setup-request", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPClientClass, setup_request), + NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, + GST_TYPE_RTSP_CONTEXT); + + gst_rtsp_client_signals[SIGNAL_PLAY_REQUEST] = + g_signal_new ("play-request", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPClientClass, play_request), + NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, + GST_TYPE_RTSP_CONTEXT); + + gst_rtsp_client_signals[SIGNAL_PAUSE_REQUEST] = + g_signal_new ("pause-request", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPClientClass, pause_request), + NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, + GST_TYPE_RTSP_CONTEXT); + + gst_rtsp_client_signals[SIGNAL_TEARDOWN_REQUEST] = + g_signal_new ("teardown-request", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPClientClass, teardown_request), + NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, + GST_TYPE_RTSP_CONTEXT); + + gst_rtsp_client_signals[SIGNAL_SET_PARAMETER_REQUEST] = + g_signal_new ("set-parameter-request", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPClientClass, + set_parameter_request), NULL, NULL, g_cclosure_marshal_generic, + G_TYPE_NONE, 1, GST_TYPE_RTSP_CONTEXT); + + gst_rtsp_client_signals[SIGNAL_GET_PARAMETER_REQUEST] = + g_signal_new ("get-parameter-request", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPClientClass, + get_parameter_request), NULL, NULL, g_cclosure_marshal_generic, + G_TYPE_NONE, 1, GST_TYPE_RTSP_CONTEXT); + + gst_rtsp_client_signals[SIGNAL_HANDLE_RESPONSE] = + g_signal_new ("handle-response", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPClientClass, + handle_response), NULL, NULL, g_cclosure_marshal_generic, + G_TYPE_NONE, 1, GST_TYPE_RTSP_CONTEXT); + + /** + * GstRTSPClient::send-message: + * @client: The RTSP client + * @session: (type GstRtspServer.RTSPSession): The session + * @message: (type GstRtsp.RTSPMessage): The message + */ + gst_rtsp_client_signals[SIGNAL_SEND_MESSAGE] = + g_signal_new ("send-message", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, + G_TYPE_NONE, 2, GST_TYPE_RTSP_CONTEXT, G_TYPE_POINTER); + + tunnels = + g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + g_mutex_init (&tunnels_lock); + + GST_DEBUG_CATEGORY_INIT (rtsp_client_debug, "rtspclient", 0, "GstRTSPClient"); +} + +static void +gst_rtsp_client_init (GstRTSPClient * client) +{ + GstRTSPClientPrivate *priv = GST_RTSP_CLIENT_GET_PRIVATE (client); + + client->priv = priv; + + g_mutex_init (&priv->lock); + g_mutex_init (&priv->send_lock); + priv->close_seq = 0; + priv->drop_backlog = DEFAULT_DROP_BACKLOG; +} + +static GstRTSPFilterResult +filter_session_media (GstRTSPSession * sess, GstRTSPSessionMedia * sessmedia, + gpointer user_data) +{ + GstRTSPClient *client = GST_RTSP_CLIENT (user_data); + + gst_rtsp_session_media_set_state (sessmedia, GST_STATE_NULL); + unlink_session_transports (client, sess, sessmedia); + + /* unmanage the media in the session */ + return GST_RTSP_FILTER_REMOVE; +} + +static void +client_watch_session (GstRTSPClient * client, GstRTSPSession * session) +{ + GstRTSPClientPrivate *priv = client->priv; + + g_mutex_lock (&priv->lock); + /* check if we already know about this session */ + if (g_list_find (priv->sessions, session) == NULL) { + GST_INFO ("watching session %p", session); + + priv->sessions = g_list_prepend (priv->sessions, g_object_ref (session)); + priv->sessions_cookie++; + + /* connect removed session handler, it will be disconnected when the last + * session gets removed */ + if (priv->session_removed_id == 0) + priv->session_removed_id = g_signal_connect_data (priv->session_pool, + "session-removed", G_CALLBACK (client_session_removed), + g_object_ref (client), (GClosureNotify) g_object_unref, 0); + } + g_mutex_unlock (&priv->lock); + + return; +} + +/* should be called with lock */ +static void +client_unwatch_session (GstRTSPClient * client, GstRTSPSession * session, + GList * link) +{ + GstRTSPClientPrivate *priv = client->priv; + + GST_INFO ("client %p: unwatch session %p", client, session); + + if (link == NULL) { + link = g_list_find (priv->sessions, session); + if (link == NULL) + return; + } + + priv->sessions = g_list_delete_link (priv->sessions, link); + priv->sessions_cookie++; + + /* if this was the last session, disconnect the handler. + * This will also drop the extra client ref */ + if (!priv->sessions) { + g_signal_handler_disconnect (priv->session_pool, priv->session_removed_id); + priv->session_removed_id = 0; + } + + /* unlink all media managed in this session */ + gst_rtsp_session_filter (session, filter_session_media, client); + + /* remove the session */ + g_object_unref (session); +} + +static GstRTSPFilterResult +cleanup_session (GstRTSPClient * client, GstRTSPSession * sess, + gpointer user_data) +{ + return GST_RTSP_FILTER_REMOVE; +} + +/* A client is finalized when the connection is broken */ +static void +gst_rtsp_client_finalize (GObject * obj) +{ + GstRTSPClient *client = GST_RTSP_CLIENT (obj); + GstRTSPClientPrivate *priv = client->priv; + + GST_INFO ("finalize client %p", client); + + if (priv->watch) + gst_rtsp_watch_set_flushing (priv->watch, TRUE); + gst_rtsp_client_set_send_func (client, NULL, NULL, NULL); + + if (priv->watch) + g_source_destroy ((GSource *) priv->watch); + + if (priv->watch_context) + g_main_context_unref (priv->watch_context); + + /* all sessions should have been removed by now. We keep a ref to + * the client object for the session removed handler. The ref is + * dropped when the last session is removed from the list. */ + g_assert (priv->sessions == NULL); + g_assert (priv->session_removed_id == 0); + + if (priv->connection) + gst_rtsp_connection_free (priv->connection); + if (priv->session_pool) { + g_object_unref (priv->session_pool); + } + if (priv->mount_points) + g_object_unref (priv->mount_points); + if (priv->auth) + g_object_unref (priv->auth); + if (priv->thread_pool) + g_object_unref (priv->thread_pool); + + if (priv->path) + g_free (priv->path); + if (priv->media) { + gst_rtsp_media_unprepare (priv->media); + g_object_unref (priv->media); + } + + g_free (priv->server_ip); + g_mutex_clear (&priv->lock); + g_mutex_clear (&priv->send_lock); + + G_OBJECT_CLASS (gst_rtsp_client_parent_class)->finalize (obj); +} + +static void +gst_rtsp_client_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + GstRTSPClient *client = GST_RTSP_CLIENT (object); + GstRTSPClientPrivate *priv = client->priv; + + switch (propid) { + case PROP_SESSION_POOL: + g_value_take_object (value, gst_rtsp_client_get_session_pool (client)); + break; + case PROP_MOUNT_POINTS: + g_value_take_object (value, gst_rtsp_client_get_mount_points (client)); + break; + case PROP_DROP_BACKLOG: + g_value_set_boolean (value, priv->drop_backlog); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_client_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + GstRTSPClient *client = GST_RTSP_CLIENT (object); + GstRTSPClientPrivate *priv = client->priv; + + switch (propid) { + case PROP_SESSION_POOL: + gst_rtsp_client_set_session_pool (client, g_value_get_object (value)); + break; + case PROP_MOUNT_POINTS: + gst_rtsp_client_set_mount_points (client, g_value_get_object (value)); + break; + case PROP_DROP_BACKLOG: + g_mutex_lock (&priv->lock); + priv->drop_backlog = g_value_get_boolean (value); + g_mutex_unlock (&priv->lock); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +/** + * gst_rtsp_client_new: + * + * Create a new #GstRTSPClient instance. + * + * Returns: (transfer full): a new #GstRTSPClient + */ +GstRTSPClient * +gst_rtsp_client_new (void) +{ + GstRTSPClient *result; + + result = g_object_new (GST_TYPE_RTSP_CLIENT, NULL); + + return result; +} + +static void +send_message (GstRTSPClient * client, GstRTSPContext * ctx, + GstRTSPMessage * message, gboolean close) +{ + GstRTSPClientPrivate *priv = client->priv; + + gst_rtsp_message_add_header (message, GST_RTSP_HDR_SERVER, + "GStreamer RTSP server"); + + /* remove any previous header */ + gst_rtsp_message_remove_header (message, GST_RTSP_HDR_SESSION, -1); + + /* add the new session header for new session ids */ + if (ctx->session) { + gst_rtsp_message_take_header (message, GST_RTSP_HDR_SESSION, + gst_rtsp_session_get_header (ctx->session)); + } + + if (gst_debug_category_get_threshold (rtsp_client_debug) >= GST_LEVEL_LOG) { + gst_rtsp_message_dump (message); + } + + if (close) + gst_rtsp_message_add_header (message, GST_RTSP_HDR_CONNECTION, "close"); + + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_SEND_MESSAGE], + 0, ctx, message); + + g_mutex_lock (&priv->send_lock); + if (priv->send_func) + priv->send_func (client, message, close, priv->send_data); + g_mutex_unlock (&priv->send_lock); + + gst_rtsp_message_unset (message); +} + +static void +send_generic_response (GstRTSPClient * client, GstRTSPStatusCode code, + GstRTSPContext * ctx) +{ + gst_rtsp_message_init_response (ctx->response, code, + gst_rtsp_status_as_text (code), ctx->request); + + ctx->session = NULL; + + send_message (client, ctx, ctx->response, FALSE); +} + +static void +send_option_not_supported_response (GstRTSPClient * client, + GstRTSPContext * ctx, const gchar * unsupported_options) +{ + GstRTSPStatusCode code = GST_RTSP_STS_OPTION_NOT_SUPPORTED; + + gst_rtsp_message_init_response (ctx->response, code, + gst_rtsp_status_as_text (code), ctx->request); + + if (unsupported_options != NULL) { + gst_rtsp_message_add_header (ctx->response, GST_RTSP_HDR_UNSUPPORTED, + unsupported_options); + } + + ctx->session = NULL; + + send_message (client, ctx, ctx->response, FALSE); +} + +static gboolean +paths_are_equal (const gchar * path1, const gchar * path2, gint len2) +{ + if (path1 == NULL || path2 == NULL) + return FALSE; + + if (strlen (path1) != len2) + return FALSE; + + if (strncmp (path1, path2, len2)) + return FALSE; + + return TRUE; +} + +/* this function is called to initially find the media for the DESCRIBE request + * but is cached for when the same client (without breaking the connection) is + * doing a setup for the exact same url. */ +static GstRTSPMedia * +find_media (GstRTSPClient * client, GstRTSPContext * ctx, gchar * path, + gint * matched) +{ + GstRTSPClientPrivate *priv = client->priv; + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + gint path_len; + + /* find the longest matching factory for the uri first */ + if (!(factory = gst_rtsp_mount_points_match (priv->mount_points, + path, matched))) + goto no_factory; + + ctx->factory = factory; + + if (!gst_rtsp_auth_check (GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS)) + goto no_factory_access; + + if (!gst_rtsp_auth_check (GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT)) + goto not_authorized; + + if (matched) + path_len = *matched; + else + path_len = strlen (path); + + if (!paths_are_equal (priv->path, path, path_len)) { + GstRTSPThread *thread; + + /* remove any previously cached values before we try to construct a new + * media for uri */ + if (priv->path) + g_free (priv->path); + priv->path = NULL; + if (priv->media) { + gst_rtsp_media_unprepare (priv->media); + g_object_unref (priv->media); + } + priv->media = NULL; + + /* prepare the media and add it to the pipeline */ + if (!(media = gst_rtsp_media_factory_construct (factory, ctx->uri))) + goto no_media; + + ctx->media = media; + + thread = gst_rtsp_thread_pool_get_thread (priv->thread_pool, + GST_RTSP_THREAD_TYPE_MEDIA, ctx); + if (thread == NULL) + goto no_thread; + + /* prepare the media */ + if (!(gst_rtsp_media_prepare (media, thread))) + goto no_prepare; + + /* now keep track of the uri and the media */ + priv->path = g_strndup (path, path_len); + priv->media = media; + } else { + /* we have seen this path before, used cached media */ + media = priv->media; + ctx->media = media; + GST_INFO ("reusing cached media %p for path %s", media, priv->path); + } + + g_object_unref (factory); + ctx->factory = NULL; + + if (media) + g_object_ref (media); + + return media; + + /* ERRORS */ +no_factory: + { + GST_ERROR ("client %p: no factory for path %s", client, path); + send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx); + return NULL; + } +no_factory_access: + { + GST_ERROR ("client %p: not authorized to see factory path %s", client, + path); + /* error reply is already sent */ + return NULL; + } +not_authorized: + { + GST_ERROR ("client %p: not authorized for factory path %s", client, path); + /* error reply is already sent */ + return NULL; + } +no_media: + { + GST_ERROR ("client %p: can't create media", client); + send_generic_response (client, GST_RTSP_STS_BAD_REQUEST, ctx); + g_object_unref (factory); + ctx->factory = NULL; + return NULL; + } +no_thread: + { + GST_ERROR ("client %p: can't create thread", client); + send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx); + g_object_unref (media); + ctx->media = NULL; + g_object_unref (factory); + ctx->factory = NULL; + return NULL; + } +no_prepare: + { + GST_ERROR ("client %p: can't prepare media", client); + send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx); + g_object_unref (media); + ctx->media = NULL; + g_object_unref (factory); + ctx->factory = NULL; + return NULL; + } +} + +static gboolean +do_send_data (GstBuffer * buffer, guint8 channel, GstRTSPClient * client) +{ + GstRTSPClientPrivate *priv = client->priv; + GstRTSPMessage message = { 0 }; + GstMapInfo map_info; + guint8 *data; + guint usize; + + gst_rtsp_message_init_data (&message, channel); + + /* FIXME, need some sort of iovec RTSPMessage here */ + if (!gst_buffer_map (buffer, &map_info, GST_MAP_READ)) + return FALSE; + + gst_rtsp_message_take_body (&message, map_info.data, map_info.size); + + g_mutex_lock (&priv->send_lock); + if (priv->send_func) + priv->send_func (client, &message, FALSE, priv->send_data); + g_mutex_unlock (&priv->send_lock); + + gst_rtsp_message_steal_body (&message, &data, &usize); + gst_buffer_unmap (buffer, &map_info); + + gst_rtsp_message_unset (&message); + + return TRUE; +} + +static void +link_transport (GstRTSPClient * client, GstRTSPSession * session, + GstRTSPStreamTransport * trans) +{ + GstRTSPClientPrivate *priv = client->priv; + + GST_DEBUG ("client %p: linking transport %p", client, trans); + + gst_rtsp_stream_transport_set_callbacks (trans, + (GstRTSPSendFunc) do_send_data, + (GstRTSPSendFunc) do_send_data, client, NULL); + + priv->transports = g_list_prepend (priv->transports, trans); + + /* make sure our session can't expire */ + gst_rtsp_session_prevent_expire (session); +} + +static void +link_session_transports (GstRTSPClient * client, GstRTSPSession * session, + GstRTSPSessionMedia * sessmedia) +{ + guint n_streams, i; + + n_streams = + gst_rtsp_media_n_streams (gst_rtsp_session_media_get_media (sessmedia)); + for (i = 0; i < n_streams; i++) { + GstRTSPStreamTransport *trans; + const GstRTSPTransport *tr; + + /* get the transport, if there is no transport configured, skip this stream */ + trans = gst_rtsp_session_media_get_transport (sessmedia, i); + if (trans == NULL) + continue; + + tr = gst_rtsp_stream_transport_get_transport (trans); + + if (tr->lower_transport == GST_RTSP_LOWER_TRANS_TCP) { + /* for TCP, link the stream to the TCP connection of the client */ + link_transport (client, session, trans); + } + } +} + +static void +unlink_transport (GstRTSPClient * client, GstRTSPSession * session, + GstRTSPStreamTransport * trans) +{ + GstRTSPClientPrivate *priv = client->priv; + + GST_DEBUG ("client %p: unlinking transport %p", client, trans); + + gst_rtsp_stream_transport_set_callbacks (trans, NULL, NULL, NULL, NULL); + + priv->transports = g_list_remove (priv->transports, trans); + + /* our session can now expire */ + gst_rtsp_session_allow_expire (session); +} + +static void +unlink_session_transports (GstRTSPClient * client, GstRTSPSession * session, + GstRTSPSessionMedia * sessmedia) +{ + guint n_streams, i; + + n_streams = + gst_rtsp_media_n_streams (gst_rtsp_session_media_get_media (sessmedia)); + for (i = 0; i < n_streams; i++) { + GstRTSPStreamTransport *trans; + const GstRTSPTransport *tr; + + /* get the transport, if there is no transport configured, skip this stream */ + trans = gst_rtsp_session_media_get_transport (sessmedia, i); + if (trans == NULL) + continue; + + tr = gst_rtsp_stream_transport_get_transport (trans); + + if (tr->lower_transport == GST_RTSP_LOWER_TRANS_TCP) { + /* for TCP, unlink the stream from the TCP connection of the client */ + unlink_transport (client, session, trans); + } + } +} + +/** + * gst_rtsp_client_close: + * @client: a #GstRTSPClient + * + * Close the connection of @client and remove all media it was managing. + * + * Since: 1.4 + */ +void +gst_rtsp_client_close (GstRTSPClient * client) +{ + GstRTSPClientPrivate *priv = client->priv; + const gchar *tunnelid; + + GST_DEBUG ("client %p: closing connection", client); + + if (priv->connection) { + if ((tunnelid = gst_rtsp_connection_get_tunnelid (priv->connection))) { + g_mutex_lock (&tunnels_lock); + /* remove from tunnelids */ + g_hash_table_remove (tunnels, tunnelid); + g_mutex_unlock (&tunnels_lock); + } + gst_rtsp_connection_close (priv->connection); + } + + /* connection is now closed, destroy the watch which will also cause the + * closed signal to be emitted */ + if (priv->watch) { + GST_DEBUG ("client %p: destroying watch", client); + g_source_destroy ((GSource *) priv->watch); + priv->watch = NULL; + gst_rtsp_client_set_send_func (client, NULL, NULL, NULL); + } +} + +static gchar * +default_make_path_from_uri (GstRTSPClient * client, const GstRTSPUrl * uri) +{ + gchar *path; + + if (uri->query) + path = g_strconcat (uri->abspath, "?", uri->query, NULL); + else + path = g_strdup (uri->abspath); + + return path; +} + +static gboolean +handle_teardown_request (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPClientPrivate *priv = client->priv; + GstRTSPClientClass *klass; + GstRTSPSession *session; + GstRTSPSessionMedia *sessmedia; + GstRTSPStatusCode code; + gchar *path; + gint matched; + gboolean keep_session; + + if (!ctx->session) + goto no_session; + + session = ctx->session; + + if (!ctx->uri) + goto no_uri; + + klass = GST_RTSP_CLIENT_GET_CLASS (client); + path = klass->make_path_from_uri (client, ctx->uri); + + /* get a handle to the configuration of the media in the session */ + sessmedia = gst_rtsp_session_get_media (session, path, &matched); + if (!sessmedia) + goto not_found; + + /* only aggregate control for now.. */ + if (path[matched] != '\0') + goto no_aggregate; + + g_free (path); + + ctx->sessmedia = sessmedia; + + /* we emit the signal before closing the connection */ + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_TEARDOWN_REQUEST], + 0, ctx); + + /* make sure we unblock the backlog and don't accept new messages + * on the watch */ + if (priv->watch != NULL) + gst_rtsp_watch_set_flushing (priv->watch, TRUE); + + /* unlink the all TCP callbacks */ + unlink_session_transports (client, session, sessmedia); + + gst_rtsp_session_media_set_state (sessmedia, GST_STATE_NULL); + + /* allow messages again so that we can send the reply */ + if (priv->watch != NULL) + gst_rtsp_watch_set_flushing (priv->watch, FALSE); + + /* unmanage the media in the session, returns false if all media session + * are torn down. */ + keep_session = gst_rtsp_session_release_media (session, sessmedia); + + /* construct the response now */ + code = GST_RTSP_STS_OK; + gst_rtsp_message_init_response (ctx->response, code, + gst_rtsp_status_as_text (code), ctx->request); + + send_message (client, ctx, ctx->response, TRUE); + + if (!keep_session) { + /* remove the session */ + gst_rtsp_session_pool_remove (priv->session_pool, session); + } + + return TRUE; + + /* ERRORS */ +no_session: + { + GST_ERROR ("client %p: no session", client); + send_generic_response (client, GST_RTSP_STS_SESSION_NOT_FOUND, ctx); + return FALSE; + } +no_uri: + { + GST_ERROR ("client %p: no uri supplied", client); + send_generic_response (client, GST_RTSP_STS_BAD_REQUEST, ctx); + return FALSE; + } +not_found: + { + GST_ERROR ("client %p: no media for uri", client); + send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx); + g_free (path); + return FALSE; + } +no_aggregate: + { + GST_ERROR ("client %p: no aggregate path %s", client, path); + send_generic_response (client, + GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, ctx); + g_free (path); + return FALSE; + } +} + +static GstRTSPResult +default_params_set (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPResult res; + + res = gst_rtsp_params_set (client, ctx); + + return res; +} + +static GstRTSPResult +default_params_get (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPResult res; + + res = gst_rtsp_params_get (client, ctx); + + return res; +} + +static gboolean +default_handle_get_param_request (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPResult res; + guint8 *data; + guint size; + + res = gst_rtsp_message_get_body (ctx->request, &data, &size); + if (res != GST_RTSP_OK) + goto bad_request; + + if (size == 0) { + /* no body, keep-alive request */ + send_generic_response (client, GST_RTSP_STS_OK, ctx); + } else { + /* there is a body, handle the params */ + res = GST_RTSP_CLIENT_GET_CLASS (client)->params_get (client, ctx); + if (res != GST_RTSP_OK) + goto bad_request; + + send_message (client, ctx, ctx->response, FALSE); + } + + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_GET_PARAMETER_REQUEST], + 0, ctx); + + return TRUE; + + /* ERRORS */ +bad_request: + { + GST_ERROR ("client %p: bad request", client); + send_generic_response (client, GST_RTSP_STS_BAD_REQUEST, ctx); + return FALSE; + } +} + +static gboolean +default_handle_set_param_request (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPResult res; + guint8 *data; + guint size; + + res = gst_rtsp_message_get_body (ctx->request, &data, &size); + if (res != GST_RTSP_OK) + goto bad_request; + + if (size == 0) { + /* no body, keep-alive request */ + send_generic_response (client, GST_RTSP_STS_OK, ctx); + } else { + /* there is a body, handle the params */ + res = GST_RTSP_CLIENT_GET_CLASS (client)->params_set (client, ctx); + if (res != GST_RTSP_OK) + goto bad_request; + + send_message (client, ctx, ctx->response, FALSE); + } + + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_SET_PARAMETER_REQUEST], + 0, ctx); + + return TRUE; + + /* ERRORS */ +bad_request: + { + GST_ERROR ("client %p: bad request", client); + send_generic_response (client, GST_RTSP_STS_BAD_REQUEST, ctx); + return FALSE; + } +} + +static gboolean +handle_pause_request (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPSession *session; + GstRTSPClientClass *klass; + GstRTSPSessionMedia *sessmedia; + GstRTSPStatusCode code; + GstRTSPState rtspstate; + gchar *path; + gint matched; + + if (!(session = ctx->session)) + goto no_session; + + if (!ctx->uri) + goto no_uri; + + klass = GST_RTSP_CLIENT_GET_CLASS (client); + path = klass->make_path_from_uri (client, ctx->uri); + + /* get a handle to the configuration of the media in the session */ + sessmedia = gst_rtsp_session_get_media (session, path, &matched); + if (!sessmedia) + goto not_found; + + if (path[matched] != '\0') + goto no_aggregate; + + g_free (path); + + ctx->sessmedia = sessmedia; + + rtspstate = gst_rtsp_session_media_get_rtsp_state (sessmedia); + /* the session state must be playing or recording */ + if (rtspstate != GST_RTSP_STATE_PLAYING && + rtspstate != GST_RTSP_STATE_RECORDING) + goto invalid_state; + + /* unlink the all TCP callbacks */ + unlink_session_transports (client, session, sessmedia); + + /* then pause sending */ + gst_rtsp_session_media_set_state (sessmedia, GST_STATE_PAUSED); + + /* construct the response now */ + code = GST_RTSP_STS_OK; + gst_rtsp_message_init_response (ctx->response, code, + gst_rtsp_status_as_text (code), ctx->request); + + send_message (client, ctx, ctx->response, FALSE); + + /* the state is now READY */ + gst_rtsp_session_media_set_rtsp_state (sessmedia, GST_RTSP_STATE_READY); + + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_PAUSE_REQUEST], 0, ctx); + + return TRUE; + + /* ERRORS */ +no_session: + { + GST_ERROR ("client %p: no seesion", client); + send_generic_response (client, GST_RTSP_STS_SESSION_NOT_FOUND, ctx); + return FALSE; + } +no_uri: + { + GST_ERROR ("client %p: no uri supplied", client); + send_generic_response (client, GST_RTSP_STS_BAD_REQUEST, ctx); + return FALSE; + } +not_found: + { + GST_ERROR ("client %p: no media for uri", client); + send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx); + g_free (path); + return FALSE; + } +no_aggregate: + { + GST_ERROR ("client %p: no aggregate path %s", client, path); + send_generic_response (client, + GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, ctx); + g_free (path); + return FALSE; + } +invalid_state: + { + GST_ERROR ("client %p: not PLAYING or RECORDING", client); + send_generic_response (client, GST_RTSP_STS_METHOD_NOT_VALID_IN_THIS_STATE, + ctx); + return FALSE; + } +} + +/* convert @url and @path to a URL used as a content base for the factory + * located at @path */ +static gchar * +make_base_url (GstRTSPClient * client, GstRTSPUrl * url, const gchar * path) +{ + GstRTSPUrl tmp; + gchar *result; + const gchar *trail; + + /* check for trailing '/' and append one */ + trail = (path[strlen (path) - 1] != '/' ? "/" : ""); + + tmp = *url; + tmp.user = NULL; + tmp.passwd = NULL; + tmp.abspath = g_strdup_printf ("%s%s", path, trail); + tmp.query = NULL; + result = gst_rtsp_url_get_request_uri (&tmp); + g_free (tmp.abspath); + + return result; +} + +static gboolean +handle_play_request (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPSession *session; + GstRTSPClientClass *klass; + GstRTSPSessionMedia *sessmedia; + GstRTSPMedia *media; + GstRTSPStatusCode code; + GstRTSPUrl *uri; + gchar *str; + GstRTSPTimeRange *range; + GstRTSPResult res; + GstRTSPState rtspstate; + GstRTSPRangeUnit unit = GST_RTSP_RANGE_NPT; + gchar *path, *rtpinfo; + gint matched; + + if (!(session = ctx->session)) + goto no_session; + + if (!(uri = ctx->uri)) + goto no_uri; + + klass = GST_RTSP_CLIENT_GET_CLASS (client); + path = klass->make_path_from_uri (client, uri); + + /* get a handle to the configuration of the media in the session */ + sessmedia = gst_rtsp_session_get_media (session, path, &matched); + if (!sessmedia) + goto not_found; + + if (path[matched] != '\0') + goto no_aggregate; + + g_free (path); + + ctx->sessmedia = sessmedia; + ctx->media = media = gst_rtsp_session_media_get_media (sessmedia); + + /* the session state must be playing or ready */ + rtspstate = gst_rtsp_session_media_get_rtsp_state (sessmedia); + if (rtspstate != GST_RTSP_STATE_PLAYING && rtspstate != GST_RTSP_STATE_READY) + goto invalid_state; + + /* in play we first unsuspend, media could be suspended from SDP or PAUSED */ + if (!gst_rtsp_media_unsuspend (media)) + goto unsuspend_failed; + + /* parse the range header if we have one */ + res = gst_rtsp_message_get_header (ctx->request, GST_RTSP_HDR_RANGE, &str, 0); + if (res == GST_RTSP_OK) { + if (gst_rtsp_range_parse (str, &range) == GST_RTSP_OK) { + /* we have a range, seek to the position */ + unit = range->unit; + gst_rtsp_media_seek (media, range); + gst_rtsp_range_free (range); + } + } + + /* link the all TCP callbacks */ + link_session_transports (client, session, sessmedia); + + /* grab RTPInfo from the media now */ + rtpinfo = gst_rtsp_session_media_get_rtpinfo (sessmedia); + + /* construct the response now */ + code = GST_RTSP_STS_OK; + gst_rtsp_message_init_response (ctx->response, code, + gst_rtsp_status_as_text (code), ctx->request); + + /* add the RTP-Info header */ + if (rtpinfo) + gst_rtsp_message_take_header (ctx->response, GST_RTSP_HDR_RTP_INFO, + rtpinfo); + + /* add the range */ + str = gst_rtsp_media_get_range_string (media, TRUE, unit); + if (str) + gst_rtsp_message_take_header (ctx->response, GST_RTSP_HDR_RANGE, str); + + send_message (client, ctx, ctx->response, FALSE); + + /* start playing after sending the response */ + gst_rtsp_session_media_set_state (sessmedia, GST_STATE_PLAYING); + + gst_rtsp_session_media_set_rtsp_state (sessmedia, GST_RTSP_STATE_PLAYING); + + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_PLAY_REQUEST], 0, ctx); + + return TRUE; + + /* ERRORS */ +no_session: + { + GST_ERROR ("client %p: no session", client); + send_generic_response (client, GST_RTSP_STS_SESSION_NOT_FOUND, ctx); + return FALSE; + } +no_uri: + { + GST_ERROR ("client %p: no uri supplied", client); + send_generic_response (client, GST_RTSP_STS_BAD_REQUEST, ctx); + return FALSE; + } +not_found: + { + GST_ERROR ("client %p: media not found", client); + send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx); + return FALSE; + } +no_aggregate: + { + GST_ERROR ("client %p: no aggregate path %s", client, path); + send_generic_response (client, + GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, ctx); + g_free (path); + return FALSE; + } +invalid_state: + { + GST_ERROR ("client %p: not PLAYING or READY", client); + send_generic_response (client, GST_RTSP_STS_METHOD_NOT_VALID_IN_THIS_STATE, + ctx); + return FALSE; + } +unsuspend_failed: + { + GST_ERROR ("client %p: unsuspend failed", client); + send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx); + return FALSE; + } +} + +static void +do_keepalive (GstRTSPSession * session) +{ + GST_INFO ("keep session %p alive", session); + gst_rtsp_session_touch (session); +} + +/* parse @transport and return a valid transport in @tr. only transports + * supported by @stream are returned. Returns FALSE if no valid transport + * was found. */ +static gboolean +parse_transport (const char *transport, GstRTSPStream * stream, + GstRTSPTransport * tr) +{ + gint i; + gboolean res; + gchar **transports; + + res = FALSE; + gst_rtsp_transport_init (tr); + + GST_DEBUG ("parsing transports %s", transport); + + transports = g_strsplit (transport, ",", 0); + + /* loop through the transports, try to parse */ + for (i = 0; transports[i]; i++) { + res = gst_rtsp_transport_parse (transports[i], tr); + if (res != GST_RTSP_OK) { + /* no valid transport, search some more */ + GST_WARNING ("could not parse transport %s", transports[i]); + goto next; + } + + /* we have a transport, see if it's supported */ + if (!gst_rtsp_stream_is_transport_supported (stream, tr)) { + GST_WARNING ("unsupported transport %s", transports[i]); + goto next; + } + + /* we have a valid transport */ + GST_INFO ("found valid transport %s", transports[i]); + res = TRUE; + break; + + next: + gst_rtsp_transport_init (tr); + } + g_strfreev (transports); + + return res; +} + +static gboolean +default_configure_client_media (GstRTSPClient * client, GstRTSPMedia * media, + GstRTSPStream * stream, GstRTSPContext * ctx) +{ + GstRTSPMessage *request = ctx->request; + gchar *blocksize_str; + + if (gst_rtsp_message_get_header (request, GST_RTSP_HDR_BLOCKSIZE, + &blocksize_str, 0) == GST_RTSP_OK) { + guint64 blocksize; + gchar *end; + + blocksize = g_ascii_strtoull (blocksize_str, &end, 10); + if (end == blocksize_str) + goto parse_failed; + + /* we don't want to change the mtu when this media + * can be shared because it impacts other clients */ + if (gst_rtsp_media_is_shared (media)) + goto done; + + if (blocksize > G_MAXUINT) + blocksize = G_MAXUINT; + + gst_rtsp_stream_set_mtu (stream, blocksize); + } +done: + return TRUE; + + /* ERRORS */ +parse_failed: + { + GST_ERROR_OBJECT (client, "failed to parse blocksize"); + send_generic_response (client, GST_RTSP_STS_BAD_REQUEST, ctx); + return FALSE; + } +} + +static gboolean +default_configure_client_transport (GstRTSPClient * client, + GstRTSPContext * ctx, GstRTSPTransport * ct) +{ + GstRTSPClientPrivate *priv = client->priv; + + /* we have a valid transport now, set the destination of the client. */ + if (ct->lower_transport == GST_RTSP_LOWER_TRANS_UDP_MCAST) { + gboolean use_client_settings; + + use_client_settings = + gst_rtsp_auth_check (GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS); + + if (ct->destination && use_client_settings) { + GstRTSPAddress *addr; + + addr = gst_rtsp_stream_reserve_address (ctx->stream, ct->destination, + ct->port.min, ct->port.max - ct->port.min + 1, ct->ttl); + + if (addr == NULL) + goto no_address; + + gst_rtsp_address_free (addr); + } else { + GstRTSPAddress *addr; + GSocketFamily family; + + family = priv->is_ipv6 ? G_SOCKET_FAMILY_IPV6 : G_SOCKET_FAMILY_IPV4; + + addr = gst_rtsp_stream_get_multicast_address (ctx->stream, family); + if (addr == NULL) + goto no_address; + + g_free (ct->destination); + ct->destination = g_strdup (addr->address); + ct->port.min = addr->port; + ct->port.max = addr->port + addr->n_ports - 1; + ct->ttl = addr->ttl; + + gst_rtsp_address_free (addr); + } + } else { + GstRTSPUrl *url; + + url = gst_rtsp_connection_get_url (priv->connection); + g_free (ct->destination); + ct->destination = g_strdup (url->host); + + if (ct->lower_transport & GST_RTSP_LOWER_TRANS_TCP) { + GSocket *sock; + GSocketAddress *addr; + + sock = gst_rtsp_connection_get_read_socket (priv->connection); + if ((addr = g_socket_get_remote_address (sock, NULL))) { + /* our read port is the sender port of client */ + ct->client_port.min = + g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (addr)); + g_object_unref (addr); + } + if ((addr = g_socket_get_local_address (sock, NULL))) { + ct->server_port.max = + g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (addr)); + g_object_unref (addr); + } + sock = gst_rtsp_connection_get_write_socket (priv->connection); + if ((addr = g_socket_get_remote_address (sock, NULL))) { + /* our write port is the receiver port of client */ + ct->client_port.max = + g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (addr)); + g_object_unref (addr); + } + if ((addr = g_socket_get_local_address (sock, NULL))) { + ct->server_port.min = + g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (addr)); + g_object_unref (addr); + } + /* check if the client selected channels for TCP */ + if (ct->interleaved.min == -1 || ct->interleaved.max == -1) { + gst_rtsp_session_media_alloc_channels (ctx->sessmedia, + &ct->interleaved); + } + } + } + return TRUE; + + /* ERRORS */ +no_address: + { + GST_ERROR_OBJECT (client, "failed to acquire address for stream"); + return FALSE; + } +} + +static GstRTSPTransport * +make_server_transport (GstRTSPClient * client, GstRTSPContext * ctx, + GstRTSPTransport * ct) +{ + GstRTSPTransport *st; + GInetAddress *addr; + GSocketFamily family; + + /* prepare the server transport */ + gst_rtsp_transport_new (&st); + + st->trans = ct->trans; + st->profile = ct->profile; + st->lower_transport = ct->lower_transport; + + addr = g_inet_address_new_from_string (ct->destination); + + if (!addr) { + GST_ERROR ("failed to get inet addr from client destination"); + family = G_SOCKET_FAMILY_IPV4; + } else { + family = g_inet_address_get_family (addr); + g_object_unref (addr); + addr = NULL; + } + + switch (st->lower_transport) { + case GST_RTSP_LOWER_TRANS_UDP: + st->client_port = ct->client_port; + gst_rtsp_stream_get_server_port (ctx->stream, &st->server_port, family); + break; + case GST_RTSP_LOWER_TRANS_UDP_MCAST: + st->port = ct->port; + st->destination = g_strdup (ct->destination); + st->ttl = ct->ttl; + break; + case GST_RTSP_LOWER_TRANS_TCP: + st->interleaved = ct->interleaved; + st->client_port = ct->client_port; + st->server_port = ct->server_port; + default: + break; + } + + gst_rtsp_stream_get_ssrc (ctx->stream, &st->ssrc); + + return st; +} + +#define AES_128_KEY_LEN 16 +#define AES_256_KEY_LEN 32 + +#define HMAC_32_KEY_LEN 4 +#define HMAC_80_KEY_LEN 10 + +static gboolean +mikey_apply_policy (GstCaps * caps, GstMIKEYMessage * msg, guint8 policy) +{ + const gchar *srtp_cipher; + const gchar *srtp_auth; + const GstMIKEYPayload *sp; + guint i; + + /* loop over Security policy until we find one containing policy */ + for (i = 0;; i++) { + if ((sp = gst_mikey_message_find_payload (msg, GST_MIKEY_PT_SP, i)) == NULL) + break; + + if (((GstMIKEYPayloadSP *) sp)->policy == policy) + break; + } + + /* the default ciphers */ + srtp_cipher = "aes-128-icm"; + srtp_auth = "hmac-sha1-80"; + + /* now override the defaults with what is in the Security Policy */ + if (sp != NULL) { + guint len; + + /* collect all the params and go over them */ + len = gst_mikey_payload_sp_get_n_params (sp); + for (i = 0; i < len; i++) { + const GstMIKEYPayloadSPParam *param = + gst_mikey_payload_sp_get_param (sp, i); + + switch (param->type) { + case GST_MIKEY_SP_SRTP_ENC_ALG: + switch (param->val[0]) { + case 0: + srtp_cipher = "null"; + break; + case 2: + case 1: + srtp_cipher = "aes-128-icm"; + break; + default: + break; + } + break; + case GST_MIKEY_SP_SRTP_ENC_KEY_LEN: + switch (param->val[0]) { + case AES_128_KEY_LEN: + srtp_cipher = "aes-128-icm"; + break; + case AES_256_KEY_LEN: + srtp_cipher = "aes-256-icm"; + break; + default: + break; + } + break; + case GST_MIKEY_SP_SRTP_AUTH_ALG: + switch (param->val[0]) { + case 0: + srtp_auth = "null"; + break; + case 2: + case 1: + srtp_auth = "hmac-sha1-80"; + break; + default: + break; + } + break; + case GST_MIKEY_SP_SRTP_AUTH_KEY_LEN: + switch (param->val[0]) { + case HMAC_32_KEY_LEN: + srtp_auth = "hmac-sha1-32"; + break; + case HMAC_80_KEY_LEN: + srtp_auth = "hmac-sha1-80"; + break; + default: + break; + } + break; + case GST_MIKEY_SP_SRTP_SRTP_ENC: + break; + case GST_MIKEY_SP_SRTP_SRTCP_ENC: + break; + default: + break; + } + } + } + /* now configure the SRTP parameters */ + gst_caps_set_simple (caps, + "srtp-cipher", G_TYPE_STRING, srtp_cipher, + "srtp-auth", G_TYPE_STRING, srtp_auth, + "srtcp-cipher", G_TYPE_STRING, srtp_cipher, + "srtcp-auth", G_TYPE_STRING, srtp_auth, NULL); + + return TRUE; +} + +static gboolean +handle_mikey_data (GstRTSPClient * client, GstRTSPContext * ctx, + guint8 * data, gsize size) +{ + GstMIKEYMessage *msg; + guint i, n_cs; + GstCaps *caps = NULL; + GstMIKEYPayloadKEMAC *kemac; + const GstMIKEYPayloadKeyData *pkd; + GstBuffer *key; + + /* the MIKEY message contains a CSB or crypto session bundle. It is a + * set of Crypto Sessions protected with the same master key. + * In the context of SRTP, an RTP and its RTCP stream is part of a + * crypto session */ + if ((msg = gst_mikey_message_new_from_data (data, size, NULL, NULL)) == NULL) + goto parse_failed; + + /* we can only handle SRTP crypto sessions for now */ + if (msg->map_type != GST_MIKEY_MAP_TYPE_SRTP) + goto invalid_map_type; + + /* get the number of crypto sessions. This maps SSRC to its + * security parameters */ + n_cs = gst_mikey_message_get_n_cs (msg); + if (n_cs == 0) + goto no_crypto_sessions; + + /* we also need keys */ + if (!(kemac = (GstMIKEYPayloadKEMAC *) gst_mikey_message_find_payload + (msg, GST_MIKEY_PT_KEMAC, 0))) + goto no_keys; + + /* we don't support encrypted keys */ + if (kemac->enc_alg != GST_MIKEY_ENC_NULL + || kemac->mac_alg != GST_MIKEY_MAC_NULL) + goto unsupported_encryption; + + /* get Key data sub-payload */ + pkd = (const GstMIKEYPayloadKeyData *) + gst_mikey_payload_kemac_get_sub (&kemac->pt, 0); + + key = + gst_buffer_new_wrapped (g_memdup (pkd->key_data, pkd->key_len), + pkd->key_len); + + /* go over all crypto sessions and create the security policy for each + * SSRC */ + for (i = 0; i < n_cs; i++) { + const GstMIKEYMapSRTP *map = gst_mikey_message_get_cs_srtp (msg, i); + + caps = gst_caps_new_simple ("application/x-srtp", + "ssrc", G_TYPE_UINT, map->ssrc, + "roc", G_TYPE_UINT, map->roc, "srtp-key", GST_TYPE_BUFFER, key, NULL); + mikey_apply_policy (caps, msg, map->policy); + + gst_rtsp_stream_update_crypto (ctx->stream, map->ssrc, caps); + gst_caps_unref (caps); + } + gst_mikey_message_unref (msg); + + return TRUE; + + /* ERRORS */ +parse_failed: + { + GST_DEBUG_OBJECT (client, "failed to parse MIKEY message"); + return FALSE; + } +invalid_map_type: + { + GST_DEBUG_OBJECT (client, "invalid map type %d", msg->map_type); + goto cleanup_message; + } +no_crypto_sessions: + { + GST_DEBUG_OBJECT (client, "no crypto sessions"); + goto cleanup_message; + } +no_keys: + { + GST_DEBUG_OBJECT (client, "no keys found"); + goto cleanup_message; + } +unsupported_encryption: + { + GST_DEBUG_OBJECT (client, "unsupported key encryption"); + goto cleanup_message; + } +cleanup_message: + { + gst_mikey_message_unref (msg); + return FALSE; + } +} + +#define IS_STRIP_CHAR(c) (g_ascii_isspace ((guchar)(c)) || ((c) == '\"')) + +static void +strip_chars (gchar * str) +{ + gchar *s; + gsize len; + + len = strlen (str); + while (len--) { + if (!IS_STRIP_CHAR (str[len])) + break; + str[len] = '\0'; + } + for (s = str; *s && IS_STRIP_CHAR (*s); s++); + memmove (str, s, len + 1); +} + +/* KeyMgmt = "KeyMgmt" ":" key-mgmt-spec 0*("," key-mgmt-spec) + * key-mgmt-spec = "prot" "=" KMPID ";" ["uri" "=" %x22 URI %x22 ";"] + */ +static gboolean +handle_keymgmt (GstRTSPClient * client, GstRTSPContext * ctx, gchar * keymgmt) +{ + gchar **specs; + gint i, j; + + specs = g_strsplit (keymgmt, ",", 0); + for (i = 0; specs[i]; i++) { + gchar **split; + + split = g_strsplit (specs[i], ";", 0); + for (j = 0; split[j]; j++) { + g_strstrip (split[j]); + if (g_str_has_prefix (split[j], "prot=")) { + g_strstrip (split[j] + 5); + if (!g_str_equal (split[j] + 5, "mikey")) + break; + GST_DEBUG ("found mikey"); + } else if (g_str_has_prefix (split[j], "uri=")) { + strip_chars (split[j] + 4); + GST_DEBUG ("found uri '%s'", split[j] + 4); + } else if (g_str_has_prefix (split[j], "data=")) { + guchar *data; + gsize size; + strip_chars (split[j] + 5); + GST_DEBUG ("found data '%s'", split[j] + 5); + data = g_base64_decode_inplace (split[j] + 5, &size); + handle_mikey_data (client, ctx, data, size); + } + } + } + return TRUE; +} + +static gboolean +handle_setup_request (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPClientPrivate *priv = client->priv; + GstRTSPResult res; + GstRTSPUrl *uri; + gchar *transport, *keymgmt; + GstRTSPTransport *ct, *st; + GstRTSPStatusCode code; + GstRTSPSession *session; + GstRTSPStreamTransport *trans; + gchar *trans_str; + GstRTSPSessionMedia *sessmedia; + GstRTSPMedia *media; + GstRTSPStream *stream; + GstRTSPState rtspstate; + GstRTSPClientClass *klass; + gchar *path, *control; + gint matched; + gboolean new_session = FALSE; + + if (!ctx->uri) + goto no_uri; + + uri = ctx->uri; + klass = GST_RTSP_CLIENT_GET_CLASS (client); + path = klass->make_path_from_uri (client, uri); + + /* parse the transport */ + res = + gst_rtsp_message_get_header (ctx->request, GST_RTSP_HDR_TRANSPORT, + &transport, 0); + if (res != GST_RTSP_OK) + goto no_transport; + + /* we create the session after parsing stuff so that we don't make + * a session for malformed requests */ + if (priv->session_pool == NULL) + goto no_pool; + + session = ctx->session; + + if (session) { + g_object_ref (session); + /* get a handle to the configuration of the media in the session, this can + * return NULL if this is a new url to manage in this session. */ + sessmedia = gst_rtsp_session_get_media (session, path, &matched); + } else { + /* we need a new media configuration in this session */ + sessmedia = NULL; + } + + /* we have no session media, find one and manage it */ + if (sessmedia == NULL) { + /* get a handle to the configuration of the media in the session */ + media = find_media (client, ctx, path, &matched); + } else { + if ((media = gst_rtsp_session_media_get_media (sessmedia))) + g_object_ref (media); + else + goto media_not_found; + } + /* no media, not found then */ + if (media == NULL) + goto media_not_found_no_reply; + + /* FIXME-WFD : wfd url problem */ +#if 0 + if (path[matched] == '\0') + goto control_not_found; + + /* path is what matched. */ + path[matched] = '\0'; + /* control is remainder */ + control = &path[matched + 1]; +#else + control = g_strdup ("stream=0"); +#endif + + /* find the stream now using the control part */ + stream = gst_rtsp_media_find_stream (media, control); + if (stream == NULL) + goto stream_not_found; + + /* now we have a uri identifying a valid media and stream */ + ctx->stream = stream; + ctx->media = media; + + if (session == NULL) { + /* create a session if this fails we probably reached our session limit or + * something. */ + if (!(session = gst_rtsp_session_pool_create (priv->session_pool))) + goto service_unavailable; + + /* make sure this client is closed when the session is closed */ + client_watch_session (client, session); + + new_session = TRUE; + /* signal new session */ + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_NEW_SESSION], 0, + session); + + ctx->session = session; + } + + if (!klass->configure_client_media (client, media, stream, ctx)) + goto configure_media_failed_no_reply; + + gst_rtsp_transport_new (&ct); + + /* parse and find a usable supported transport */ + if (!parse_transport (transport, stream, ct)) + goto unsupported_transports; + + /* update the client transport */ + if (!klass->configure_client_transport (client, ctx, ct)) + goto unsupported_client_transport; + + /* parse the keymgmt */ + if (gst_rtsp_message_get_header (ctx->request, GST_RTSP_HDR_KEYMGMT, + &keymgmt, 0) == GST_RTSP_OK) { + if (!handle_keymgmt (client, ctx, keymgmt)) + goto keymgmt_error; + } + + if (sessmedia == NULL) { + /* manage the media in our session now, if not done already */ + sessmedia = gst_rtsp_session_manage_media (session, path, media); + /* if we stil have no media, error */ + if (sessmedia == NULL) + goto sessmedia_unavailable; + } else { + g_object_unref (media); + } + + ctx->sessmedia = sessmedia; + + /* set in the session media transport */ + trans = gst_rtsp_session_media_set_transport (sessmedia, stream, ct); + + /* configure the url used to set this transport, this we will use when + * generating the response for the PLAY request */ + gst_rtsp_stream_transport_set_url (trans, uri); + + /* configure keepalive for this transport */ + gst_rtsp_stream_transport_set_keepalive (trans, + (GstRTSPKeepAliveFunc) do_keepalive, session, NULL); + + /* create and serialize the server transport */ + st = make_server_transport (client, ctx, ct); + trans_str = gst_rtsp_transport_as_text (st); + + /* FIXME-WFD : Temporarily force to set profile string */ + trans_str = g_strjoinv ("RTP/AVP/UDP", g_strsplit (trans_str, "RTP/AVP", -1)); + + gst_rtsp_transport_free (st); + + /* construct the response now */ + code = GST_RTSP_STS_OK; + gst_rtsp_message_init_response (ctx->response, code, + gst_rtsp_status_as_text (code), ctx->request); + + gst_rtsp_message_add_header (ctx->response, GST_RTSP_HDR_TRANSPORT, + trans_str); + g_free (trans_str); + + send_message (client, ctx, ctx->response, FALSE); + + /* update the state */ + rtspstate = gst_rtsp_session_media_get_rtsp_state (sessmedia); + switch (rtspstate) { + case GST_RTSP_STATE_PLAYING: + case GST_RTSP_STATE_RECORDING: + case GST_RTSP_STATE_READY: + /* no state change */ + break; + default: + gst_rtsp_session_media_set_rtsp_state (sessmedia, GST_RTSP_STATE_READY); + break; + } + g_object_unref (session); + g_free (path); + + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_SETUP_REQUEST], 0, ctx); + + return TRUE; + + /* ERRORS */ +no_uri: + { + GST_ERROR ("client %p: no uri", client); + send_generic_response (client, GST_RTSP_STS_BAD_REQUEST, ctx); + return FALSE; + } +no_transport: + { + GST_ERROR ("client %p: no transport", client); + send_generic_response (client, GST_RTSP_STS_UNSUPPORTED_TRANSPORT, ctx); + goto cleanup_path; + } +no_pool: + { + GST_ERROR ("client %p: no session pool configured", client); + send_generic_response (client, GST_RTSP_STS_SESSION_NOT_FOUND, ctx); + goto cleanup_path; + } +media_not_found_no_reply: + { + GST_ERROR ("client %p: media '%s' not found", client, path); + /* error reply is already sent */ + goto cleanup_path; + } +media_not_found: + { + GST_ERROR ("client %p: media '%s' not found", client, path); + send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx); + goto cleanup_path; + } +control_not_found: + { + GST_ERROR ("client %p: no control in path '%s'", client, path); + send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx); + g_object_unref (media); + goto cleanup_path; + } +stream_not_found: + { + GST_ERROR ("client %p: stream '%s' not found", client, control); + send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx); + g_object_unref (media); + goto cleanup_path; + } +service_unavailable: + { + GST_ERROR ("client %p: can't create session", client); + send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx); + g_object_unref (media); + goto cleanup_path; + } +sessmedia_unavailable: + { + GST_ERROR ("client %p: can't create session media", client); + send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx); + g_object_unref (media); + goto cleanup_session; + } +configure_media_failed_no_reply: + { + GST_ERROR ("client %p: configure_media failed", client); + /* error reply is already sent */ + goto cleanup_session; + } +unsupported_transports: + { + GST_ERROR ("client %p: unsupported transports", client); + send_generic_response (client, GST_RTSP_STS_UNSUPPORTED_TRANSPORT, ctx); + goto cleanup_transport; + } +unsupported_client_transport: + { + GST_ERROR ("client %p: unsupported client transport", client); + send_generic_response (client, GST_RTSP_STS_UNSUPPORTED_TRANSPORT, ctx); + goto cleanup_transport; + } +keymgmt_error: + { + GST_ERROR ("client %p: keymgmt error", client); + send_generic_response (client, GST_RTSP_STS_KEY_MANAGEMENT_FAILURE, ctx); + goto cleanup_transport; + } + { + cleanup_transport: + gst_rtsp_transport_free (ct); + cleanup_session: + if (new_session) + gst_rtsp_session_pool_remove (priv->session_pool, session); + g_object_unref (session); + cleanup_path: + g_free (path); + return FALSE; + } +} + +static GstSDPMessage * +create_sdp (GstRTSPClient * client, GstRTSPMedia * media) +{ + GstRTSPClientPrivate *priv = client->priv; + GstSDPMessage *sdp; + GstSDPInfo info; + const gchar *proto; + + gst_sdp_message_new (&sdp); + + /* some standard things first */ + gst_sdp_message_set_version (sdp, "0"); + + if (priv->is_ipv6) + proto = "IP6"; + else + proto = "IP4"; + + gst_sdp_message_set_origin (sdp, "-", "1188340656180883", "1", "IN", proto, + priv->server_ip); + + gst_sdp_message_set_session_name (sdp, "Session streamed with GStreamer"); + gst_sdp_message_set_information (sdp, "rtsp-server"); + gst_sdp_message_add_time (sdp, "0", "0", NULL); + gst_sdp_message_add_attribute (sdp, "tool", "GStreamer"); + gst_sdp_message_add_attribute (sdp, "type", "broadcast"); + gst_sdp_message_add_attribute (sdp, "control", "*"); + + info.is_ipv6 = priv->is_ipv6; + info.server_ip = priv->server_ip; + + /* create an SDP for the media object */ + if (!gst_rtsp_media_setup_sdp (media, sdp, &info)) + goto no_sdp; + + return sdp; + + /* ERRORS */ +no_sdp: + { + GST_ERROR ("client %p: could not create SDP", client); + gst_sdp_message_free (sdp); + return NULL; + } +} + +/* for the describe we must generate an SDP */ +static gboolean +handle_describe_request (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPClientPrivate *priv = client->priv; + GstRTSPResult res; + GstSDPMessage *sdp; + guint i; + gchar *path, *str; + GstRTSPMedia *media; + GstRTSPClientClass *klass; + + klass = GST_RTSP_CLIENT_GET_CLASS (client); + + if (!ctx->uri) + goto no_uri; + + /* check what kind of format is accepted, we don't really do anything with it + * and always return SDP for now. */ + for (i = 0;; i++) { + gchar *accept; + + res = + gst_rtsp_message_get_header (ctx->request, GST_RTSP_HDR_ACCEPT, + &accept, i); + if (res == GST_RTSP_ENOTIMPL) + break; + + if (g_ascii_strcasecmp (accept, "application/sdp") == 0) + break; + } + + if (!priv->mount_points) + goto no_mount_points; + + if (!(path = gst_rtsp_mount_points_make_path (priv->mount_points, ctx->uri))) + goto no_path; + + /* find the media object for the uri */ + if (!(media = find_media (client, ctx, path, NULL))) + goto no_media; + + /* create an SDP for the media object on this client */ + if (!(sdp = klass->create_sdp (client, media))) + goto no_sdp; + + /* we suspend after the describe */ + gst_rtsp_media_suspend (media); + g_object_unref (media); + + gst_rtsp_message_init_response (ctx->response, GST_RTSP_STS_OK, + gst_rtsp_status_as_text (GST_RTSP_STS_OK), ctx->request); + + gst_rtsp_message_add_header (ctx->response, GST_RTSP_HDR_CONTENT_TYPE, + "application/sdp"); + + /* content base for some clients that might screw up creating the setup uri */ + str = make_base_url (client, ctx->uri, path); + g_free (path); + + GST_INFO ("adding content-base: %s", str); + gst_rtsp_message_take_header (ctx->response, GST_RTSP_HDR_CONTENT_BASE, str); + + /* add SDP to the response body */ + str = gst_sdp_message_as_text (sdp); + gst_rtsp_message_take_body (ctx->response, (guint8 *) str, strlen (str)); + gst_sdp_message_free (sdp); + + send_message (client, ctx, ctx->response, FALSE); + + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_DESCRIBE_REQUEST], + 0, ctx); + + return TRUE; + + /* ERRORS */ +no_uri: + { + GST_ERROR ("client %p: no uri", client); + send_generic_response (client, GST_RTSP_STS_BAD_REQUEST, ctx); + return FALSE; + } +no_mount_points: + { + GST_ERROR ("client %p: no mount points configured", client); + send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx); + return FALSE; + } +no_path: + { + GST_ERROR ("client %p: can't find path for url", client); + send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx); + return FALSE; + } +no_media: + { + GST_ERROR ("client %p: no media", client); + g_free (path); + /* error reply is already sent */ + return FALSE; + } +no_sdp: + { + GST_ERROR ("client %p: can't create SDP", client); + send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx); + g_free (path); + g_object_unref (media); + return FALSE; + } +} + +static gboolean +default_handle_options_request (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPMethod options; + gchar *str; + + options = GST_RTSP_DESCRIBE | + GST_RTSP_OPTIONS | + GST_RTSP_PAUSE | + GST_RTSP_PLAY | + GST_RTSP_SETUP | + GST_RTSP_GET_PARAMETER | GST_RTSP_SET_PARAMETER | GST_RTSP_TEARDOWN; + + str = gst_rtsp_options_as_text (options); + + gst_rtsp_message_init_response (ctx->response, GST_RTSP_STS_OK, + gst_rtsp_status_as_text (GST_RTSP_STS_OK), ctx->request); + + gst_rtsp_message_add_header (ctx->response, GST_RTSP_HDR_PUBLIC, str); + g_free (str); + + send_message (client, ctx, ctx->response, FALSE); + + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_OPTIONS_REQUEST], + 0, ctx); + + return TRUE; +} + +/* remove duplicate and trailing '/' */ +static void +sanitize_uri (GstRTSPUrl * uri) +{ + gint i, len; + gchar *s, *d; + gboolean have_slash, prev_slash; + + s = d = uri->abspath; + len = strlen (uri->abspath); + + prev_slash = FALSE; + + for (i = 0; i < len; i++) { + have_slash = s[i] == '/'; + *d = s[i]; + if (!have_slash || !prev_slash) + d++; + prev_slash = have_slash; + } + len = d - uri->abspath; + /* don't remove the first slash if that's the only thing left */ + if (len > 1 && *(d - 1) == '/') + d--; + *d = '\0'; +} + +/* is called when the session is removed from its session pool. */ +static void +client_session_removed (GstRTSPSessionPool * pool, GstRTSPSession * session, + GstRTSPClient * client) +{ + GstRTSPClientPrivate *priv = client->priv; + + GST_INFO ("client %p: session %p removed", client, session); + + g_mutex_lock (&priv->lock); + client_unwatch_session (client, session, NULL); + g_mutex_unlock (&priv->lock); +} + +/* Returns TRUE if there are no Require headers, otherwise returns FALSE + * and also returns a newly-allocated string of (comma-separated) unsupported + * options in the unsupported_reqs variable . + * + * There may be multiple Require headers, but we must send one single + * Unsupported header with all the unsupported options as response. If + * an incoming Require header contained a comma-separated list of options + * GstRtspConnection will already have split that list up into multiple + * headers. + * + * TODO: allow the application to decide what features are supported + */ +static gboolean +check_request_requirements (GstRTSPMessage * msg, gchar ** unsupported_reqs) +{ + GstRTSPResult res; + GPtrArray *arr = NULL; + gchar *reqs = NULL; + gint i; + + i = 0; + do { + res = gst_rtsp_message_get_header (msg, GST_RTSP_HDR_REQUIRE, &reqs, i++); + + if (res == GST_RTSP_ENOTIMPL) + break; + + if (arr == NULL) + arr = g_ptr_array_new_with_free_func ((GDestroyNotify) g_free); + + g_ptr_array_add (arr, g_strdup (reqs)); + } + while (TRUE); + + /* if we don't have any Require headers at all, all is fine */ + if (i == 1) + return TRUE; + + /* otherwise we've now processed at all the Require headers */ + g_ptr_array_add (arr, NULL); + + /* for now we don't commit to supporting anything, so will just report + * all of the required options as unsupported */ + *unsupported_reqs = g_strjoinv (", ", (gchar **) arr->pdata); + + g_ptr_array_unref (arr); + return FALSE; +} + +static void +handle_request (GstRTSPClient * client, GstRTSPMessage * request) +{ + GstRTSPClientPrivate *priv = client->priv; + GstRTSPMethod method; + const gchar *uristr; + GstRTSPUrl *uri = NULL; + GstRTSPVersion version; + GstRTSPResult res; + GstRTSPSession *session = NULL; + GstRTSPContext sctx = { NULL }, *ctx; + GstRTSPMessage response = { 0 }; + gchar *unsupported_reqs = NULL; + gchar *sessid; + GstRTSPClientClass *klass; + + klass = GST_RTSP_CLIENT_GET_CLASS (client); + + if (!(ctx = gst_rtsp_context_get_current ())) { + ctx = &sctx; + ctx->auth = priv->auth; + gst_rtsp_context_push_current (ctx); + } + + ctx->conn = priv->connection; + ctx->client = client; + ctx->request = request; + ctx->response = &response; + + if (gst_debug_category_get_threshold (rtsp_client_debug) >= GST_LEVEL_LOG) { + gst_rtsp_message_dump (request); + } + + gst_rtsp_message_parse_request (request, &method, &uristr, &version); + + GST_INFO ("client %p: received a request %s %s %s", client, + gst_rtsp_method_as_text (method), uristr, + gst_rtsp_version_as_text (version)); + + /* we can only handle 1.0 requests */ + if (version != GST_RTSP_VERSION_1_0) + goto not_supported; + + ctx->method = method; + + /* we always try to parse the url first */ + if (strcmp (uristr, "*") == 0) { + /* special case where we have * as uri, keep uri = NULL */ + } else if (gst_rtsp_url_parse (uristr, &uri) != GST_RTSP_OK) { + /* check if the uristr is an absolute path <=> scheme and host information + * is missing */ + gchar *scheme; + + scheme = g_uri_parse_scheme (uristr); + if (scheme == NULL && g_str_has_prefix (uristr, "/")) { + gchar *absolute_uristr = NULL; + + GST_WARNING_OBJECT (client, "request doesn't contain absolute url"); + if (priv->server_ip == NULL) { + GST_WARNING_OBJECT (client, "host information missing"); + goto bad_request; + } + + absolute_uristr = + g_strdup_printf ("rtsp://%s%s", priv->server_ip, uristr); + + GST_DEBUG_OBJECT (client, "absolute url: %s", absolute_uristr); + if (gst_rtsp_url_parse (absolute_uristr, &uri) != GST_RTSP_OK) { + g_free (absolute_uristr); + goto bad_request; + } + g_free (absolute_uristr); + } else { + g_free (scheme); + goto bad_request; + } + } + + /* get the session if there is any */ + res = gst_rtsp_message_get_header (request, GST_RTSP_HDR_SESSION, &sessid, 0); + if (res == GST_RTSP_OK) { + if (priv->session_pool == NULL) + goto no_pool; + + /* we had a session in the request, find it again */ + if (!(session = gst_rtsp_session_pool_find (priv->session_pool, sessid))) + goto session_not_found; + + /* we add the session to the client list of watched sessions. When a session + * disappears because it times out, we will be notified. If all sessions are + * gone, we will close the connection */ + client_watch_session (client, session); + } + + /* sanitize the uri */ + if (uri) + sanitize_uri (uri); + ctx->uri = uri; + ctx->session = session; + + if (!gst_rtsp_auth_check (GST_RTSP_AUTH_CHECK_URL)) + goto not_authorized; + +#if 0 + /* FIXME-WFD : How does it handle this */ + /* handle any 'Require' headers */ + if (!check_request_requirements (ctx->request, &unsupported_reqs)) + goto unsupported_requirement; +#endif + + /* now see what is asked and dispatch to a dedicated handler */ + switch (method) { + case GST_RTSP_OPTIONS: + klass->handle_options_request (client, ctx); + break; + case GST_RTSP_DESCRIBE: + handle_describe_request (client, ctx); + break; + case GST_RTSP_SETUP: + handle_setup_request (client, ctx); + break; + case GST_RTSP_PLAY: + handle_play_request (client, ctx); + break; + case GST_RTSP_PAUSE: + handle_pause_request (client, ctx); + break; + case GST_RTSP_TEARDOWN: + handle_teardown_request (client, ctx); + break; + case GST_RTSP_SET_PARAMETER: + klass->handle_set_param_request (client, ctx); + break; + case GST_RTSP_GET_PARAMETER: + klass->handle_get_param_request (client, ctx); + break; + case GST_RTSP_ANNOUNCE: + case GST_RTSP_RECORD: + case GST_RTSP_REDIRECT: + goto not_implemented; + case GST_RTSP_INVALID: + default: + goto bad_request; + } + +done: + if (ctx == &sctx) + gst_rtsp_context_pop_current (ctx); + if (session) + g_object_unref (session); + if (uri) + gst_rtsp_url_free (uri); + return; + + /* ERRORS */ +not_supported: + { + GST_ERROR ("client %p: version %d not supported", client, version); + send_generic_response (client, GST_RTSP_STS_RTSP_VERSION_NOT_SUPPORTED, + ctx); + goto done; + } +bad_request: + { + GST_ERROR ("client %p: bad request", client); + send_generic_response (client, GST_RTSP_STS_BAD_REQUEST, ctx); + goto done; + } +no_pool: + { + GST_ERROR ("client %p: no pool configured", client); + send_generic_response (client, GST_RTSP_STS_SESSION_NOT_FOUND, ctx); + goto done; + } +session_not_found: + { + GST_ERROR ("client %p: session not found", client); + send_generic_response (client, GST_RTSP_STS_SESSION_NOT_FOUND, ctx); + goto done; + } +not_authorized: + { + GST_ERROR ("client %p: not allowed", client); + /* error reply is already sent */ + goto done; + } +unsupported_requirement: + { + GST_ERROR ("client %p: Required option is not supported (%s)", client, + unsupported_reqs); + send_option_not_supported_response (client, ctx, unsupported_reqs); + g_free (unsupported_reqs); + goto done; + } +not_implemented: + { + GST_ERROR ("client %p: method %d not implemented", client, method); + send_generic_response (client, GST_RTSP_STS_NOT_IMPLEMENTED, ctx); + goto done; + } +} + + +static void +handle_response (GstRTSPClient * client, GstRTSPMessage * response) +{ + GstRTSPClientPrivate *priv = client->priv; + GstRTSPResult res; + GstRTSPSession *session = NULL; + GstRTSPContext sctx = { NULL }, *ctx; + gchar *sessid; + + if (!(ctx = gst_rtsp_context_get_current ())) { + ctx = &sctx; + ctx->auth = priv->auth; + gst_rtsp_context_push_current (ctx); + } + + ctx->conn = priv->connection; + ctx->client = client; + ctx->request = NULL; + ctx->uri = NULL; + ctx->method = GST_RTSP_INVALID; + ctx->response = response; + + if (gst_debug_category_get_threshold (rtsp_client_debug) >= GST_LEVEL_LOG) { + gst_rtsp_message_dump (response); + } + + GST_INFO ("client %p: received a response", client); + + /* get the session if there is any */ + res = + gst_rtsp_message_get_header (response, GST_RTSP_HDR_SESSION, &sessid, 0); + if (res == GST_RTSP_OK) { + if (priv->session_pool == NULL) + goto no_pool; + + /* we had a session in the request, find it again */ + if (!(session = gst_rtsp_session_pool_find (priv->session_pool, sessid))) + goto session_not_found; + + /* we add the session to the client list of watched sessions. When a session + * disappears because it times out, we will be notified. If all sessions are + * gone, we will close the connection */ + client_watch_session (client, session); + } + + ctx->session = session; + + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_HANDLE_RESPONSE], + 0, ctx); + +done: + if (ctx == &sctx) + gst_rtsp_context_pop_current (ctx); + if (session) + g_object_unref (session); + return; + +no_pool: + { + GST_ERROR ("client %p: no pool configured", client); + goto done; + } +session_not_found: + { + GST_ERROR ("client %p: session not found", client); + goto done; + } +} + +static void +handle_data (GstRTSPClient * client, GstRTSPMessage * message) +{ + GstRTSPClientPrivate *priv = client->priv; + GstRTSPResult res; + guint8 channel; + GList *walk; + guint8 *data; + guint size; + GstBuffer *buffer; + gboolean handled; + + /* find the stream for this message */ + res = gst_rtsp_message_parse_data (message, &channel); + if (res != GST_RTSP_OK) + return; + + gst_rtsp_message_steal_body (message, &data, &size); + + buffer = gst_buffer_new_wrapped (data, size); + + handled = FALSE; + for (walk = priv->transports; walk; walk = g_list_next (walk)) { + GstRTSPStreamTransport *trans; + GstRTSPStream *stream; + const GstRTSPTransport *tr; + + trans = walk->data; + + tr = gst_rtsp_stream_transport_get_transport (trans); + stream = gst_rtsp_stream_transport_get_stream (trans); + + /* check for TCP transport */ + if (tr->lower_transport == GST_RTSP_LOWER_TRANS_TCP) { + /* dispatch to the stream based on the channel number */ + if (tr->interleaved.min == channel) { + gst_rtsp_stream_recv_rtp (stream, buffer); + handled = TRUE; + break; + } else if (tr->interleaved.max == channel) { + gst_rtsp_stream_recv_rtcp (stream, buffer); + handled = TRUE; + break; + } + } + } + if (!handled) + gst_buffer_unref (buffer); +} + +/** + * gst_rtsp_client_set_session_pool: + * @client: a #GstRTSPClient + * @pool: (transfer none): a #GstRTSPSessionPool + * + * Set @pool as the sessionpool for @client which it will use to find + * or allocate sessions. the sessionpool is usually inherited from the server + * that created the client but can be overridden later. + */ +void +gst_rtsp_client_set_session_pool (GstRTSPClient * client, + GstRTSPSessionPool * pool) +{ + GstRTSPSessionPool *old; + GstRTSPClientPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_CLIENT (client)); + + priv = client->priv; + + if (pool) + g_object_ref (pool); + + g_mutex_lock (&priv->lock); + old = priv->session_pool; + priv->session_pool = pool; + + if (priv->session_removed_id) { + g_signal_handler_disconnect (old, priv->session_removed_id); + priv->session_removed_id = 0; + } + g_mutex_unlock (&priv->lock); + + /* FIXME, should remove all sessions from the old pool for this client */ + if (old) + g_object_unref (old); +} + +/** + * gst_rtsp_client_get_session_pool: + * @client: a #GstRTSPClient + * + * Get the #GstRTSPSessionPool object that @client uses to manage its sessions. + * + * Returns: (transfer full): a #GstRTSPSessionPool, unref after usage. + */ +GstRTSPSessionPool * +gst_rtsp_client_get_session_pool (GstRTSPClient * client) +{ + GstRTSPClientPrivate *priv; + GstRTSPSessionPool *result; + + g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), NULL); + + priv = client->priv; + + g_mutex_lock (&priv->lock); + if ((result = priv->session_pool)) + g_object_ref (result); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_client_set_mount_points: + * @client: a #GstRTSPClient + * @mounts: (transfer none): a #GstRTSPMountPoints + * + * Set @mounts as the mount points for @client which it will use to map urls + * to media streams. These mount points are usually inherited from the server that + * created the client but can be overriden later. + */ +void +gst_rtsp_client_set_mount_points (GstRTSPClient * client, + GstRTSPMountPoints * mounts) +{ + GstRTSPClientPrivate *priv; + GstRTSPMountPoints *old; + + g_return_if_fail (GST_IS_RTSP_CLIENT (client)); + + priv = client->priv; + + if (mounts) + g_object_ref (mounts); + + g_mutex_lock (&priv->lock); + old = priv->mount_points; + priv->mount_points = mounts; + g_mutex_unlock (&priv->lock); + + if (old) + g_object_unref (old); +} + +/** + * gst_rtsp_client_get_mount_points: + * @client: a #GstRTSPClient + * + * Get the #GstRTSPMountPoints object that @client uses to manage its sessions. + * + * Returns: (transfer full): a #GstRTSPMountPoints, unref after usage. + */ +GstRTSPMountPoints * +gst_rtsp_client_get_mount_points (GstRTSPClient * client) +{ + GstRTSPClientPrivate *priv; + GstRTSPMountPoints *result; + + g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), NULL); + + priv = client->priv; + + g_mutex_lock (&priv->lock); + if ((result = priv->mount_points)) + g_object_ref (result); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_client_set_auth: + * @client: a #GstRTSPClient + * @auth: (transfer none): a #GstRTSPAuth + * + * configure @auth to be used as the authentication manager of @client. + */ +void +gst_rtsp_client_set_auth (GstRTSPClient * client, GstRTSPAuth * auth) +{ + GstRTSPClientPrivate *priv; + GstRTSPAuth *old; + + g_return_if_fail (GST_IS_RTSP_CLIENT (client)); + + priv = client->priv; + + if (auth) + g_object_ref (auth); + + g_mutex_lock (&priv->lock); + old = priv->auth; + priv->auth = auth; + g_mutex_unlock (&priv->lock); + + if (old) + g_object_unref (old); +} + + +/** + * gst_rtsp_client_get_auth: + * @client: a #GstRTSPClient + * + * Get the #GstRTSPAuth used as the authentication manager of @client. + * + * Returns: (transfer full): the #GstRTSPAuth of @client. g_object_unref() after + * usage. + */ +GstRTSPAuth * +gst_rtsp_client_get_auth (GstRTSPClient * client) +{ + GstRTSPClientPrivate *priv; + GstRTSPAuth *result; + + g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), NULL); + + priv = client->priv; + + g_mutex_lock (&priv->lock); + if ((result = priv->auth)) + g_object_ref (result); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_client_set_thread_pool: + * @client: a #GstRTSPClient + * @pool: (transfer none): a #GstRTSPThreadPool + * + * configure @pool to be used as the thread pool of @client. + */ +void +gst_rtsp_client_set_thread_pool (GstRTSPClient * client, + GstRTSPThreadPool * pool) +{ + GstRTSPClientPrivate *priv; + GstRTSPThreadPool *old; + + g_return_if_fail (GST_IS_RTSP_CLIENT (client)); + + priv = client->priv; + + if (pool) + g_object_ref (pool); + + g_mutex_lock (&priv->lock); + old = priv->thread_pool; + priv->thread_pool = pool; + g_mutex_unlock (&priv->lock); + + if (old) + g_object_unref (old); +} + +/** + * gst_rtsp_client_get_thread_pool: + * @client: a #GstRTSPClient + * + * Get the #GstRTSPThreadPool used as the thread pool of @client. + * + * Returns: (transfer full): the #GstRTSPThreadPool of @client. g_object_unref() after + * usage. + */ +GstRTSPThreadPool * +gst_rtsp_client_get_thread_pool (GstRTSPClient * client) +{ + GstRTSPClientPrivate *priv; + GstRTSPThreadPool *result; + + g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), NULL); + + priv = client->priv; + + g_mutex_lock (&priv->lock); + if ((result = priv->thread_pool)) + g_object_ref (result); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_client_set_connection: + * @client: a #GstRTSPClient + * @conn: (transfer full): a #GstRTSPConnection + * + * Set the #GstRTSPConnection of @client. This function takes ownership of + * @conn. + * + * Returns: %TRUE on success. + */ +gboolean +gst_rtsp_client_set_connection (GstRTSPClient * client, + GstRTSPConnection * conn) +{ + GstRTSPClientPrivate *priv; + GSocket *read_socket; + GSocketAddress *address; + GstRTSPUrl *url; + GError *error = NULL; + + g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), FALSE); + g_return_val_if_fail (conn != NULL, FALSE); + + priv = client->priv; + + read_socket = gst_rtsp_connection_get_read_socket (conn); + + if (!(address = g_socket_get_local_address (read_socket, &error))) + goto no_address; + + g_free (priv->server_ip); + /* keep the original ip that the client connected to */ + if (G_IS_INET_SOCKET_ADDRESS (address)) { + GInetAddress *iaddr; + + iaddr = g_inet_socket_address_get_address (G_INET_SOCKET_ADDRESS (address)); + + /* socket might be ipv6 but adress still ipv4 */ + priv->is_ipv6 = g_inet_address_get_family (iaddr) == G_SOCKET_FAMILY_IPV6; + priv->server_ip = g_inet_address_to_string (iaddr); + g_object_unref (address); + } else { + priv->is_ipv6 = g_socket_get_family (read_socket) == G_SOCKET_FAMILY_IPV6; + priv->server_ip = g_strdup ("unknown"); + } + + GST_INFO ("client %p connected to server ip %s, ipv6 = %d", client, + priv->server_ip, priv->is_ipv6); + + url = gst_rtsp_connection_get_url (conn); + GST_INFO ("added new client %p ip %s:%d", client, url->host, url->port); + + priv->connection = conn; + + return TRUE; + + /* ERRORS */ +no_address: + { + GST_ERROR ("could not get local address %s", error->message); + g_error_free (error); + return FALSE; + } +} + +/** + * gst_rtsp_client_get_connection: + * @client: a #GstRTSPClient + * + * Get the #GstRTSPConnection of @client. + * + * Returns: (transfer none): the #GstRTSPConnection of @client. + * The connection object returned remains valid until the client is freed. + */ +GstRTSPConnection * +gst_rtsp_client_get_connection (GstRTSPClient * client) +{ + g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), NULL); + + return client->priv->connection; +} + +/** + * gst_rtsp_client_set_send_func: + * @client: a #GstRTSPClient + * @func: (scope notified): a #GstRTSPClientSendFunc + * @user_data: (closure): user data passed to @func + * @notify: (allow-none): called when @user_data is no longer in use + * + * Set @func as the callback that will be called when a new message needs to be + * sent to the client. @user_data is passed to @func and @notify is called when + * @user_data is no longer in use. + * + * By default, the client will send the messages on the #GstRTSPConnection that + * was configured with gst_rtsp_client_attach() was called. + */ +void +gst_rtsp_client_set_send_func (GstRTSPClient * client, + GstRTSPClientSendFunc func, gpointer user_data, GDestroyNotify notify) +{ + GstRTSPClientPrivate *priv; + GDestroyNotify old_notify; + gpointer old_data; + + g_return_if_fail (GST_IS_RTSP_CLIENT (client)); + + priv = client->priv; + + g_mutex_lock (&priv->send_lock); + priv->send_func = func; + old_notify = priv->send_notify; + old_data = priv->send_data; + priv->send_notify = notify; + priv->send_data = user_data; + g_mutex_unlock (&priv->send_lock); + + if (old_notify) + old_notify (old_data); +} + +/** + * gst_rtsp_client_handle_message: + * @client: a #GstRTSPClient + * @message: (transfer none): an #GstRTSPMessage + * + * Let the client handle @message. + * + * Returns: a #GstRTSPResult. + */ +GstRTSPResult +gst_rtsp_client_handle_message (GstRTSPClient * client, + GstRTSPMessage * message) +{ + g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), GST_RTSP_EINVAL); + g_return_val_if_fail (message != NULL, GST_RTSP_EINVAL); + + switch (message->type) { + case GST_RTSP_MESSAGE_REQUEST: + handle_request (client, message); + break; + case GST_RTSP_MESSAGE_RESPONSE: + handle_response (client, message); + break; + case GST_RTSP_MESSAGE_DATA: + handle_data (client, message); + break; + default: + break; + } + return GST_RTSP_OK; +} + +/** + * gst_rtsp_client_send_message: + * @client: a #GstRTSPClient + * @session: (allow-none) (transfer none): a #GstRTSPSession to send + * the message to or %NULL + * @message: (transfer none): The #GstRTSPMessage to send + * + * Send a message message to the remote end. @message must be a + * #GST_RTSP_MESSAGE_REQUEST or a #GST_RTSP_MESSAGE_RESPONSE. + */ +GstRTSPResult +gst_rtsp_client_send_message (GstRTSPClient * client, GstRTSPSession * session, + GstRTSPMessage * message) +{ + GstRTSPContext sctx = { NULL } + , *ctx; + GstRTSPClientPrivate *priv; + + g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), GST_RTSP_EINVAL); + g_return_val_if_fail (message != NULL, GST_RTSP_EINVAL); + g_return_val_if_fail (message->type == GST_RTSP_MESSAGE_REQUEST || + message->type == GST_RTSP_MESSAGE_RESPONSE, GST_RTSP_EINVAL); + + priv = client->priv; + + if (!(ctx = gst_rtsp_context_get_current ())) { + ctx = &sctx; + ctx->auth = priv->auth; + gst_rtsp_context_push_current (ctx); + } + + ctx->conn = priv->connection; + ctx->client = client; + ctx->session = session; + + send_message (client, ctx, message, FALSE); + + if (ctx == &sctx) + gst_rtsp_context_pop_current (ctx); + + return GST_RTSP_OK; +} + +static GstRTSPResult +do_send_message (GstRTSPClient * client, GstRTSPMessage * message, + gboolean close, gpointer user_data) +{ + GstRTSPClientPrivate *priv = client->priv; + GstRTSPResult ret; + GTimeVal time; + + time.tv_sec = 1; + time.tv_usec = 0; + + do { + /* send the response and store the seq number so we can wait until it's + * written to the client to close the connection */ + ret = + gst_rtsp_watch_send_message (priv->watch, message, + close ? &priv->close_seq : NULL); + if (ret == GST_RTSP_OK) + break; + + if (ret != GST_RTSP_ENOMEM) + goto error; + + /* drop backlog */ + if (priv->drop_backlog) + break; + + /* queue was full, wait for more space */ + GST_DEBUG_OBJECT (client, "waiting for backlog"); + ret = gst_rtsp_watch_wait_backlog (priv->watch, &time); + GST_DEBUG_OBJECT (client, "Resend due to backlog full"); + } while (ret != GST_RTSP_EINTR); + + return ret; + + /* ERRORS */ +error: + { + GST_DEBUG_OBJECT (client, "got error %d", ret); + return ret; + } +} + +static GstRTSPResult +message_received (GstRTSPWatch * watch, GstRTSPMessage * message, + gpointer user_data) +{ + return gst_rtsp_client_handle_message (GST_RTSP_CLIENT (user_data), message); +} + +static GstRTSPResult +message_sent (GstRTSPWatch * watch, guint cseq, gpointer user_data) +{ + GstRTSPClient *client = GST_RTSP_CLIENT (user_data); + GstRTSPClientPrivate *priv = client->priv; + + if (priv->close_seq && priv->close_seq == cseq) { + GST_INFO ("client %p: send close message", client); + priv->close_seq = 0; + gst_rtsp_client_close (client); + } + + return GST_RTSP_OK; +} + +static GstRTSPResult +closed (GstRTSPWatch * watch, gpointer user_data) +{ + GstRTSPClient *client = GST_RTSP_CLIENT (user_data); + GstRTSPClientPrivate *priv = client->priv; + const gchar *tunnelid; + + GST_INFO ("client %p: connection closed", client); + + if ((tunnelid = gst_rtsp_connection_get_tunnelid (priv->connection))) { + g_mutex_lock (&tunnels_lock); + /* remove from tunnelids */ + g_hash_table_remove (tunnels, tunnelid); + g_mutex_unlock (&tunnels_lock); + } + + gst_rtsp_watch_set_flushing (watch, TRUE); + gst_rtsp_client_set_send_func (client, NULL, NULL, NULL); + + return GST_RTSP_OK; +} + +static GstRTSPResult +error (GstRTSPWatch * watch, GstRTSPResult result, gpointer user_data) +{ + GstRTSPClient *client = GST_RTSP_CLIENT (user_data); + gchar *str; + + str = gst_rtsp_strresult (result); + GST_INFO ("client %p: received an error %s", client, str); + g_free (str); + + return GST_RTSP_OK; +} + +static GstRTSPResult +error_full (GstRTSPWatch * watch, GstRTSPResult result, + GstRTSPMessage * message, guint id, gpointer user_data) +{ + GstRTSPClient *client = GST_RTSP_CLIENT (user_data); + gchar *str; + + str = gst_rtsp_strresult (result); + GST_INFO + ("client %p: error when handling message %p with id %d: %s", + client, message, id, str); + g_free (str); + + return GST_RTSP_OK; +} + +static gboolean +remember_tunnel (GstRTSPClient * client) +{ + GstRTSPClientPrivate *priv = client->priv; + const gchar *tunnelid; + + /* store client in the pending tunnels */ + tunnelid = gst_rtsp_connection_get_tunnelid (priv->connection); + if (tunnelid == NULL) + goto no_tunnelid; + + GST_INFO ("client %p: inserting tunnel session %s", client, tunnelid); + + /* we can't have two clients connecting with the same tunnelid */ + g_mutex_lock (&tunnels_lock); + if (g_hash_table_lookup (tunnels, tunnelid)) + goto tunnel_existed; + + g_hash_table_insert (tunnels, g_strdup (tunnelid), g_object_ref (client)); + g_mutex_unlock (&tunnels_lock); + + return TRUE; + + /* ERRORS */ +no_tunnelid: + { + GST_ERROR ("client %p: no tunnelid provided", client); + return FALSE; + } +tunnel_existed: + { + g_mutex_unlock (&tunnels_lock); + GST_ERROR ("client %p: tunnel session %s already existed", client, + tunnelid); + return FALSE; + } +} + +static GstRTSPResult +tunnel_lost (GstRTSPWatch * watch, gpointer user_data) +{ + GstRTSPClient *client = GST_RTSP_CLIENT (user_data); + GstRTSPClientPrivate *priv = client->priv; + + GST_WARNING ("client %p: tunnel lost (connection %p)", client, + priv->connection); + + /* ignore error, it'll only be a problem when the client does a POST again */ + remember_tunnel (client); + + return GST_RTSP_OK; +} + +static gboolean +handle_tunnel (GstRTSPClient * client) +{ + GstRTSPClientPrivate *priv = client->priv; + GstRTSPClient *oclient; + GstRTSPClientPrivate *opriv; + const gchar *tunnelid; + + tunnelid = gst_rtsp_connection_get_tunnelid (priv->connection); + if (tunnelid == NULL) + goto no_tunnelid; + + /* check for previous tunnel */ + g_mutex_lock (&tunnels_lock); + oclient = g_hash_table_lookup (tunnels, tunnelid); + + if (oclient == NULL) { + /* no previous tunnel, remember tunnel */ + g_hash_table_insert (tunnels, g_strdup (tunnelid), g_object_ref (client)); + g_mutex_unlock (&tunnels_lock); + + GST_INFO ("client %p: no previous tunnel found, remembering tunnel (%p)", + client, priv->connection); + } else { + /* merge both tunnels into the first client */ + /* remove the old client from the table. ref before because removing it will + * remove the ref to it. */ + g_object_ref (oclient); + g_hash_table_remove (tunnels, tunnelid); + g_mutex_unlock (&tunnels_lock); + + opriv = oclient->priv; + + if (opriv->watch == NULL) + goto tunnel_closed; + + GST_INFO ("client %p: found previous tunnel %p (old %p, new %p)", client, + oclient, opriv->connection, priv->connection); + + gst_rtsp_connection_do_tunnel (opriv->connection, priv->connection); + gst_rtsp_watch_reset (priv->watch); + gst_rtsp_watch_reset (opriv->watch); + g_object_unref (oclient); + + /* the old client owns the tunnel now, the new one will be freed */ + g_source_destroy ((GSource *) priv->watch); + priv->watch = NULL; + gst_rtsp_client_set_send_func (client, NULL, NULL, NULL); + } + + return TRUE; + + /* ERRORS */ +no_tunnelid: + { + GST_ERROR ("client %p: no tunnelid provided", client); + return FALSE; + } +tunnel_closed: + { + GST_ERROR ("client %p: tunnel session %s was closed", client, tunnelid); + g_object_unref (oclient); + return FALSE; + } +} + +static GstRTSPStatusCode +tunnel_get (GstRTSPWatch * watch, gpointer user_data) +{ + GstRTSPClient *client = GST_RTSP_CLIENT (user_data); + + GST_INFO ("client %p: tunnel get (connection %p)", client, + client->priv->connection); + + if (!handle_tunnel (client)) { + return GST_RTSP_STS_SERVICE_UNAVAILABLE; + } + + return GST_RTSP_STS_OK; +} + +static GstRTSPResult +tunnel_post (GstRTSPWatch * watch, gpointer user_data) +{ + GstRTSPClient *client = GST_RTSP_CLIENT (user_data); + + GST_INFO ("client %p: tunnel post (connection %p)", client, + client->priv->connection); + + if (!handle_tunnel (client)) { + return GST_RTSP_ERROR; + } + + return GST_RTSP_OK; +} + +static GstRTSPResult +tunnel_http_response (GstRTSPWatch * watch, GstRTSPMessage * request, + GstRTSPMessage * response, gpointer user_data) +{ + GstRTSPClientClass *klass; + + GstRTSPClient *client = GST_RTSP_CLIENT (user_data); + klass = GST_RTSP_CLIENT_GET_CLASS (client); + + if (klass->tunnel_http_response) { + klass->tunnel_http_response (client, request, response); + } + + return GST_RTSP_OK; +} + +static GstRTSPWatchFuncs watch_funcs = { + message_received, + message_sent, + closed, + error, + tunnel_get, + tunnel_post, + error_full, + tunnel_lost, + tunnel_http_response +}; + +static void +client_watch_notify (GstRTSPClient * client) +{ + GstRTSPClientPrivate *priv = client->priv; + + GST_INFO ("client %p: watch destroyed", client); + priv->watch = NULL; + g_main_context_unref (priv->watch_context); + priv->watch_context = NULL; + /* remove all sessions and so drop the extra client ref */ + gst_rtsp_client_session_filter (client, cleanup_session, NULL); + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_CLOSED], 0, NULL); + g_object_unref (client); +} + +/** + * gst_rtsp_client_attach: + * @client: a #GstRTSPClient + * @context: (allow-none): a #GMainContext + * + * Attaches @client to @context. When the mainloop for @context is run, the + * client will be dispatched. When @context is %NULL, the default context will be + * used). + * + * This function should be called when the client properties and urls are fully + * configured and the client is ready to start. + * + * Returns: the ID (greater than 0) for the source within the GMainContext. + */ +guint +gst_rtsp_client_attach (GstRTSPClient * client, GMainContext * context) +{ + GstRTSPClientPrivate *priv; + guint res; + + g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), 0); + priv = client->priv; + g_return_val_if_fail (priv->connection != NULL, 0); + g_return_val_if_fail (priv->watch == NULL, 0); + + /* make sure noone will free the context before the watch is destroyed */ + priv->watch_context = g_main_context_ref (context); + + /* create watch for the connection and attach */ + priv->watch = gst_rtsp_watch_new (priv->connection, &watch_funcs, + g_object_ref (client), (GDestroyNotify) client_watch_notify); + gst_rtsp_client_set_send_func (client, do_send_message, priv->watch, + (GDestroyNotify) gst_rtsp_watch_unref); + + /* FIXME make this configurable. We don't want to do this yet because it will + * be superceeded by a cache object later */ + gst_rtsp_watch_set_send_backlog (priv->watch, 0, 100); + + GST_INFO ("client %p: attaching to context %p", client, context); + res = gst_rtsp_watch_attach (priv->watch, context); + + return res; +} + +/** + * gst_rtsp_client_session_filter: + * @client: a #GstRTSPClient + * @func: (scope call) (allow-none): a callback + * @user_data: user data passed to @func + * + * Call @func for each session managed by @client. The result value of @func + * determines what happens to the session. @func will be called with @client + * locked so no further actions on @client can be performed from @func. + * + * If @func returns #GST_RTSP_FILTER_REMOVE, the session will be removed from + * @client. + * + * If @func returns #GST_RTSP_FILTER_KEEP, the session will remain in @client. + * + * If @func returns #GST_RTSP_FILTER_REF, the session will remain in @client but + * will also be added with an additional ref to the result #GList of this + * function.. + * + * When @func is %NULL, #GST_RTSP_FILTER_REF will be assumed for each session. + * + * Returns: (element-type GstRTSPSession) (transfer full): a #GList with all + * sessions for which @func returned #GST_RTSP_FILTER_REF. After usage, each + * element in the #GList should be unreffed before the list is freed. + */ +GList * +gst_rtsp_client_session_filter (GstRTSPClient * client, + GstRTSPClientSessionFilterFunc func, gpointer user_data) +{ + GstRTSPClientPrivate *priv; + GList *result, *walk, *next; + GHashTable *visited; + guint cookie; + + g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), NULL); + + priv = client->priv; + + result = NULL; + if (func) + visited = g_hash_table_new_full (NULL, NULL, g_object_unref, NULL); + + g_mutex_lock (&priv->lock); +restart: + cookie = priv->sessions_cookie; + for (walk = priv->sessions; walk; walk = next) { + GstRTSPSession *sess = walk->data; + GstRTSPFilterResult res; + gboolean changed; + + next = g_list_next (walk); + + if (func) { + /* only visit each session once */ + if (g_hash_table_contains (visited, sess)) + continue; + + g_hash_table_add (visited, g_object_ref (sess)); + g_mutex_unlock (&priv->lock); + + res = func (client, sess, user_data); + + g_mutex_lock (&priv->lock); + } else + res = GST_RTSP_FILTER_REF; + + changed = (cookie != priv->sessions_cookie); + + switch (res) { + case GST_RTSP_FILTER_REMOVE: + /* stop watching the session and pretend it went away, if the list was + * changed, we can't use the current list position, try to see if we + * still have the session */ + client_unwatch_session (client, sess, changed ? NULL : walk); + cookie = priv->sessions_cookie; + break; + case GST_RTSP_FILTER_REF: + result = g_list_prepend (result, g_object_ref (sess)); + break; + case GST_RTSP_FILTER_KEEP: + default: + break; + } + if (changed) + goto restart; + } + g_mutex_unlock (&priv->lock); + + if (func) + g_hash_table_unref (visited); + + return result; +} diff --git a/gst/rtsp-server/rtsp-client.h b/gst/rtsp-server/rtsp-client.h new file mode 100644 index 0000000..2ddb82e --- /dev/null +++ b/gst/rtsp-server/rtsp-client.h @@ -0,0 +1,196 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include + +#ifndef __GST_RTSP_CLIENT_H__ +#define __GST_RTSP_CLIENT_H__ + +G_BEGIN_DECLS + +typedef struct _GstRTSPClient GstRTSPClient; +typedef struct _GstRTSPClientClass GstRTSPClientClass; +typedef struct _GstRTSPClientPrivate GstRTSPClientPrivate; + +#include "rtsp-context.h" +#include "rtsp-mount-points.h" +#include "rtsp-sdp.h" +#include "rtsp-auth.h" + +#define GST_TYPE_RTSP_CLIENT (gst_rtsp_client_get_type ()) +#define GST_IS_RTSP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_CLIENT)) +#define GST_IS_RTSP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_CLIENT)) +#define GST_RTSP_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_CLIENT, GstRTSPClientClass)) +#define GST_RTSP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_CLIENT, GstRTSPClient)) +#define GST_RTSP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_CLIENT, GstRTSPClientClass)) +#define GST_RTSP_CLIENT_CAST(obj) ((GstRTSPClient*)(obj)) +#define GST_RTSP_CLIENT_CLASS_CAST(klass) ((GstRTSPClientClass*)(klass)) + +/** + * GstRTSPClientSendFunc: + * @client: a #GstRTSPClient + * @message: a #GstRTSPMessage + * @close: close the connection + * @user_data: user data when registering the callback + * + * This callback is called when @client wants to send @message. When @close is + * %TRUE, the connection should be closed when the message has been sent. + * + * Returns: %TRUE on success. + */ +typedef gboolean (*GstRTSPClientSendFunc) (GstRTSPClient *client, + GstRTSPMessage *message, + gboolean close, + gpointer user_data); + +/** + * GstRTSPClient: + * + * The client object represents the connection and its state with a client. + */ +struct _GstRTSPClient { + GObject parent; + + /*< private >*/ + GstRTSPClientPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPClientClass: + * @create_sdp: called when the SDP needs to be created for media. + * @configure_client_media: called when the stream in media needs to be configured. + * The default implementation will configure the blocksize on the payloader when + * spcified in the request headers. + * @configure_client_transport: called when the client transport needs to be + * configured. + * @params_set: set parameters. This function should also initialize the + * RTSP response(ctx->response) via a call to gst_rtsp_message_init_response() + * @params_get: get parameters. This function should also initialize the + * RTSP response(ctx->response) via a call to gst_rtsp_message_init_response() + * @tunnel_http_response: called when a response to the GET request is about to + * be sent for a tunneled connection. The response can be modified. Since 1.4 + * + * The client class structure. + */ +struct _GstRTSPClientClass { + GObjectClass parent_class; + + GstSDPMessage * (*create_sdp) (GstRTSPClient *client, GstRTSPMedia *media); + gboolean (*configure_client_media) (GstRTSPClient * client, + GstRTSPMedia * media, GstRTSPStream * stream, + GstRTSPContext * ctx); + gboolean (*configure_client_transport) (GstRTSPClient * client, + GstRTSPContext * ctx, + GstRTSPTransport * ct); + GstRTSPResult (*params_set) (GstRTSPClient *client, GstRTSPContext *ctx); + GstRTSPResult (*params_get) (GstRTSPClient *client, GstRTSPContext *ctx); + gchar * (*make_path_from_uri) (GstRTSPClient *client, const GstRTSPUrl *uri); + gboolean (*handle_options_request) (GstRTSPClient * client, GstRTSPContext * ctx); + gboolean (*handle_set_param_request) (GstRTSPClient * client, GstRTSPContext * ctx); + gboolean (*handle_get_param_request) (GstRTSPClient * client, GstRTSPContext * ctx); + + /* signals */ + void (*closed) (GstRTSPClient *client); + void (*new_session) (GstRTSPClient *client, GstRTSPSession *session); + void (*options_request) (GstRTSPClient *client, GstRTSPContext *ctx); + void (*describe_request) (GstRTSPClient *client, GstRTSPContext *ctx); + void (*setup_request) (GstRTSPClient *client, GstRTSPContext *ctx); + void (*play_request) (GstRTSPClient *client, GstRTSPContext *ctx); + void (*pause_request) (GstRTSPClient *client, GstRTSPContext *ctx); + void (*teardown_request) (GstRTSPClient *client, GstRTSPContext *ctx); + void (*set_parameter_request) (GstRTSPClient *client, GstRTSPContext *ctx); + void (*get_parameter_request) (GstRTSPClient *client, GstRTSPContext *ctx); + void (*handle_response) (GstRTSPClient *client, GstRTSPContext *ctx); + + void (*tunnel_http_response) (GstRTSPClient * client, GstRTSPMessage * request, + GstRTSPMessage * response); + /*< private >*/ + gpointer _gst_reserved[GST_PADDING_LARGE-1]; +}; + +GType gst_rtsp_client_get_type (void); + +GstRTSPClient * gst_rtsp_client_new (void); + +void gst_rtsp_client_set_session_pool (GstRTSPClient *client, + GstRTSPSessionPool *pool); +GstRTSPSessionPool * gst_rtsp_client_get_session_pool (GstRTSPClient *client); + +void gst_rtsp_client_set_mount_points (GstRTSPClient *client, + GstRTSPMountPoints *mounts); +GstRTSPMountPoints * gst_rtsp_client_get_mount_points (GstRTSPClient *client); + +void gst_rtsp_client_set_auth (GstRTSPClient *client, GstRTSPAuth *auth); +GstRTSPAuth * gst_rtsp_client_get_auth (GstRTSPClient *client); + +void gst_rtsp_client_set_thread_pool (GstRTSPClient *client, GstRTSPThreadPool *pool); +GstRTSPThreadPool * gst_rtsp_client_get_thread_pool (GstRTSPClient *client); + +gboolean gst_rtsp_client_set_connection (GstRTSPClient *client, GstRTSPConnection *conn); +GstRTSPConnection * gst_rtsp_client_get_connection (GstRTSPClient *client); + +guint gst_rtsp_client_attach (GstRTSPClient *client, + GMainContext *context); +void gst_rtsp_client_close (GstRTSPClient * client); + +void gst_rtsp_client_set_send_func (GstRTSPClient *client, + GstRTSPClientSendFunc func, + gpointer user_data, + GDestroyNotify notify); + +GstRTSPResult gst_rtsp_client_handle_message (GstRTSPClient *client, + GstRTSPMessage *message); +GstRTSPResult gst_rtsp_client_send_message (GstRTSPClient * client, + GstRTSPSession *session, + GstRTSPMessage *message); +/** + * GstRTSPClientSessionFilterFunc: + * @client: a #GstRTSPClient object + * @sess: a #GstRTSPSession in @client + * @user_data: user data that has been given to gst_rtsp_client_session_filter() + * + * This function will be called by the gst_rtsp_client_session_filter(). An + * implementation should return a value of #GstRTSPFilterResult. + * + * When this function returns #GST_RTSP_FILTER_REMOVE, @sess will be removed + * from @client. + * + * A return value of #GST_RTSP_FILTER_KEEP will leave @sess untouched in + * @client. + * + * A value of #GST_RTSP_FILTER_REF will add @sess to the result #GList of + * gst_rtsp_client_session_filter(). + * + * Returns: a #GstRTSPFilterResult. + */ +typedef GstRTSPFilterResult (*GstRTSPClientSessionFilterFunc) (GstRTSPClient *client, + GstRTSPSession *sess, + gpointer user_data); + +GList * gst_rtsp_client_session_filter (GstRTSPClient *client, + GstRTSPClientSessionFilterFunc func, + gpointer user_data); + + + +G_END_DECLS + +#endif /* __GST_RTSP_CLIENT_H__ */ diff --git a/gst/rtsp-server/rtsp-context.c b/gst/rtsp-server/rtsp-context.c new file mode 100644 index 0000000..919ca2d --- /dev/null +++ b/gst/rtsp-server/rtsp-context.c @@ -0,0 +1,92 @@ +/* GStreamer + * Copyright (C) 2013 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-context + * @short_description: A client request context + * @see_also: #GstRTSPServer, #GstRTSPClient + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include "rtsp-context.h" + +G_DEFINE_POINTER_TYPE (GstRTSPContext, gst_rtsp_context); + +static GPrivate current_context; + +/** + * gst_rtsp_context_get_current: + * + * Get the current #GstRTSPContext. This object is retrieved from the + * current thread that is handling the request for a client. + * + * Returns: a #GstRTSPContext + */ +GstRTSPContext * +gst_rtsp_context_get_current (void) +{ + GSList *l; + + l = g_private_get (¤t_context); + if (l == NULL) + return NULL; + + return (GstRTSPContext *) (l->data); + +} + +/** + * gst_rtsp_context_push_current: + * @ctx: a ##GstRTSPContext + * + * Pushes @ctx onto the context stack. The current + * context can then be received using gst_rtsp_context_get_current(). + **/ +void +gst_rtsp_context_push_current (GstRTSPContext * ctx) +{ + GSList *l; + + g_return_if_fail (ctx != NULL); + + l = g_private_get (¤t_context); + l = g_slist_prepend (l, ctx); + g_private_set (¤t_context, l); +} + +/** + * gst_rtsp_context_pop_current: + * @ctx: a #GstRTSPContext + * + * Pops @ctx off the context stack (verifying that @ctx + * is on the top of the stack). + **/ +void +gst_rtsp_context_pop_current (GstRTSPContext * ctx) +{ + GSList *l; + + l = g_private_get (¤t_context); + + g_return_if_fail (l != NULL); + g_return_if_fail (l->data == ctx); + + l = g_slist_delete_link (l, l); + g_private_set (¤t_context, l); +} diff --git a/gst/rtsp-server/rtsp-context.h b/gst/rtsp-server/rtsp-context.h new file mode 100644 index 0000000..c2be87e --- /dev/null +++ b/gst/rtsp-server/rtsp-context.h @@ -0,0 +1,88 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include + +#ifndef __GST_RTSP_CONTEXT_H__ +#define __GST_RTSP_CONTEXT_H__ + +G_BEGIN_DECLS + +#define GST_TYPE_RTSP_CONTEXT (gst_rtsp_context_get_type ()) + +typedef struct _GstRTSPContext GstRTSPContext; + +#include "rtsp-server.h" +#include "rtsp-media.h" +#include "rtsp-media-factory.h" +#include "rtsp-session-media.h" +#include "rtsp-auth.h" +#include "rtsp-thread-pool.h" +#include "rtsp-token.h" + +/** + * GstRTSPContext: + * @server: the server + * @conn: the connection + * @client: the client + * @request: the complete request + * @uri: the complete url parsed from @request + * @method: the parsed method of @uri + * @auth: the current auth object or %NULL + * @token: authorisation token + * @session: the session, can be %NULL + * @sessmedia: the session media for the url can be %NULL + * @factory: the media factory for the url, can be %NULL + * @media: the media for the url can be %NULL + * @stream: the stream for the url can be %NULL + * @response: the response + * + * Information passed around containing the context of a request. + */ +struct _GstRTSPContext { + GstRTSPServer *server; + GstRTSPConnection *conn; + GstRTSPClient *client; + GstRTSPMessage *request; + GstRTSPUrl *uri; + GstRTSPMethod method; + GstRTSPAuth *auth; + GstRTSPToken *token; + GstRTSPSession *session; + GstRTSPSessionMedia *sessmedia; + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPStream *stream; + GstRTSPMessage *response; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +GType gst_rtsp_context_get_type (void); + +GstRTSPContext * gst_rtsp_context_get_current (void); +void gst_rtsp_context_push_current (GstRTSPContext * ctx); +void gst_rtsp_context_pop_current (GstRTSPContext * ctx); + + +G_END_DECLS + +#endif /* __GST_RTSP_CONTEXT_H__ */ diff --git a/gst/rtsp-server/rtsp-media-factory-uri.c b/gst/rtsp-server/rtsp-media-factory-uri.c new file mode 100644 index 0000000..01f3f99 --- /dev/null +++ b/gst/rtsp-server/rtsp-media-factory-uri.c @@ -0,0 +1,645 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-media-factory-uri + * @short_description: A factory for URI sources + * @see_also: #GstRTSPMediaFactory, #GstRTSPMedia + * + * This specialized #GstRTSPMediaFactory constructs media pipelines from a URI, + * given with gst_rtsp_media_factory_uri_set_uri(). + * + * It will automatically demux and payload the different streams found in the + * media at URL. + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include + +#include "rtsp-media-factory-uri.h" + +#define GST_RTSP_MEDIA_FACTORY_URI_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_URI, GstRTSPMediaFactoryURIPrivate)) + +struct _GstRTSPMediaFactoryURIPrivate +{ + GMutex lock; + gchar *uri; /* protected by lock */ + gboolean use_gstpay; + + GstCaps *raw_vcaps; + GstCaps *raw_acaps; + GList *demuxers; + GList *payloaders; + GList *decoders; +}; + +#define DEFAULT_URI NULL +#define DEFAULT_USE_GSTPAY FALSE + +enum +{ + PROP_0, + PROP_URI, + PROP_USE_GSTPAY, + PROP_LAST +}; + + +#define RAW_VIDEO_CAPS \ + "video/x-raw" + +#define RAW_AUDIO_CAPS \ + "audio/x-raw" + +static GstStaticCaps raw_video_caps = GST_STATIC_CAPS (RAW_VIDEO_CAPS); +static GstStaticCaps raw_audio_caps = GST_STATIC_CAPS (RAW_AUDIO_CAPS); + +typedef struct +{ + GstRTSPMediaFactoryURI *factory; + guint pt; +} FactoryData; + +static void +free_data (FactoryData * data) +{ + g_object_unref (data->factory); + g_free (data); +} + +static const gchar *factory_key = "GstRTSPMediaFactoryURI"; + +GST_DEBUG_CATEGORY_STATIC (rtsp_media_factory_uri_debug); +#define GST_CAT_DEFAULT rtsp_media_factory_uri_debug + +static void gst_rtsp_media_factory_uri_get_property (GObject * object, + guint propid, GValue * value, GParamSpec * pspec); +static void gst_rtsp_media_factory_uri_set_property (GObject * object, + guint propid, const GValue * value, GParamSpec * pspec); +static void gst_rtsp_media_factory_uri_finalize (GObject * obj); + +static GstElement *rtsp_media_factory_uri_create_element (GstRTSPMediaFactory * + factory, const GstRTSPUrl * url); + +G_DEFINE_TYPE (GstRTSPMediaFactoryURI, gst_rtsp_media_factory_uri, + GST_TYPE_RTSP_MEDIA_FACTORY); + +static void +gst_rtsp_media_factory_uri_class_init (GstRTSPMediaFactoryURIClass * klass) +{ + GObjectClass *gobject_class; + GstRTSPMediaFactoryClass *mediafactory_class; + + g_type_class_add_private (klass, sizeof (GstRTSPMediaFactoryURIPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + mediafactory_class = GST_RTSP_MEDIA_FACTORY_CLASS (klass); + + gobject_class->get_property = gst_rtsp_media_factory_uri_get_property; + gobject_class->set_property = gst_rtsp_media_factory_uri_set_property; + gobject_class->finalize = gst_rtsp_media_factory_uri_finalize; + + /** + * GstRTSPMediaFactoryURI::uri: + * + * The uri of the resource that will be served by this factory. + */ + g_object_class_install_property (gobject_class, PROP_URI, + g_param_spec_string ("uri", "URI", + "The URI of the resource to stream", DEFAULT_URI, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * GstRTSPMediaFactoryURI::use-gstpay: + * + * Allow the usage of gstpay in order to avoid decoding of compressed formats + * without a payloader. + */ + g_object_class_install_property (gobject_class, PROP_USE_GSTPAY, + g_param_spec_boolean ("use-gstpay", "Use gstpay", + "Use the gstpay payloader to avoid decoding", DEFAULT_USE_GSTPAY, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + mediafactory_class->create_element = rtsp_media_factory_uri_create_element; + + GST_DEBUG_CATEGORY_INIT (rtsp_media_factory_uri_debug, "rtspmediafactoryuri", + 0, "GstRTSPMediaFactoryUri"); +} + +typedef struct +{ + GList *demux; + GList *payload; + GList *decode; +} FilterData; + +static gboolean +payloader_filter (GstPluginFeature * feature, FilterData * data) +{ + const gchar *klass; + GstElementFactory *fact; + GList **list = NULL; + + /* we only care about element factories */ + if (G_UNLIKELY (!GST_IS_ELEMENT_FACTORY (feature))) + return FALSE; + + if (gst_plugin_feature_get_rank (feature) < GST_RANK_MARGINAL) + return FALSE; + + fact = GST_ELEMENT_FACTORY_CAST (feature); + + klass = gst_element_factory_get_metadata (fact, GST_ELEMENT_METADATA_KLASS); + + if (strstr (klass, "Decoder")) + list = &data->decode; + else if (strstr (klass, "Demux")) + list = &data->demux; + else if (strstr (klass, "Parser") && strstr (klass, "Codec")) + list = &data->demux; + else if (strstr (klass, "Payloader") && strstr (klass, "RTP")) + list = &data->payload; + + if (list) { + GST_DEBUG ("adding %s", GST_OBJECT_NAME (fact)); + *list = g_list_prepend (*list, gst_object_ref (fact)); + } + + return FALSE; +} + +static void +gst_rtsp_media_factory_uri_init (GstRTSPMediaFactoryURI * factory) +{ + GstRTSPMediaFactoryURIPrivate *priv = + GST_RTSP_MEDIA_FACTORY_URI_GET_PRIVATE (factory); + FilterData data = { NULL, NULL, NULL }; + + GST_DEBUG_OBJECT (factory, "new"); + + factory->priv = priv; + + priv->uri = g_strdup (DEFAULT_URI); + priv->use_gstpay = DEFAULT_USE_GSTPAY; + g_mutex_init (&priv->lock); + + /* get the feature list using the filter */ + gst_registry_feature_filter (gst_registry_get (), (GstPluginFeatureFilter) + payloader_filter, FALSE, &data); + /* sort */ + priv->demuxers = + g_list_sort (data.demux, gst_plugin_feature_rank_compare_func); + priv->payloaders = + g_list_sort (data.payload, gst_plugin_feature_rank_compare_func); + priv->decoders = + g_list_sort (data.decode, gst_plugin_feature_rank_compare_func); + + priv->raw_vcaps = gst_static_caps_get (&raw_video_caps); + priv->raw_acaps = gst_static_caps_get (&raw_audio_caps); +} + +static void +gst_rtsp_media_factory_uri_finalize (GObject * obj) +{ + GstRTSPMediaFactoryURI *factory = GST_RTSP_MEDIA_FACTORY_URI (obj); + GstRTSPMediaFactoryURIPrivate *priv = factory->priv; + + GST_DEBUG_OBJECT (factory, "finalize"); + + g_free (priv->uri); + gst_plugin_feature_list_free (priv->demuxers); + gst_plugin_feature_list_free (priv->payloaders); + gst_plugin_feature_list_free (priv->decoders); + gst_caps_unref (priv->raw_vcaps); + gst_caps_unref (priv->raw_acaps); + g_mutex_clear (&priv->lock); + + G_OBJECT_CLASS (gst_rtsp_media_factory_uri_parent_class)->finalize (obj); +} + +static void +gst_rtsp_media_factory_uri_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + GstRTSPMediaFactoryURI *factory = GST_RTSP_MEDIA_FACTORY_URI (object); + GstRTSPMediaFactoryURIPrivate *priv = factory->priv; + + switch (propid) { + case PROP_URI: + g_value_take_string (value, gst_rtsp_media_factory_uri_get_uri (factory)); + break; + case PROP_USE_GSTPAY: + g_value_set_boolean (value, priv->use_gstpay); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_media_factory_uri_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + GstRTSPMediaFactoryURI *factory = GST_RTSP_MEDIA_FACTORY_URI (object); + GstRTSPMediaFactoryURIPrivate *priv = factory->priv; + + switch (propid) { + case PROP_URI: + gst_rtsp_media_factory_uri_set_uri (factory, g_value_get_string (value)); + break; + case PROP_USE_GSTPAY: + priv->use_gstpay = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +/** + * gst_rtsp_media_factory_uri_new: + * + * Create a new #GstRTSPMediaFactoryURI instance. + * + * Returns: (transfer full): a new #GstRTSPMediaFactoryURI object. + */ +GstRTSPMediaFactoryURI * +gst_rtsp_media_factory_uri_new (void) +{ + GstRTSPMediaFactoryURI *result; + + result = g_object_new (GST_TYPE_RTSP_MEDIA_FACTORY_URI, NULL); + + return result; +} + +/** + * gst_rtsp_media_factory_uri_set_uri: + * @factory: a #GstRTSPMediaFactory + * @uri: the uri the stream + * + * Set the URI of the resource that will be streamed by this factory. + */ +void +gst_rtsp_media_factory_uri_set_uri (GstRTSPMediaFactoryURI * factory, + const gchar * uri) +{ + GstRTSPMediaFactoryURIPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY_URI (factory)); + g_return_if_fail (uri != NULL); + + priv = factory->priv; + + g_mutex_lock (&priv->lock); + g_free (priv->uri); + priv->uri = g_strdup (uri); + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_media_factory_uri_get_uri: + * @factory: a #GstRTSPMediaFactory + * + * Get the URI that will provide media for this factory. + * + * Returns: (transfer full): the configured URI. g_free() after usage. + */ +gchar * +gst_rtsp_media_factory_uri_get_uri (GstRTSPMediaFactoryURI * factory) +{ + GstRTSPMediaFactoryURIPrivate *priv; + gchar *result; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY_URI (factory), NULL); + + priv = factory->priv; + + g_mutex_lock (&priv->lock); + result = g_strdup (priv->uri); + g_mutex_unlock (&priv->lock); + + return result; +} + +static GstElementFactory * +find_payloader (GstRTSPMediaFactoryURI * urifact, GstCaps * caps) +{ + GstRTSPMediaFactoryURIPrivate *priv = urifact->priv; + GList *list; + GstElementFactory *factory = NULL; + gboolean autoplug_more = FALSE; + + /* first find a demuxer that can link */ + list = gst_element_factory_list_filter (priv->demuxers, caps, + GST_PAD_SINK, FALSE); + + if (list) { + GstStructure *structure = gst_caps_get_structure (caps, 0); + gboolean parsed = FALSE; + gint mpegversion = 0; + + if (!gst_structure_get_boolean (structure, "parsed", &parsed) && + gst_structure_has_name (structure, "audio/mpeg") && + gst_structure_get_int (structure, "mpegversion", &mpegversion) && + (mpegversion == 2 || mpegversion == 4)) { + /* for AAC it's framed=true instead of parsed=true */ + gst_structure_get_boolean (structure, "framed", &parsed); + } + + /* Avoid plugging parsers in a loop. This is not 100% correct, as some + * parsers don't set parsed=true in caps. We should do something like + * decodebin does and track decode chains and elements plugged in those + * chains... + */ + if (parsed) { + GList *walk; + const gchar *klass; + + for (walk = list; walk; walk = walk->next) { + factory = GST_ELEMENT_FACTORY (walk->data); + klass = gst_element_factory_get_metadata (factory, + GST_ELEMENT_METADATA_KLASS); + if (strstr (klass, "Parser")) + /* caps have parsed=true, so skip this parser to avoid loops */ + continue; + + autoplug_more = TRUE; + break; + } + } else { + /* caps don't have parsed=true set and we have a demuxer/parser */ + autoplug_more = TRUE; + } + + gst_plugin_feature_list_free (list); + } + + if (autoplug_more) + /* we have a demuxer, try that one first */ + return NULL; + + /* no demuxer try a depayloader */ + list = gst_element_factory_list_filter (priv->payloaders, caps, + GST_PAD_SINK, FALSE); + + if (list == NULL) { + if (priv->use_gstpay) { + /* no depayloader or parser/demuxer, use gstpay when allowed */ + factory = gst_element_factory_find ("rtpgstpay"); + } else { + /* no depayloader, try a decoder, we'll get to a payloader for a decoded + * video or audio format, worst case. */ + list = gst_element_factory_list_filter (priv->decoders, caps, + GST_PAD_SINK, FALSE); + + if (list != NULL) { + /* we have a decoder, try that one first */ + gst_plugin_feature_list_free (list); + return NULL; + } + } + } + + if (list != NULL) { + factory = GST_ELEMENT_FACTORY_CAST (list->data); + g_object_ref (factory); + gst_plugin_feature_list_free (list); + } + return factory; +} + +static gboolean +autoplug_continue_cb (GstElement * uribin, GstPad * pad, GstCaps * caps, + GstElement * element) +{ + FactoryData *data; + GstElementFactory *factory; + + GST_DEBUG ("found pad %s:%s of caps %" GST_PTR_FORMAT, + GST_DEBUG_PAD_NAME (pad), caps); + + data = g_object_get_data (G_OBJECT (element), factory_key); + + if (!(factory = find_payloader (data->factory, caps))) + goto no_factory; + + /* we found a payloader, stop autoplugging so we can plug the + * payloader. */ + GST_DEBUG ("found factory %s", + gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory))); + gst_object_unref (factory); + + return FALSE; + + /* ERRORS */ +no_factory: + { + /* no payloader, continue autoplugging */ + GST_DEBUG ("no payloader found"); + return TRUE; + } +} + +static void +pad_added_cb (GstElement * uribin, GstPad * pad, GstElement * element) +{ + GstRTSPMediaFactoryURI *urifact; + GstRTSPMediaFactoryURIPrivate *priv; + FactoryData *data; + GstElementFactory *factory; + GstElement *payloader; + GstCaps *caps; + GstPad *sinkpad, *srcpad, *ghostpad; + GstElement *convert; + gchar *padname; + + GST_DEBUG ("added pad %s:%s", GST_DEBUG_PAD_NAME (pad)); + + /* link the element now and expose the pad */ + data = g_object_get_data (G_OBJECT (element), factory_key); + urifact = data->factory; + priv = urifact->priv; + + /* ref to make refcounting easier later */ + gst_object_ref (pad); + padname = gst_pad_get_name (pad); + + /* get pad caps first, then call get_caps, then fail */ + if ((caps = gst_pad_get_current_caps (pad)) == NULL) + if ((caps = gst_pad_query_caps (pad, NULL)) == NULL) + goto no_caps; + + /* check for raw caps */ + if (gst_caps_can_intersect (caps, priv->raw_vcaps)) { + /* we have raw video caps, insert converter */ + convert = gst_element_factory_make ("videoconvert", NULL); + } else if (gst_caps_can_intersect (caps, priv->raw_acaps)) { + /* we have raw audio caps, insert converter */ + convert = gst_element_factory_make ("audioconvert", NULL); + } else { + convert = NULL; + } + + if (convert) { + gst_bin_add (GST_BIN_CAST (element), convert); + gst_element_set_state (convert, GST_STATE_PLAYING); + + sinkpad = gst_element_get_static_pad (convert, "sink"); + gst_pad_link (pad, sinkpad); + gst_object_unref (sinkpad); + + /* unref old pad, we reffed before */ + gst_object_unref (pad); + + /* continue with new pad and caps */ + pad = gst_element_get_static_pad (convert, "src"); + if ((caps = gst_pad_get_current_caps (pad)) == NULL) + if ((caps = gst_pad_query_caps (pad, NULL)) == NULL) + goto no_caps; + } + + if (!(factory = find_payloader (urifact, caps))) + goto no_factory; + + gst_caps_unref (caps); + + /* we have a payloader now */ + GST_DEBUG ("found payloader factory %s", + gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory))); + + payloader = gst_element_factory_create (factory, NULL); + if (payloader == NULL) + goto no_payloader; + + g_object_set (payloader, "pt", data->pt, NULL); + data->pt++; + + if (g_object_class_find_property (G_OBJECT_GET_CLASS (payloader), + "buffer-list")) + g_object_set (payloader, "buffer-list", TRUE, NULL); + + /* add the payloader to the pipeline */ + gst_bin_add (GST_BIN_CAST (element), payloader); + gst_element_set_state (payloader, GST_STATE_PLAYING); + + /* link the pad to the sinkpad of the payloader */ + sinkpad = gst_element_get_static_pad (payloader, "sink"); + gst_pad_link (pad, sinkpad); + gst_object_unref (sinkpad); + gst_object_unref (pad); + + /* now expose the srcpad of the payloader as a ghostpad with the same name + * as the uridecodebin pad name. */ + srcpad = gst_element_get_static_pad (payloader, "src"); + ghostpad = gst_ghost_pad_new (padname, srcpad); + gst_object_unref (srcpad); + g_free (padname); + + gst_pad_set_active (ghostpad, TRUE); + gst_element_add_pad (element, ghostpad); + + return; + + /* ERRORS */ +no_caps: + { + GST_WARNING ("could not get caps from pad"); + g_free (padname); + gst_object_unref (pad); + return; + } +no_factory: + { + GST_DEBUG ("no payloader found"); + g_free (padname); + gst_caps_unref (caps); + gst_object_unref (pad); + return; + } +no_payloader: + { + GST_ERROR ("could not create payloader from factory"); + g_free (padname); + gst_caps_unref (caps); + gst_object_unref (pad); + return; + } +} + +static void +no_more_pads_cb (GstElement * uribin, GstElement * element) +{ + GST_DEBUG ("no-more-pads"); + gst_element_no_more_pads (element); +} + +static GstElement * +rtsp_media_factory_uri_create_element (GstRTSPMediaFactory * factory, + const GstRTSPUrl * url) +{ + GstRTSPMediaFactoryURIPrivate *priv; + GstElement *topbin, *element, *uribin; + GstRTSPMediaFactoryURI *urifact; + FactoryData *data; + + urifact = GST_RTSP_MEDIA_FACTORY_URI_CAST (factory); + priv = urifact->priv; + + GST_LOG ("creating element"); + + topbin = gst_bin_new ("GstRTSPMediaFactoryURI"); + g_assert (topbin != NULL); + + /* our bin will dynamically expose payloaded pads */ + element = gst_bin_new ("dynpay0"); + g_assert (element != NULL); + + uribin = gst_element_factory_make ("uridecodebin", "uribin"); + if (uribin == NULL) + goto no_uridecodebin; + + g_object_set (uribin, "uri", priv->uri, NULL); + + /* keep factory data around */ + data = g_new0 (FactoryData, 1); + data->factory = g_object_ref (factory); + data->pt = 96; + + g_object_set_data_full (G_OBJECT (element), factory_key, + data, (GDestroyNotify) free_data); + + /* connect to the signals */ + g_signal_connect (uribin, "autoplug-continue", + (GCallback) autoplug_continue_cb, element); + g_signal_connect (uribin, "pad-added", (GCallback) pad_added_cb, element); + g_signal_connect (uribin, "no-more-pads", (GCallback) no_more_pads_cb, + element); + + gst_bin_add (GST_BIN_CAST (element), uribin); + gst_bin_add (GST_BIN_CAST (topbin), element); + + return topbin; + +no_uridecodebin: + { + g_critical ("can't create uridecodebin element"); + gst_object_unref (element); + return NULL; + } +} diff --git a/gst/rtsp-server/rtsp-media-factory-uri.h b/gst/rtsp-server/rtsp-media-factory-uri.h new file mode 100644 index 0000000..6dc3a40 --- /dev/null +++ b/gst/rtsp-server/rtsp-media-factory-uri.h @@ -0,0 +1,80 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include "rtsp-media-factory.h" + +#ifndef __GST_RTSP_MEDIA_FACTORY_URI_H__ +#define __GST_RTSP_MEDIA_FACTORY_URI_H__ + +G_BEGIN_DECLS + +/* types for the media factory */ +#define GST_TYPE_RTSP_MEDIA_FACTORY_URI (gst_rtsp_media_factory_uri_get_type ()) +#define GST_IS_RTSP_MEDIA_FACTORY_URI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_URI)) +#define GST_IS_RTSP_MEDIA_FACTORY_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_MEDIA_FACTORY_URI)) +#define GST_RTSP_MEDIA_FACTORY_URI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_URI, GstRTSPMediaFactoryURIClass)) +#define GST_RTSP_MEDIA_FACTORY_URI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_URI, GstRTSPMediaFactoryURI)) +#define GST_RTSP_MEDIA_FACTORY_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_MEDIA_FACTORY_URI, GstRTSPMediaFactoryURIClass)) +#define GST_RTSP_MEDIA_FACTORY_URI_CAST(obj) ((GstRTSPMediaFactoryURI*)(obj)) +#define GST_RTSP_MEDIA_FACTORY_URI_CLASS_CAST(klass) ((GstRTSPMediaFactoryURIClass*)(klass)) + +typedef struct _GstRTSPMediaFactoryURI GstRTSPMediaFactoryURI; +typedef struct _GstRTSPMediaFactoryURIClass GstRTSPMediaFactoryURIClass; +typedef struct _GstRTSPMediaFactoryURIPrivate GstRTSPMediaFactoryURIPrivate; + +/** + * GstRTSPMediaFactoryURI: + * + * A media factory that creates a pipeline to play and uri. + */ +struct _GstRTSPMediaFactoryURI { + GstRTSPMediaFactory parent; + + /*< private >*/ + GstRTSPMediaFactoryURIPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPMediaFactoryURIClass: + * + * The #GstRTSPMediaFactoryURI class structure. + */ +struct _GstRTSPMediaFactoryURIClass { + GstRTSPMediaFactoryClass parent_class; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +GType gst_rtsp_media_factory_uri_get_type (void); + +/* creating the factory */ +GstRTSPMediaFactoryURI * gst_rtsp_media_factory_uri_new (void); + +/* configuring the factory */ +void gst_rtsp_media_factory_uri_set_uri (GstRTSPMediaFactoryURI *factory, + const gchar *uri); +gchar * gst_rtsp_media_factory_uri_get_uri (GstRTSPMediaFactoryURI *factory); + +G_END_DECLS + +#endif /* __GST_RTSP_MEDIA_FACTORY_URI_H__ */ diff --git a/gst/rtsp-server/rtsp-media-factory-wfd.c b/gst/rtsp-server/rtsp-media-factory-wfd.c new file mode 100644 index 0000000..5bf7c5b --- /dev/null +++ b/gst/rtsp-server/rtsp-media-factory-wfd.c @@ -0,0 +1,1007 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-media-factory + * @short_description: A factory for media pipelines + * @see_also: #GstRTSPMountPoints, #GstRTSPMedia + * + * The #GstRTSPMediaFactoryWFD is responsible for creating or recycling + * #GstRTSPMedia objects based on the passed URL. + * + * The default implementation of the object can create #GstRTSPMedia objects + * containing a pipeline created from a launch description set with + * gst_rtsp_media_factory_wfd_set_launch(). + * + * Media from a factory can be shared by setting the shared flag with + * gst_rtsp_media_factory_wfd_set_shared(). When a factory is shared, + * gst_rtsp_media_factory_wfd_construct() will return the same #GstRTSPMedia when + * the url matches. + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include +#include "rtsp-media-factory-wfd.h" +#include "gstwfdmessage.h" + +#define GST_RTSP_MEDIA_FACTORY_WFD_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_WFD, GstRTSPMediaFactoryWFDPrivate)) + +#define GST_RTSP_MEDIA_FACTORY_WFD_GET_LOCK(f) (&(GST_RTSP_MEDIA_FACTORY_WFD_CAST(f)->priv->lock)) +#define GST_RTSP_MEDIA_FACTORY_WFD_LOCK(f) (g_mutex_lock(GST_RTSP_MEDIA_FACTORY_WFD_GET_LOCK(f))) +#define GST_RTSP_MEDIA_FACTORY_WFD_UNLOCK(f) (g_mutex_unlock(GST_RTSP_MEDIA_FACTORY_WFD_GET_LOCK(f))) + +struct _GstRTSPMediaFactoryWFDPrivate +{ + GMutex lock; + GstRTSPPermissions *permissions; + gchar *launch; + gboolean shared; + GstRTSPLowerTrans protocols; + guint buffer_size; + guint mtu_size; + + guint8 videosrc_type; + guint8 video_codec; + guint video_bitrate; + guint video_width; + guint video_height; + guint video_framerate; + guint video_enc_skip_inbuf_value; + GstElement *video_queue; + + gchar *audio_device; + guint8 audio_codec; + guint64 audio_latency_time; + guint64 audio_buffer_time; + gboolean audio_do_timestamp; + guint8 audio_channels; + guint8 audio_freq; + guint8 audio_bitrate; + GstElement *audio_queue; + + guint64 video_resolution_supported; + + gboolean dump_ts; +}; + +#define DEFAULT_LAUNCH NULL +#define DEFAULT_SHARED FALSE +#define DEFAULT_PROTOCOLS GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_UDP_MCAST | \ + GST_RTSP_LOWER_TRANS_TCP +#define DEFAULT_BUFFER_SIZE 0x80000 + +enum +{ + PROP_0, + PROP_LAUNCH, + PROP_SHARED, + PROP_SUSPEND_MODE, + PROP_EOS_SHUTDOWN, + PROP_PROTOCOLS, + PROP_BUFFER_SIZE, + PROP_LAST +}; + +enum +{ + SIGNAL_MEDIA_CONSTRUCTED, + SIGNAL_MEDIA_CONFIGURE, + SIGNAL_LAST +}; + +GST_DEBUG_CATEGORY_STATIC (rtsp_media_wfd_debug); +#define GST_CAT_DEFAULT rtsp_media_wfd_debug + +static void gst_rtsp_media_factory_wfd_get_property (GObject * object, + guint propid, GValue * value, GParamSpec * pspec); +static void gst_rtsp_media_factory_wfd_set_property (GObject * object, + guint propid, const GValue * value, GParamSpec * pspec); + +static void gst_rtsp_media_factory_wfd_finalize (GObject * obj); + + +static GstElement *rtsp_media_factory_wfd_create_element (GstRTSPMediaFactory * + factory, const GstRTSPUrl * url); +static GstRTSPMedia *rtsp_media_factory_wfd_construct (GstRTSPMediaFactory * + factory, const GstRTSPUrl * url); + +G_DEFINE_TYPE (GstRTSPMediaFactoryWFD, gst_rtsp_media_factory_wfd, + GST_TYPE_RTSP_MEDIA_FACTORY); + +static void +gst_rtsp_media_factory_wfd_class_init (GstRTSPMediaFactoryWFDClass * klass) +{ + GObjectClass *gobject_class; + GstRTSPMediaFactoryClass *factory_class; + + g_type_class_add_private (klass, sizeof (GstRTSPMediaFactoryWFDPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + factory_class = GST_RTSP_MEDIA_FACTORY_CLASS (klass); + + gobject_class->get_property = gst_rtsp_media_factory_wfd_get_property; + gobject_class->set_property = gst_rtsp_media_factory_wfd_set_property; + gobject_class->finalize = gst_rtsp_media_factory_wfd_finalize; + + factory_class->construct = rtsp_media_factory_wfd_construct; + factory_class->create_element = rtsp_media_factory_wfd_create_element; + + GST_DEBUG_CATEGORY_INIT (rtsp_media_wfd_debug, "rtspmediafactorywfd", 0, + "GstRTSPMediaFactoryWFD"); +} + +void gst_rtsp_media_factory_wfd_set (GstRTSPMediaFactoryWFD * factory, + guint8 videosrc_type, gchar *audio_device, guint64 audio_latency_time, + guint64 audio_buffer_time, gboolean audio_do_timestamp, guint mtu_size) +{ + GstRTSPMediaFactoryWFDPrivate *priv = + GST_RTSP_MEDIA_FACTORY_WFD_GET_PRIVATE (factory); + factory->priv = priv; + + priv->videosrc_type = videosrc_type; + priv->audio_device= audio_device; + priv->audio_latency_time = audio_latency_time; + priv->audio_buffer_time = audio_buffer_time; + priv->audio_do_timestamp = audio_do_timestamp; + priv->mtu_size = mtu_size; +} + +void gst_rtsp_media_factory_wfd_set_dump_ts (GstRTSPMediaFactoryWFD * factory, + gboolean dump_ts) +{ + GstRTSPMediaFactoryWFDPrivate *priv = + GST_RTSP_MEDIA_FACTORY_WFD_GET_PRIVATE (factory); + factory->priv = priv; + + priv->dump_ts = dump_ts; +} +void gst_rtsp_media_factory_wfd_set_negotiated_resolution (GstRTSPMediaFactory *factory, + guint32 width, guint32 height) +{ + GstRTSPMediaFactoryWFD *factory_wfd = GST_RTSP_MEDIA_FACTORY_WFD (factory); + GstRTSPMediaFactoryWFDPrivate *priv = factory_wfd->priv; + + priv->video_width = width; + priv->video_height = height; +} + +static void +gst_rtsp_media_factory_wfd_init (GstRTSPMediaFactoryWFD * factory) +{ + GstRTSPMediaFactoryWFDPrivate *priv = + GST_RTSP_MEDIA_FACTORY_WFD_GET_PRIVATE (factory); + factory->priv = priv; + + priv->launch = g_strdup (DEFAULT_LAUNCH); + priv->shared = DEFAULT_SHARED; + priv->protocols = DEFAULT_PROTOCOLS; + priv->buffer_size = DEFAULT_BUFFER_SIZE; + + //priv->videosrc_type = GST_WFD_VSRC_XIMAGESRC; + //priv->videosrc_type = GST_WFD_VSRC_XVIMAGESRC; + //priv->videosrc_type = GST_WFD_VSRC_CAMERASRC; + priv->videosrc_type = GST_WFD_VSRC_VIDEOTESTSRC; + priv->video_codec = GST_WFD_VIDEO_H264; + priv->video_bitrate = 200000; + priv->video_width = 640; + priv->video_height = 480; + priv->video_framerate = 30; + priv->video_enc_skip_inbuf_value = 5; + + priv->audio_device = g_strdup ("alsa_output.1.analog-stereo.monitor"); + priv->audio_codec = GST_WFD_AUDIO_AAC; + priv->audio_latency_time = 10000; + priv->audio_buffer_time = 200000; + priv->audio_do_timestamp = FALSE; + priv->audio_channels = GST_WFD_CHANNEL_2; + priv->audio_freq = GST_WFD_FREQ_48000; + + g_mutex_init (&priv->lock); +} + +static void +gst_rtsp_media_factory_wfd_finalize (GObject * obj) +{ + GstRTSPMediaFactoryWFD *factory = GST_RTSP_MEDIA_FACTORY_WFD (obj); + GstRTSPMediaFactoryWFDPrivate *priv = factory->priv; + + if (priv->permissions) + gst_rtsp_permissions_unref (priv->permissions); + g_free (priv->launch); + g_mutex_clear (&priv->lock); + + if (priv->audio_device) + g_free (priv->audio_device); + + G_OBJECT_CLASS (gst_rtsp_media_factory_wfd_parent_class)->finalize (obj); +} + +GstRTSPMediaFactoryWFD * +gst_rtsp_media_factory_wfd_new (void) +{ + GstRTSPMediaFactoryWFD *result; + + result = g_object_new (GST_TYPE_RTSP_MEDIA_FACTORY_WFD, NULL); + + return result; +} + +static void +gst_rtsp_media_factory_wfd_get_property (GObject * object, + guint propid, GValue * value, GParamSpec * pspec) +{ + //GstRTSPMediaFactoryWFD *factory = GST_RTSP_MEDIA_FACTORY_WFD (object); + + switch (propid) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_media_factory_wfd_set_property (GObject * object, + guint propid, const GValue * value, GParamSpec * pspec) +{ + //GstRTSPMediaFactoryWFD *factory = GST_RTSP_MEDIA_FACTORY_WFD (object); + + switch (propid) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static GstPadProbeReturn +rtsp_media_wfd_dump_data (GstPad * pad, GstPadProbeInfo *info, gpointer u_data) +{ + guint8 *data; + gsize size; + FILE *f; + GstMapInfo mapinfo; + + if (info->type == (GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_PUSH)) { + GstBuffer *buffer = gst_pad_probe_info_get_buffer (info); + + gst_buffer_map (buffer, &mapinfo, GST_MAP_READ); + data = mapinfo.data; + size = gst_buffer_get_size (buffer); + + f = fopen ("/root/probe.ts", "a"); + fwrite (data, size, 1, f); + fclose (f); + gst_buffer_unmap (buffer, &mapinfo); + } + + return GST_PAD_PROBE_OK; +} + +static gboolean +_rtsp_media_factory_wfd_create_audio_capture_bin (GstRTSPMediaFactoryWFD * + factory, GstBin * srcbin) +{ + GstElement *audiosrc = NULL; + GstElement *acaps = NULL; + GstElement *aenc = NULL; + GstElement *audio_convert = NULL; + GstElement *aqueue = NULL; + GstRTSPMediaFactoryWFDPrivate *priv = NULL; + + guint channels = 0; + gboolean is_enc_req = TRUE; + guint freq = 0; + gchar *acodec = NULL; + + priv = factory->priv; + + /* create audio src element */ + audiosrc = gst_element_factory_make ("pulsesrc", "audiosrc"); + if (!audiosrc) { + GST_ERROR_OBJECT (factory, "failed to create audiosrc element"); + goto create_error; + } + + GST_INFO_OBJECT (factory, "audio device : %s", priv->audio_device); + GST_INFO_OBJECT (factory, "audio latency time : %lld", + priv->audio_latency_time); + GST_INFO_OBJECT (factory, "audio_buffer_time : %lld", + priv->audio_buffer_time); + GST_INFO_OBJECT (factory, "audio_do_timestamp : %d", + priv->audio_do_timestamp); + + g_object_set (audiosrc, "device", priv->audio_device, NULL); + g_object_set (audiosrc, "buffer-time", (gint64) priv->audio_buffer_time, + NULL); + g_object_set (audiosrc, "latency-time", (gint64) priv->audio_latency_time, + NULL); + g_object_set (audiosrc, "do-timestamp", (gboolean) priv->audio_do_timestamp, + NULL); + g_object_set (audiosrc, "provide-clock", (gboolean) FALSE, NULL); + g_object_set (audiosrc, "is-live", (gboolean) TRUE, NULL); + + if (priv->audio_codec == GST_WFD_AUDIO_LPCM) { + /* To meet miracast certification */ + gint64 block_size = 1920; + g_object_set (audiosrc, "blocksize", (gint64) block_size, NULL); + + audio_convert = gst_element_factory_make ("audioconvert", "audio_convert"); + if (NULL == audio_convert) { + GST_ERROR_OBJECT (factory, "failed to create audio convert element"); + goto create_error; + } + } + + /* create audio caps element */ + acaps = gst_element_factory_make ("capsfilter", "audiocaps"); + if (NULL == acaps) { + GST_ERROR_OBJECT (factory, "failed to create audio capsilfter element"); + goto create_error; + } + + if (priv->audio_channels == GST_WFD_CHANNEL_2) + channels = 2; + else if (priv->audio_channels == GST_WFD_CHANNEL_4) + channels = 4; + else if (priv->audio_channels == GST_WFD_CHANNEL_6) + channels = 6; + else if (priv->audio_channels == GST_WFD_CHANNEL_8) + channels = 8; + else + channels = 2; + + if (priv->audio_freq == GST_WFD_FREQ_44100) + freq = 44100; + else if (priv->audio_freq == GST_WFD_FREQ_48000) + freq = 48000; + else + freq = 44100; + + if (priv->audio_codec == GST_WFD_AUDIO_LPCM) { + g_object_set (G_OBJECT (acaps), "caps", + gst_caps_new_simple ("audio/x-lpcm", "width", G_TYPE_INT, 16, + /* In case of LPCM, uses big endian */ + "endianness", G_TYPE_INT, 4321, + "signed", G_TYPE_BOOLEAN, TRUE, + "depth", G_TYPE_INT, 16, + "rate", G_TYPE_INT, freq, + "channels", G_TYPE_INT, channels, NULL), NULL); + } else if ((priv->audio_codec == GST_WFD_AUDIO_AAC) + || (priv->audio_codec == GST_WFD_AUDIO_AC3)) { + g_object_set (G_OBJECT (acaps), "caps", gst_caps_new_simple ("audio/x-raw", + "endianness", G_TYPE_INT, 1234, "signed", G_TYPE_BOOLEAN, TRUE, + "depth", G_TYPE_INT, 16, "rate", G_TYPE_INT, freq, "channels", + G_TYPE_INT, channels, NULL), NULL); + } + + if (priv->audio_codec == GST_WFD_AUDIO_AAC) { + acodec = g_strdup ("avenc_aac"); + is_enc_req = TRUE; + } else if (priv->audio_codec == GST_WFD_AUDIO_AC3) { + acodec = g_strdup ("avenc_ac3"); + is_enc_req = TRUE; + } else if (priv->audio_codec == GST_WFD_AUDIO_LPCM) { + GST_DEBUG_OBJECT (factory, "No codec required, raw data will be sent"); + is_enc_req = FALSE; + } else { + GST_ERROR_OBJECT (factory, "Yet to support other than H264 format"); + goto create_error; + } + + if (is_enc_req) { + aenc = gst_element_factory_make (acodec, "audioenc"); + if (NULL == aenc) { + GST_ERROR_OBJECT (factory, "failed to create audio encoder element"); + goto create_error; + } + + g_object_set (aenc, "compliance", -2, NULL); + g_object_set (aenc, "tolerance", 400000000, NULL); + g_object_set (aenc, "bitrate", (guint) 128000, NULL); + g_object_set (aenc, "rate-control", 2, NULL); + + aqueue = gst_element_factory_make ("queue", "audio-queue"); + if (!aqueue) { + GST_ERROR_OBJECT (factory, "failed to create audio queue element"); + goto create_error; + } + + gst_bin_add_many (srcbin, audiosrc, acaps, aenc, aqueue, NULL); + + if (!gst_element_link_many (audiosrc, acaps, aenc, aqueue, NULL)) { + GST_ERROR_OBJECT (factory, "Failed to link audio src elements..."); + goto create_error; + } + } else { + aqueue = gst_element_factory_make ("queue", "audio-queue"); + if (!aqueue) { + GST_ERROR_OBJECT (factory, "failed to create audio queue element"); + goto create_error; + } + + gst_bin_add_many (srcbin, audiosrc, audio_convert, acaps, aqueue, NULL); + + if (!gst_element_link_many (audiosrc, audio_convert, acaps, aqueue, NULL)) { + GST_ERROR_OBJECT (factory, "Failed to link audio src elements..."); + goto create_error; + } + } + + priv->audio_queue = aqueue; + + return TRUE; + +create_error: + return FALSE; +} + +static gboolean +_rtsp_media_factory_wfd_create_videotest_bin (GstRTSPMediaFactoryWFD * factory, + GstBin * srcbin) +{ + GstElement *videosrc = NULL; + GstElement *vcaps = NULL; + GstElement *venc_caps = NULL; + gchar *vcodec = NULL; + GstElement *venc = NULL; + GstElement *vqueue = NULL; + GstRTSPMediaFactoryWFDPrivate *priv = NULL; + + priv = factory->priv; + + GST_INFO_OBJECT (factory, "picked videotestsrc as video source"); + + videosrc = gst_element_factory_make ("videotestsrc", "videosrc"); + if (NULL == videosrc) { + GST_ERROR_OBJECT (factory, "failed to create ximagesrc element"); + goto create_error; + } + + /* create video caps element */ + vcaps = gst_element_factory_make ("capsfilter", "videocaps"); + if (NULL == vcaps) { + GST_ERROR_OBJECT (factory, "failed to create video capsilfter element"); + goto create_error; + } + + g_object_set (G_OBJECT (vcaps), "caps", + gst_caps_new_simple ("video/x-raw", + "width", G_TYPE_INT, priv->video_width, + "height", G_TYPE_INT, priv->video_height, + "framerate", GST_TYPE_FRACTION, priv->video_framerate, 1, NULL), + NULL); + + if (priv->video_codec == GST_WFD_VIDEO_H264) + vcodec = g_strdup ("x264enc"); + else { + GST_ERROR_OBJECT (factory, "Yet to support other than H264 format"); + g_free (vcodec); + goto create_error; + } + + venc = gst_element_factory_make (vcodec, "videoenc"); + g_free (vcodec); + + if (!venc) { + GST_ERROR_OBJECT (factory, "failed to create video encoder element"); + goto create_error; + } + + g_object_set (venc, "aud", 0, NULL); + g_object_set (venc, "byte-stream", 1, NULL); + g_object_set (venc, "bitrate", 512, NULL); + + venc_caps = gst_element_factory_make ("capsfilter", "venc_caps"); + if (NULL == venc_caps) { + GST_ERROR_OBJECT (factory, "failed to create video capsilfter element"); + goto create_error; + } + + g_object_set (G_OBJECT (venc_caps), "caps", + gst_caps_new_simple ("video/x-h264", + "profile", G_TYPE_STRING, "baseline", NULL), NULL); + + vqueue = gst_element_factory_make ("queue", "video-queue"); + if (!vqueue) { + GST_ERROR_OBJECT (factory, "failed to create video queue element"); + goto create_error; + } + + gst_bin_add_many (srcbin, videosrc, vcaps, venc, venc_caps, vqueue, NULL); + if (!gst_element_link_many (videosrc, vcaps, venc, venc_caps, vqueue, NULL)) { + GST_ERROR_OBJECT (factory, "Failed to link video src elements..."); + goto create_error; + } + + priv->video_queue = vqueue; + + return TRUE; + +create_error: + return FALSE; +} + +static gboolean +_rtsp_media_factory_wfd_create_camera_capture_bin (GstRTSPMediaFactoryWFD * + factory, GstBin * srcbin) +{ + GstElement *videosrc = NULL; + GstElement *vcaps = NULL; + GstElement *venc = NULL; + GstElement *vqueue = NULL; + gchar *vcodec = NULL; + GstRTSPMediaFactoryWFDPrivate *priv = NULL; + + priv = factory->priv; + + videosrc = gst_element_factory_make ("camerasrc", "videosrc"); + if (NULL == videosrc) { + GST_ERROR_OBJECT (factory, "failed to create camerasrc element"); + goto create_error; + } + + /* create video caps element */ + vcaps = gst_element_factory_make ("capsfilter", "videocaps"); + if (NULL == vcaps) { + GST_ERROR_OBJECT (factory, "failed to create video capsilfter element"); + goto create_error; + } + + GST_INFO_OBJECT (factory, "picked camerasrc as video source"); + g_object_set (G_OBJECT (vcaps), "caps", + gst_caps_new_simple ("video/x-raw", + "width", G_TYPE_INT, priv->video_width, + "height", G_TYPE_INT, priv->video_height, + "format", G_TYPE_STRING, "SN12", + "framerate", GST_TYPE_FRACTION, priv->video_framerate, 1, NULL), + NULL); + + if (priv->video_codec == GST_WFD_VIDEO_H264) + vcodec = g_strdup ("omxh264enc"); + else { + GST_ERROR_OBJECT (factory, "Yet to support other than H264 format"); + goto create_error; + } + + venc = gst_element_factory_make (vcodec, "videoenc"); + if (!venc) { + GST_ERROR_OBJECT (factory, "failed to create video encoder element"); + goto create_error; + } + + g_object_set (venc, "bitrate", priv->video_bitrate, NULL); + g_object_set (venc, "byte-stream", 1, NULL); + g_object_set (venc, "append-dci", 1, NULL); + + vqueue = gst_element_factory_make ("queue", "video-queue"); + if (!vqueue) { + GST_ERROR_OBJECT (factory, "failed to create video queue element"); + goto create_error; + } + + gst_bin_add_many (srcbin, videosrc, vcaps, venc, vqueue, NULL); + + if (!gst_element_link_many (videosrc, vcaps, venc, vqueue, NULL)) { + GST_ERROR_OBJECT (factory, "Failed to link video src elements..."); + goto create_error; + } + + priv->video_queue = vqueue; + + return TRUE; + +create_error: + return FALSE; +} + +static gboolean +_rtsp_media_factory_wfd_create_xcapture_bin (GstRTSPMediaFactoryWFD * factory, + GstBin * srcbin) +{ + GstElement *videosrc = NULL; + GstElement *vcaps = NULL; + GstElement *venc_caps = NULL; + GstElement *videoconvert = NULL, *videoscale = NULL; + gchar *vcodec = NULL; + GstElement *venc = NULL; + GstElement *vqueue = NULL; + GstRTSPMediaFactoryWFDPrivate *priv = NULL; + + priv = factory->priv; + + GST_INFO_OBJECT (factory, "picked ximagesrc as video source"); + + videosrc = gst_element_factory_make ("ximagesrc", "videosrc"); + if (NULL == videosrc) { + GST_ERROR_OBJECT (factory, "failed to create ximagesrc element"); + goto create_error; + } + + videoscale = gst_element_factory_make ("videoscale", "videoscale"); + if (NULL == videoscale) { + GST_ERROR_OBJECT (factory, "failed to create videoscale element"); + goto create_error; + } + + videoconvert = gst_element_factory_make ("videoconvert", "videoconvert"); + if (NULL == videoconvert) { + GST_ERROR_OBJECT (factory, "failed to create videoconvert element"); + goto create_error; + } + + /* create video caps element */ + vcaps = gst_element_factory_make ("capsfilter", "videocaps"); + if (NULL == vcaps) { + GST_ERROR_OBJECT (factory, "failed to create video capsilfter element"); + goto create_error; + } + + g_object_set (G_OBJECT (vcaps), "caps", + gst_caps_new_simple ("video/x-raw", + "width", G_TYPE_INT, priv->video_width, + "height", G_TYPE_INT, priv->video_height, + "framerate", GST_TYPE_FRACTION, priv->video_framerate, 1, NULL), + NULL); + + if (priv->video_codec == GST_WFD_VIDEO_H264) + vcodec = g_strdup ("x264enc"); + else { + GST_ERROR_OBJECT (factory, "Yet to support other than H264 format"); + g_free (vcodec); + goto create_error; + } + + venc = gst_element_factory_make (vcodec, "videoenc"); + g_free (vcodec); + + if (!venc) { + GST_ERROR_OBJECT (factory, "failed to create video encoder element"); + goto create_error; + } + + g_object_set (venc, "aud", 0, NULL); + g_object_set (venc, "byte-stream", 1, NULL); + g_object_set (venc, "bitrate", 512, NULL); + + venc_caps = gst_element_factory_make ("capsfilter", "venc_caps"); + if (NULL == venc_caps) { + GST_ERROR_OBJECT (factory, "failed to create video capsilfter element"); + goto create_error; + } + + g_object_set (G_OBJECT (venc_caps), "caps", + gst_caps_new_simple ("video/x-h264", + "profile", G_TYPE_STRING, "baseline", NULL), NULL); + + vqueue = gst_element_factory_make ("queue", "video-queue"); + if (!vqueue) { + GST_ERROR_OBJECT (factory, "failed to create video queue element"); + goto create_error; + } + + gst_bin_add_many (srcbin, videosrc, videoscale, videoconvert, vcaps, venc, + venc_caps, vqueue, NULL); + if (!gst_element_link_many (videosrc, videoscale, videoconvert, vcaps, venc, + venc_caps, vqueue, NULL)) { + GST_ERROR_OBJECT (factory, "Failed to link video src elements..."); + goto create_error; + } + + priv->video_queue = vqueue; + + return TRUE; + +create_error: + return FALSE; +} + +static gboolean +_rtsp_media_factory_wfd_create_xvcapture_bin (GstRTSPMediaFactoryWFD * factory, + GstBin * srcbin) +{ + GstElement *videosrc = NULL; + GstElement *vcaps = NULL; + gchar *vcodec = NULL; + GstElement *venc = NULL; + GstElement *vqueue = NULL; + GstRTSPMediaFactoryWFDPrivate *priv = NULL; + + priv = factory->priv; + + GST_INFO_OBJECT (factory, "picked xvimagesrc as video source"); + + videosrc = gst_element_factory_make ("xvimagesrc", "videosrc"); + if (NULL == videosrc) { + GST_ERROR_OBJECT (factory, "failed to create xvimagesrc element"); + goto create_error; + } + + /* create video caps element */ + vcaps = gst_element_factory_make ("capsfilter", "videocaps"); + if (NULL == vcaps) { + GST_ERROR_OBJECT (factory, "failed to create video capsilfter element"); + goto create_error; + } + + g_object_set (G_OBJECT (vcaps), "caps", + gst_caps_new_simple ("video/x-raw", + "width", G_TYPE_INT, priv->video_width, + "height", G_TYPE_INT, priv->video_height, + "format", G_TYPE_STRING, "SN12", + "framerate", GST_TYPE_FRACTION, priv->video_framerate, 1, NULL), + NULL); + + if (priv->video_codec == GST_WFD_VIDEO_H264) { + vcodec = g_strdup ("omxh264enc"); + } else { + GST_ERROR_OBJECT (factory, "Yet to support other than H264 format"); + goto create_error; + } + + venc = gst_element_factory_make (vcodec, "videoenc"); + if (!venc) { + GST_ERROR_OBJECT (factory, "failed to create video encoder element"); + goto create_error; + } + g_object_set (venc, "bitrate", priv->video_bitrate, NULL); + g_object_set (venc, "byte-stream", 1, NULL); + g_object_set (venc, "append-dci", 1, NULL); + g_object_set (venc, "idr-period", 120, NULL); + g_object_set (venc, "skip-inbuf", priv->video_enc_skip_inbuf_value, NULL); + + vqueue = gst_element_factory_make ("queue", "video-queue"); + if (!vqueue) { + GST_ERROR_OBJECT (factory, "failed to create video queue element"); + goto create_error; + } + + gst_bin_add_many (srcbin, videosrc, vcaps, venc, vqueue, NULL); + if (!gst_element_link_many (videosrc, vcaps, venc, vqueue, NULL)) { + GST_ERROR_OBJECT (factory, "Failed to link video src elements..."); + goto create_error; + } + + priv->video_queue = vqueue; + + return TRUE; + +create_error: + return FALSE; +} + +static GstElement * +_rtsp_media_factory_wfd_create_srcbin (GstRTSPMediaFactoryWFD * factory) +{ + GstRTSPMediaFactoryWFDPrivate *priv = NULL; + + GstBin *srcbin = NULL; + GstElement *mux = NULL; + GstElement *mux_queue = NULL; + GstElement *payload = NULL; + GstPad *srcpad = NULL; + GstPad *mux_vsinkpad = NULL; + GstPad *mux_asinkpad = NULL; + + priv = factory->priv; + + /* create source bin */ + srcbin = GST_BIN (gst_bin_new ("srcbin")); + if (!srcbin) { + GST_ERROR_OBJECT (factory, "failed to create source bin..."); + goto create_error; + } + + /* create video src element */ + switch (priv->videosrc_type) { + case GST_WFD_VSRC_XIMAGESRC: + if (!_rtsp_media_factory_wfd_create_xcapture_bin (factory, srcbin)) { + GST_ERROR_OBJECT (factory, "failed to create xcapture bin..."); + goto create_error; + } + break; + case GST_WFD_VSRC_XVIMAGESRC: + if (!_rtsp_media_factory_wfd_create_xvcapture_bin (factory, srcbin)) { + GST_ERROR_OBJECT (factory, "failed to create xvcapture bin..."); + goto create_error; + } + break; + case GST_WFD_VSRC_CAMERASRC: + if (!_rtsp_media_factory_wfd_create_camera_capture_bin (factory, srcbin)) { + GST_ERROR_OBJECT (factory, "failed to create camera capture bin..."); + goto create_error; + } + break; + case GST_WFD_VSRC_VIDEOTESTSRC: + if (!_rtsp_media_factory_wfd_create_videotest_bin (factory, srcbin)) { + GST_ERROR_OBJECT (factory, "failed to create videotestsrc bin..."); + goto create_error; + } + break; + default: + GST_ERROR_OBJECT (factory, "unknow mode selected..."); + goto create_error; + } + + mux = gst_element_factory_make ("mpegtsmux", "tsmux"); + if (!mux) { + GST_ERROR_OBJECT (factory, "failed to create muxer element"); + goto create_error; + } + + g_object_set (mux, "wfd-mode", TRUE, NULL); + + mux_queue = gst_element_factory_make ("queue", "muxer-queue"); + if (!mux_queue) { + GST_ERROR_OBJECT (factory, "failed to create muxer-queue element"); + goto create_error; + } + + g_object_set (mux_queue, "max-size-buffers", 20000, NULL); + + payload = gst_element_factory_make ("rtpmp2tpay", "pay0"); + if (!payload) { + GST_ERROR_OBJECT (factory, "failed to create payload element"); + goto create_error; + } + + g_object_set (payload, "pt", 33, NULL); + g_object_set (payload, "mtu", priv->mtu_size, NULL); + g_object_set (payload, "rtp-flush", (gboolean) TRUE, NULL); + + gst_bin_add_many (srcbin, mux, mux_queue, payload, NULL); + + if (!gst_element_link_many (mux, mux_queue, payload, NULL)) { + GST_ERROR_OBJECT (factory, "Failed to link muxer & payload..."); + goto create_error; + } + + /* request video sink pad from muxer, which has elementary pid 0x1011 */ + mux_vsinkpad = gst_element_get_request_pad (mux, "sink_4113"); + if (!mux_vsinkpad) { + GST_ERROR_OBJECT (factory, "Failed to get sink pad from muxer..."); + goto create_error; + } + + /* request srcpad from video queue */ + srcpad = gst_element_get_static_pad (priv->video_queue, "src"); + if (!srcpad) { + GST_ERROR_OBJECT (factory, "Failed to get srcpad from video queue..."); + goto create_error; + } + + if (gst_pad_link (srcpad, mux_vsinkpad) != GST_PAD_LINK_OK) { + GST_ERROR_OBJECT (factory, + "Failed to link video queue src pad & muxer video sink pad..."); + goto create_error; + } + + gst_object_unref (mux_vsinkpad); + gst_object_unref (srcpad); + srcpad = NULL; + + /* create audio source elements & add to pipeline */ + if (!_rtsp_media_factory_wfd_create_audio_capture_bin (factory, srcbin)) + goto create_error; + + /* request audio sink pad from muxer, which has elementary pid 0x1100 */ + mux_asinkpad = gst_element_get_request_pad (mux, "sink_4352"); + if (!mux_asinkpad) { + GST_ERROR_OBJECT (factory, "Failed to get sinkpad from muxer..."); + goto create_error; + } + + /* request srcpad from audio queue */ + srcpad = gst_element_get_static_pad (priv->audio_queue, "src"); + if (!srcpad) { + GST_ERROR_OBJECT (factory, "Failed to get srcpad from audio queue..."); + goto create_error; + } + + /* link audio queue's srcpad & muxer sink pad */ + if (gst_pad_link (srcpad, mux_asinkpad) != GST_PAD_LINK_OK) { + GST_ERROR_OBJECT (factory, + "Failed to link audio queue src pad & muxer audio sink pad..."); + goto create_error; + } + gst_object_unref (mux_asinkpad); + gst_object_unref (srcpad); + + if (priv->dump_ts) + { + GstPad *pad_probe = NULL; + pad_probe = gst_element_get_static_pad (mux, "src"); + + if (NULL == pad_probe) { + GST_INFO_OBJECT (factory, "pad for probe not created"); + } else { + GST_INFO_OBJECT (factory, "pad for probe SUCCESSFUL"); + } + gst_pad_add_probe (pad_probe, GST_PAD_PROBE_TYPE_BUFFER, + rtsp_media_wfd_dump_data, factory, NULL); + } + + GST_DEBUG_OBJECT (factory, "successfully created source bin..."); + + return GST_ELEMENT_CAST (srcbin); + +create_error: + GST_ERROR_OBJECT (factory, "Failed to create pipeline"); + return NULL; +} + +static GstElement * +rtsp_media_factory_wfd_create_element (GstRTSPMediaFactory * factory, + const GstRTSPUrl * url) +{ + GstRTSPMediaFactoryWFD *_factory = GST_RTSP_MEDIA_FACTORY_WFD_CAST (factory); + GstElement *element = NULL; + + GST_RTSP_MEDIA_FACTORY_WFD_LOCK (factory); + + element = _rtsp_media_factory_wfd_create_srcbin (_factory); + + GST_RTSP_MEDIA_FACTORY_WFD_UNLOCK (factory); + + return element; +} + +static GstRTSPMedia * +rtsp_media_factory_wfd_construct (GstRTSPMediaFactory * factory, + const GstRTSPUrl * url) +{ + GstRTSPMedia *media; + GstElement *element, *pipeline; + GstRTSPMediaFactoryClass *klass; + + klass = GST_RTSP_MEDIA_FACTORY_GET_CLASS (factory); + + if (!klass->create_pipeline) + goto no_create; + + element = gst_rtsp_media_factory_create_element (factory, url); + if (element == NULL) + goto no_element; + + /* create a new empty media */ + media = gst_rtsp_media_new (element); + + gst_rtsp_media_collect_streams (media); + + pipeline = klass->create_pipeline (factory, media); + if (pipeline == NULL) + goto no_pipeline; + + return media; + + /* ERRORS */ +no_create: + { + g_critical ("no create_pipeline function"); + return NULL; + } +no_element: + { + g_critical ("could not create element"); + return NULL; + } +no_pipeline: + { + g_critical ("can't create pipeline"); + g_object_unref (media); + return NULL; + } +} diff --git a/gst/rtsp-server/rtsp-media-factory-wfd.h b/gst/rtsp-server/rtsp-media-factory-wfd.h new file mode 100644 index 0000000..9ea23d6 --- /dev/null +++ b/gst/rtsp-server/rtsp-media-factory-wfd.h @@ -0,0 +1,126 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include "rtsp-media-factory.h" + +#ifndef __GST_RTSP_MEDIA_FACTORY_WFD_H__ +#define __GST_RTSP_MEDIA_FACTORY_WFD_H__ + +G_BEGIN_DECLS +/* types for the media factory */ +#define GST_TYPE_RTSP_MEDIA_FACTORY_WFD (gst_rtsp_media_factory_wfd_get_type ()) +#define GST_IS_RTSP_MEDIA_FACTORY_WFD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_WFD)) +#define GST_IS_RTSP_MEDIA_FACTORY_WFD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_MEDIA_FACTORY_WFD)) +#define GST_RTSP_MEDIA_FACTORY_WFD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_WFD, GstRTSPMediaFactoryWFDClass)) +#define GST_RTSP_MEDIA_FACTORY_WFD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_WFD, GstRTSPMediaFactoryWFD)) +#define GST_RTSP_MEDIA_FACTORY_WFD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_MEDIA_FACTORY_WFD, GstRTSPMediaFactoryWFDClass)) +#define GST_RTSP_MEDIA_FACTORY_WFD_CAST(obj) ((GstRTSPMediaFactoryWFD*)(obj)) +#define GST_RTSP_MEDIA_FACTORY_WFD_CLASS_CAST(klass) ((GstRTSPMediaFactoryWFDClass*)(klass)) + enum +{ + GST_WFD_VSRC_XIMAGESRC, + GST_WFD_VSRC_XVIMAGESRC, + GST_WFD_VSRC_CAMERASRC, + GST_WFD_VSRC_VIDEOTESTSRC +}; + +typedef struct _GstRTSPMediaFactoryWFD GstRTSPMediaFactoryWFD; +typedef struct _GstRTSPMediaFactoryWFDClass GstRTSPMediaFactoryWFDClass; +typedef struct _GstRTSPMediaFactoryWFDPrivate GstRTSPMediaFactoryWFDPrivate; + +/** + * GstRTSPMediaFactoryWFD: + * + * The definition and logic for constructing the pipeline for a media. The media + * can contain multiple streams like audio and video. + */ +struct _GstRTSPMediaFactoryWFD +{ + GstRTSPMediaFactory parent; + + /*< private > */ + GstRTSPMediaFactoryWFDPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPMediaFactoryWFDClass: + * @gen_key: convert @url to a key for caching shared #GstRTSPMedia objects. + * The default implementation of this function will use the complete URL + * including the query parameters to return a key. + * @create_element: Construct and return a #GstElement that is a #GstBin containing + * the elements to use for streaming the media. The bin should contain + * payloaders pay\%d for each stream. The default implementation of this + * function returns the bin created from the launch parameter. + * @construct: the vmethod that will be called when the factory has to create the + * #GstRTSPMedia for @url. The default implementation of this + * function calls create_element to retrieve an element and then looks for + * pay\%d to create the streams. + * @create_pipeline: create a new pipeline or re-use an existing one and + * add the #GstRTSPMedia's element created by @construct to the pipeline. + * @configure: configure the media created with @construct. The default + * implementation will configure the 'shared' property of the media. + * @media_constructed: signal emited when a media was constructed + * @media_configure: signal emited when a media should be configured + * + * The #GstRTSPMediaFactoryWFD class structure. + */ +struct _GstRTSPMediaFactoryWFDClass +{ + GstRTSPMediaFactoryClass parent_class; + + gchar *(*gen_key) (GstRTSPMediaFactoryWFD * factory, const GstRTSPUrl * url); + + GstElement *(*create_element) (GstRTSPMediaFactoryWFD * factory, + const GstRTSPUrl * url); + GstRTSPMedia *(*construct) (GstRTSPMediaFactoryWFD * factory, + const GstRTSPUrl * url); + GstElement *(*create_pipeline) (GstRTSPMediaFactoryWFD * factory, + GstRTSPMedia * media); + void (*configure) (GstRTSPMediaFactoryWFD * factory, GstRTSPMedia * media); + + /* signals */ + void (*media_constructed) (GstRTSPMediaFactoryWFD * factory, + GstRTSPMedia * media); + void (*media_configure) (GstRTSPMediaFactoryWFD * factory, + GstRTSPMedia * media); + + /*< private > */ + gpointer _gst_reserved[GST_PADDING_LARGE]; +}; + +GType gst_rtsp_media_factory_wfd_get_type (void); + +/* creating the factory */ +GstRTSPMediaFactoryWFD *gst_rtsp_media_factory_wfd_new (void); +GstElement *gst_rtsp_media_factory_wfd_create_element (GstRTSPMediaFactoryWFD * + factory, const GstRTSPUrl * url); + +void gst_rtsp_media_factory_wfd_set (GstRTSPMediaFactoryWFD * factory, + guint8 videosrc_type, gchar *audio_device, guint64 audio_latency_time, + guint64 audio_buffer_time, gboolean audio_do_timestamp, guint mtu_size); +void gst_rtsp_media_factory_wfd_set_dump_ts (GstRTSPMediaFactoryWFD * factory, + gboolean dump_ts); +void gst_rtsp_media_factory_wfd_set_negotiated_resolution (GstRTSPMediaFactory *factory, + guint32 width, guint32 height); + +G_END_DECLS +#endif /* __GST_RTSP_MEDIA_FACTORY_WFD_H__ */ diff --git a/gst/rtsp-server/rtsp-media-factory.c b/gst/rtsp-server/rtsp-media-factory.c new file mode 100644 index 0000000..7d85dcc --- /dev/null +++ b/gst/rtsp-server/rtsp-media-factory.c @@ -0,0 +1,1147 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-media-factory + * @short_description: A factory for media pipelines + * @see_also: #GstRTSPMountPoints, #GstRTSPMedia + * + * The #GstRTSPMediaFactory is responsible for creating or recycling + * #GstRTSPMedia objects based on the passed URL. + * + * The default implementation of the object can create #GstRTSPMedia objects + * containing a pipeline created from a launch description set with + * gst_rtsp_media_factory_set_launch(). + * + * Media from a factory can be shared by setting the shared flag with + * gst_rtsp_media_factory_set_shared(). When a factory is shared, + * gst_rtsp_media_factory_construct() will return the same #GstRTSPMedia when + * the url matches. + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include "rtsp-media-factory.h" + +#define GST_RTSP_MEDIA_FACTORY_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_MEDIA_FACTORY, GstRTSPMediaFactoryPrivate)) + +#define GST_RTSP_MEDIA_FACTORY_GET_LOCK(f) (&(GST_RTSP_MEDIA_FACTORY_CAST(f)->priv->lock)) +#define GST_RTSP_MEDIA_FACTORY_LOCK(f) (g_mutex_lock(GST_RTSP_MEDIA_FACTORY_GET_LOCK(f))) +#define GST_RTSP_MEDIA_FACTORY_UNLOCK(f) (g_mutex_unlock(GST_RTSP_MEDIA_FACTORY_GET_LOCK(f))) + +struct _GstRTSPMediaFactoryPrivate +{ + GMutex lock; /* protects everything but medias */ + GstRTSPPermissions *permissions; + gchar *launch; + gboolean shared; + GstRTSPSuspendMode suspend_mode; + gboolean eos_shutdown; + GstRTSPProfile profiles; + GstRTSPLowerTrans protocols; + guint buffer_size; + GstRTSPAddressPool *pool; + + GMutex medias_lock; + GHashTable *medias; /* protected by medias_lock */ +}; + +#define DEFAULT_LAUNCH NULL +#define DEFAULT_SHARED FALSE +#define DEFAULT_SUSPEND_MODE GST_RTSP_SUSPEND_MODE_NONE +#define DEFAULT_EOS_SHUTDOWN FALSE +#define DEFAULT_PROFILES GST_RTSP_PROFILE_AVP +#define DEFAULT_PROTOCOLS GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_UDP_MCAST | \ + GST_RTSP_LOWER_TRANS_TCP +#define DEFAULT_BUFFER_SIZE 0x80000 + +enum +{ + PROP_0, + PROP_LAUNCH, + PROP_SHARED, + PROP_SUSPEND_MODE, + PROP_EOS_SHUTDOWN, + PROP_PROFILES, + PROP_PROTOCOLS, + PROP_BUFFER_SIZE, + PROP_LAST +}; + +enum +{ + SIGNAL_MEDIA_CONSTRUCTED, + SIGNAL_MEDIA_CONFIGURE, + SIGNAL_LAST +}; + +GST_DEBUG_CATEGORY_STATIC (rtsp_media_debug); +#define GST_CAT_DEFAULT rtsp_media_debug + +static guint gst_rtsp_media_factory_signals[SIGNAL_LAST] = { 0 }; + +static void gst_rtsp_media_factory_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec); +static void gst_rtsp_media_factory_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec); +static void gst_rtsp_media_factory_finalize (GObject * obj); + +static gchar *default_gen_key (GstRTSPMediaFactory * factory, + const GstRTSPUrl * url); +static GstElement *default_create_element (GstRTSPMediaFactory * factory, + const GstRTSPUrl * url); +static GstRTSPMedia *default_construct (GstRTSPMediaFactory * factory, + const GstRTSPUrl * url); +static void default_configure (GstRTSPMediaFactory * factory, + GstRTSPMedia * media); +static GstElement *default_create_pipeline (GstRTSPMediaFactory * factory, + GstRTSPMedia * media); + +G_DEFINE_TYPE (GstRTSPMediaFactory, gst_rtsp_media_factory, G_TYPE_OBJECT); + +static void +gst_rtsp_media_factory_class_init (GstRTSPMediaFactoryClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPMediaFactoryPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->get_property = gst_rtsp_media_factory_get_property; + gobject_class->set_property = gst_rtsp_media_factory_set_property; + gobject_class->finalize = gst_rtsp_media_factory_finalize; + + /** + * GstRTSPMediaFactory::launch: + * + * The gst_parse_launch() line to use for constructing the pipeline in the + * default prepare vmethod. + * + * The pipeline description should return a GstBin as the toplevel element + * which can be accomplished by enclosing the dscription with brackets '(' + * ')'. + * + * The description should return a pipeline with payloaders named pay0, pay1, + * etc.. Each of the payloaders will result in a stream. + * + * Support for dynamic payloaders can be accomplished by adding payloaders + * named dynpay0, dynpay1, etc.. + */ + g_object_class_install_property (gobject_class, PROP_LAUNCH, + g_param_spec_string ("launch", "Launch", + "A launch description of the pipeline", DEFAULT_LAUNCH, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_SHARED, + g_param_spec_boolean ("shared", "Shared", + "If media from this factory is shared", DEFAULT_SHARED, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_SUSPEND_MODE, + g_param_spec_enum ("suspend-mode", "Suspend Mode", + "Control how media will be suspended", GST_TYPE_RTSP_SUSPEND_MODE, + DEFAULT_SUSPEND_MODE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_EOS_SHUTDOWN, + g_param_spec_boolean ("eos-shutdown", "EOS Shutdown", + "Send EOS down the pipeline before shutting down", + DEFAULT_EOS_SHUTDOWN, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_PROFILES, + g_param_spec_flags ("profiles", "Profiles", + "Allowed transfer profiles", GST_TYPE_RTSP_PROFILE, + DEFAULT_PROFILES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_PROTOCOLS, + g_param_spec_flags ("protocols", "Protocols", + "Allowed lower transport protocols", GST_TYPE_RTSP_LOWER_TRANS, + DEFAULT_PROTOCOLS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_BUFFER_SIZE, + g_param_spec_uint ("buffer-size", "Buffer Size", + "The kernel UDP buffer size to use", 0, G_MAXUINT, + DEFAULT_BUFFER_SIZE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_rtsp_media_factory_signals[SIGNAL_MEDIA_CONSTRUCTED] = + g_signal_new ("media-constructed", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPMediaFactoryClass, + media_constructed), NULL, NULL, g_cclosure_marshal_generic, + G_TYPE_NONE, 1, GST_TYPE_RTSP_MEDIA); + + gst_rtsp_media_factory_signals[SIGNAL_MEDIA_CONFIGURE] = + g_signal_new ("media-configure", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPMediaFactoryClass, + media_configure), NULL, NULL, g_cclosure_marshal_generic, + G_TYPE_NONE, 1, GST_TYPE_RTSP_MEDIA); + + klass->gen_key = default_gen_key; + klass->create_element = default_create_element; + klass->construct = default_construct; + klass->configure = default_configure; + klass->create_pipeline = default_create_pipeline; + + GST_DEBUG_CATEGORY_INIT (rtsp_media_debug, "rtspmediafactory", 0, + "GstRTSPMediaFactory"); +} + +static void +gst_rtsp_media_factory_init (GstRTSPMediaFactory * factory) +{ + GstRTSPMediaFactoryPrivate *priv = + GST_RTSP_MEDIA_FACTORY_GET_PRIVATE (factory); + factory->priv = priv; + + priv->launch = g_strdup (DEFAULT_LAUNCH); + priv->shared = DEFAULT_SHARED; + priv->suspend_mode = DEFAULT_SUSPEND_MODE; + priv->eos_shutdown = DEFAULT_EOS_SHUTDOWN; + priv->profiles = DEFAULT_PROFILES; + priv->protocols = DEFAULT_PROTOCOLS; + priv->buffer_size = DEFAULT_BUFFER_SIZE; + + g_mutex_init (&priv->lock); + g_mutex_init (&priv->medias_lock); + priv->medias = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, g_object_unref); +} + +static void +gst_rtsp_media_factory_finalize (GObject * obj) +{ + GstRTSPMediaFactory *factory = GST_RTSP_MEDIA_FACTORY (obj); + GstRTSPMediaFactoryPrivate *priv = factory->priv; + + if (priv->permissions) + gst_rtsp_permissions_unref (priv->permissions); + g_hash_table_unref (priv->medias); + g_mutex_clear (&priv->medias_lock); + g_free (priv->launch); + g_mutex_clear (&priv->lock); + if (priv->pool) + g_object_unref (priv->pool); + + G_OBJECT_CLASS (gst_rtsp_media_factory_parent_class)->finalize (obj); +} + +static void +gst_rtsp_media_factory_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + GstRTSPMediaFactory *factory = GST_RTSP_MEDIA_FACTORY (object); + + switch (propid) { + case PROP_LAUNCH: + g_value_take_string (value, gst_rtsp_media_factory_get_launch (factory)); + break; + case PROP_SHARED: + g_value_set_boolean (value, gst_rtsp_media_factory_is_shared (factory)); + break; + case PROP_SUSPEND_MODE: + g_value_set_enum (value, + gst_rtsp_media_factory_get_suspend_mode (factory)); + break; + case PROP_EOS_SHUTDOWN: + g_value_set_boolean (value, + gst_rtsp_media_factory_is_eos_shutdown (factory)); + break; + case PROP_PROFILES: + g_value_set_flags (value, gst_rtsp_media_factory_get_profiles (factory)); + break; + case PROP_PROTOCOLS: + g_value_set_flags (value, gst_rtsp_media_factory_get_protocols (factory)); + break; + case PROP_BUFFER_SIZE: + g_value_set_uint (value, + gst_rtsp_media_factory_get_buffer_size (factory)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_media_factory_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + GstRTSPMediaFactory *factory = GST_RTSP_MEDIA_FACTORY (object); + + switch (propid) { + case PROP_LAUNCH: + gst_rtsp_media_factory_set_launch (factory, g_value_get_string (value)); + break; + case PROP_SHARED: + gst_rtsp_media_factory_set_shared (factory, g_value_get_boolean (value)); + break; + case PROP_SUSPEND_MODE: + gst_rtsp_media_factory_set_suspend_mode (factory, + g_value_get_enum (value)); + break; + case PROP_EOS_SHUTDOWN: + gst_rtsp_media_factory_set_eos_shutdown (factory, + g_value_get_boolean (value)); + break; + case PROP_PROFILES: + gst_rtsp_media_factory_set_profiles (factory, g_value_get_flags (value)); + break; + case PROP_PROTOCOLS: + gst_rtsp_media_factory_set_protocols (factory, g_value_get_flags (value)); + break; + case PROP_BUFFER_SIZE: + gst_rtsp_media_factory_set_buffer_size (factory, + g_value_get_uint (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +/** + * gst_rtsp_media_factory_new: + * + * Create a new #GstRTSPMediaFactory instance. + * + * Returns: (transfer full): a new #GstRTSPMediaFactory object. + */ +GstRTSPMediaFactory * +gst_rtsp_media_factory_new (void) +{ + GstRTSPMediaFactory *result; + + result = g_object_new (GST_TYPE_RTSP_MEDIA_FACTORY, NULL); + + return result; +} + +/** + * gst_rtsp_media_factory_set_permissions: + * @factory: a #GstRTSPMediaFactory + * @permissions: (transfer none): a #GstRTSPPermissions + * + * Set @permissions on @factory. + */ +void +gst_rtsp_media_factory_set_permissions (GstRTSPMediaFactory * factory, + GstRTSPPermissions * permissions) +{ + GstRTSPMediaFactoryPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory)); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + if (priv->permissions) + gst_rtsp_permissions_unref (priv->permissions); + if ((priv->permissions = permissions)) + gst_rtsp_permissions_ref (permissions); + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); +} + +/** + * gst_rtsp_media_factory_get_permissions: + * @factory: a #GstRTSPMediaFactory + * + * Get the permissions object from @factory. + * + * Returns: (transfer full): a #GstRTSPPermissions object, unref after usage. + */ +GstRTSPPermissions * +gst_rtsp_media_factory_get_permissions (GstRTSPMediaFactory * factory) +{ + GstRTSPMediaFactoryPrivate *priv; + GstRTSPPermissions *result; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), NULL); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + if ((result = priv->permissions)) + gst_rtsp_permissions_ref (result); + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + return result; +} + +/** + * gst_rtsp_media_factory_add_role: + * @factory: a #GstRTSPMediaFactory + * @role: a role + * @fieldname: the first field name + * @...: additional arguments + * + * A convenience method to add @role with @fieldname and additional arguments to + * the permissions of @factory. If @factory had no permissions, new permissions + * will be created and the role will be added to it. + */ +void +gst_rtsp_media_factory_add_role (GstRTSPMediaFactory * factory, + const gchar * role, const gchar * fieldname, ...) +{ + GstRTSPMediaFactoryPrivate *priv; + va_list var_args; + + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory)); + g_return_if_fail (role != NULL); + g_return_if_fail (fieldname != NULL); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + if (priv->permissions == NULL) + priv->permissions = gst_rtsp_permissions_new (); + + va_start (var_args, fieldname); + gst_rtsp_permissions_add_role_valist (priv->permissions, role, fieldname, + var_args); + va_end (var_args); + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); +} + +/** + * gst_rtsp_media_factory_set_launch: + * @factory: a #GstRTSPMediaFactory + * @launch: the launch description + * + * + * The gst_parse_launch() line to use for constructing the pipeline in the + * default prepare vmethod. + * + * The pipeline description should return a GstBin as the toplevel element + * which can be accomplished by enclosing the dscription with brackets '(' + * ')'. + * + * The description should return a pipeline with payloaders named pay0, pay1, + * etc.. Each of the payloaders will result in a stream. + */ +void +gst_rtsp_media_factory_set_launch (GstRTSPMediaFactory * factory, + const gchar * launch) +{ + GstRTSPMediaFactoryPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory)); + g_return_if_fail (launch != NULL); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + g_free (priv->launch); + priv->launch = g_strdup (launch); + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); +} + +/** + * gst_rtsp_media_factory_get_launch: + * @factory: a #GstRTSPMediaFactory + * + * Get the gst_parse_launch() pipeline description that will be used in the + * default prepare vmethod. + * + * Returns: (transfer full): the configured launch description. g_free() after + * usage. + */ +gchar * +gst_rtsp_media_factory_get_launch (GstRTSPMediaFactory * factory) +{ + GstRTSPMediaFactoryPrivate *priv; + gchar *result; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), NULL); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + result = g_strdup (priv->launch); + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + return result; +} + +/** + * gst_rtsp_media_factory_set_suspend_mode: + * @factory: a #GstRTSPMediaFactory + * @mode: the new #GstRTSPSuspendMode + * + * Configure how media created from this factory will be suspended. + */ +void +gst_rtsp_media_factory_set_suspend_mode (GstRTSPMediaFactory * factory, + GstRTSPSuspendMode mode) +{ + GstRTSPMediaFactoryPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory)); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + priv->suspend_mode = mode; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); +} + +/** + * gst_rtsp_media_factory_get_suspend_mode: + * @factory: a #GstRTSPMediaFactory + * + * Get how media created from this factory will be suspended. + * + * Returns: a #GstRTSPSuspendMode. + */ +GstRTSPSuspendMode +gst_rtsp_media_factory_get_suspend_mode (GstRTSPMediaFactory * factory) +{ + GstRTSPMediaFactoryPrivate *priv; + GstRTSPSuspendMode result; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), + GST_RTSP_SUSPEND_MODE_NONE); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + result = priv->suspend_mode; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + return result; +} + +/** + * gst_rtsp_media_factory_set_shared: + * @factory: a #GstRTSPMediaFactory + * @shared: the new value + * + * Configure if media created from this factory can be shared between clients. + */ +void +gst_rtsp_media_factory_set_shared (GstRTSPMediaFactory * factory, + gboolean shared) +{ + GstRTSPMediaFactoryPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory)); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + priv->shared = shared; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); +} + +/** + * gst_rtsp_media_factory_is_shared: + * @factory: a #GstRTSPMediaFactory + * + * Get if media created from this factory can be shared between clients. + * + * Returns: %TRUE if the media will be shared between clients. + */ +gboolean +gst_rtsp_media_factory_is_shared (GstRTSPMediaFactory * factory) +{ + GstRTSPMediaFactoryPrivate *priv; + gboolean result; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), FALSE); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + result = priv->shared; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + return result; +} + +/** + * gst_rtsp_media_factory_set_eos_shutdown: + * @factory: a #GstRTSPMediaFactory + * @eos_shutdown: the new value + * + * Configure if media created from this factory will have an EOS sent to the + * pipeline before shutdown. + */ +void +gst_rtsp_media_factory_set_eos_shutdown (GstRTSPMediaFactory * factory, + gboolean eos_shutdown) +{ + GstRTSPMediaFactoryPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory)); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + priv->eos_shutdown = eos_shutdown; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); +} + +/** + * gst_rtsp_media_factory_is_eos_shutdown: + * @factory: a #GstRTSPMediaFactory + * + * Get if media created from this factory will have an EOS event sent to the + * pipeline before shutdown. + * + * Returns: %TRUE if the media will receive EOS before shutdown. + */ +gboolean +gst_rtsp_media_factory_is_eos_shutdown (GstRTSPMediaFactory * factory) +{ + GstRTSPMediaFactoryPrivate *priv; + gboolean result; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), FALSE); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + result = priv->eos_shutdown; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + return result; +} + +/** + * gst_rtsp_media_factory_set_buffer_size: + * @factory: a #GstRTSPMedia + * @size: the new value + * + * Set the kernel UDP buffer size. + */ +void +gst_rtsp_media_factory_set_buffer_size (GstRTSPMediaFactory * factory, + guint size) +{ + GstRTSPMediaFactoryPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory)); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + priv->buffer_size = size; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); +} + +/** + * gst_rtsp_media_factory_get_buffer_size: + * @factory: a #GstRTSPMedia + * + * Get the kernel UDP buffer size. + * + * Returns: the kernel UDP buffer size. + */ +guint +gst_rtsp_media_factory_get_buffer_size (GstRTSPMediaFactory * factory) +{ + GstRTSPMediaFactoryPrivate *priv; + guint result; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), 0); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + result = priv->buffer_size; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + return result; +} + +/** + * gst_rtsp_media_factory_set_address_pool: + * @factory: a #GstRTSPMediaFactory + * @pool: (transfer none): a #GstRTSPAddressPool + * + * configure @pool to be used as the address pool of @factory. + */ +void +gst_rtsp_media_factory_set_address_pool (GstRTSPMediaFactory * factory, + GstRTSPAddressPool * pool) +{ + GstRTSPMediaFactoryPrivate *priv; + GstRTSPAddressPool *old; + + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory)); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + if ((old = priv->pool) != pool) + priv->pool = pool ? g_object_ref (pool) : NULL; + else + old = NULL; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + if (old) + g_object_unref (old); +} + +/** + * gst_rtsp_media_factory_get_address_pool: + * @factory: a #GstRTSPMediaFactory + * + * Get the #GstRTSPAddressPool used as the address pool of @factory. + * + * Returns: (transfer full): the #GstRTSPAddressPool of @factory. g_object_unref() after + * usage. + */ +GstRTSPAddressPool * +gst_rtsp_media_factory_get_address_pool (GstRTSPMediaFactory * factory) +{ + GstRTSPMediaFactoryPrivate *priv; + GstRTSPAddressPool *result; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), NULL); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + if ((result = priv->pool)) + g_object_ref (result); + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + return result; +} + +/** + * gst_rtsp_media_factory_set_profiles: + * @factory: a #GstRTSPMediaFactory + * @profiles: the new flags + * + * Configure the allowed profiles for @factory. + */ +void +gst_rtsp_media_factory_set_profiles (GstRTSPMediaFactory * factory, + GstRTSPProfile profiles) +{ + GstRTSPMediaFactoryPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory)); + + priv = factory->priv; + + GST_DEBUG_OBJECT (factory, "profiles %d", profiles); + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + priv->profiles = profiles; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); +} + +/** + * gst_rtsp_media_factory_get_profiles: + * @factory: a #GstRTSPMediaFactory + * + * Get the allowed profiles of @factory. + * + * Returns: a #GstRTSPProfile + */ +GstRTSPProfile +gst_rtsp_media_factory_get_profiles (GstRTSPMediaFactory * factory) +{ + GstRTSPMediaFactoryPrivate *priv; + GstRTSPProfile res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), + GST_RTSP_PROFILE_UNKNOWN); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + res = priv->profiles; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + return res; +} + +/** + * gst_rtsp_media_factory_set_protocols: + * @factory: a #GstRTSPMediaFactory + * @protocols: the new flags + * + * Configure the allowed lower transport for @factory. + */ +void +gst_rtsp_media_factory_set_protocols (GstRTSPMediaFactory * factory, + GstRTSPLowerTrans protocols) +{ + GstRTSPMediaFactoryPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory)); + + priv = factory->priv; + + GST_DEBUG_OBJECT (factory, "protocols %d", protocols); + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + priv->protocols = protocols; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); +} + +/** + * gst_rtsp_media_factory_get_protocols: + * @factory: a #GstRTSPMediaFactory + * + * Get the allowed protocols of @factory. + * + * Returns: a #GstRTSPLowerTrans + */ +GstRTSPLowerTrans +gst_rtsp_media_factory_get_protocols (GstRTSPMediaFactory * factory) +{ + GstRTSPMediaFactoryPrivate *priv; + GstRTSPLowerTrans res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), + GST_RTSP_LOWER_TRANS_UNKNOWN); + + priv = factory->priv; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + res = priv->protocols; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + return res; +} + +static gboolean +compare_media (gpointer key, GstRTSPMedia * media1, GstRTSPMedia * media2) +{ + return (media1 == media2); +} + +static void +media_unprepared (GstRTSPMedia * media, GWeakRef * ref) +{ + GstRTSPMediaFactory *factory = g_weak_ref_get (ref); + GstRTSPMediaFactoryPrivate *priv; + + if (!factory) + return; + + priv = factory->priv;; + + g_mutex_lock (&priv->medias_lock); + g_hash_table_foreach_remove (priv->medias, (GHRFunc) compare_media, media); + g_mutex_unlock (&priv->medias_lock); + + g_object_unref (factory); +} + +static GWeakRef * +weak_ref_new (gpointer obj) +{ + GWeakRef *ref = g_slice_new (GWeakRef); + + g_weak_ref_init (ref, obj); + return ref; +} + +static void +weak_ref_free (GWeakRef * ref) +{ + g_weak_ref_clear (ref); + g_slice_free (GWeakRef, ref); +} + +/** + * gst_rtsp_media_factory_construct: + * @factory: a #GstRTSPMediaFactory + * @url: the url used + * + * Construct the media object and create its streams. Implementations + * should create the needed gstreamer elements and add them to the result + * object. No state changes should be performed on them yet. + * + * One or more GstRTSPStream objects should be created from the result + * with gst_rtsp_media_create_stream (). + * + * After the media is constructed, it can be configured and then prepared + * with gst_rtsp_media_prepare (). + * + * Returns: (transfer full): a new #GstRTSPMedia if the media could be prepared. + */ +GstRTSPMedia * +gst_rtsp_media_factory_construct (GstRTSPMediaFactory * factory, + const GstRTSPUrl * url) +{ + GstRTSPMediaFactoryPrivate *priv; + gchar *key; + GstRTSPMedia *media; + GstRTSPMediaFactoryClass *klass; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), NULL); + g_return_val_if_fail (url != NULL, NULL); + + priv = factory->priv;; + klass = GST_RTSP_MEDIA_FACTORY_GET_CLASS (factory); + + /* convert the url to a key for the hashtable. NULL return or a NULL function + * will not cache anything for this factory. */ + if (klass->gen_key) + key = klass->gen_key (factory, url); + else + key = NULL; + + g_mutex_lock (&priv->medias_lock); + if (key) { + /* we have a key, see if we find a cached media */ + media = g_hash_table_lookup (priv->medias, key); + if (media) + g_object_ref (media); + } else + media = NULL; + + if (media == NULL) { + /* nothing cached found, try to create one */ + if (klass->construct) { + media = klass->construct (factory, url); + if (media) + g_signal_emit (factory, + gst_rtsp_media_factory_signals[SIGNAL_MEDIA_CONSTRUCTED], 0, media, + NULL); + } else + media = NULL; + + if (media) { + /* configure the media */ + if (klass->configure) + klass->configure (factory, media); + + g_signal_emit (factory, + gst_rtsp_media_factory_signals[SIGNAL_MEDIA_CONFIGURE], 0, media, + NULL); + + /* check if we can cache this media */ + if (gst_rtsp_media_is_shared (media)) { + /* insert in the hashtable, takes ownership of the key */ + g_object_ref (media); + g_hash_table_insert (priv->medias, key, media); + key = NULL; + } + if (!gst_rtsp_media_is_reusable (media)) { + /* when not reusable, connect to the unprepare signal to remove the item + * from our cache when it gets unprepared */ + g_signal_connect_data (media, "unprepared", + (GCallback) media_unprepared, weak_ref_new (factory), + (GClosureNotify) weak_ref_free, 0); + } + } + } + g_mutex_unlock (&priv->medias_lock); + + if (key) + g_free (key); + + GST_INFO ("constructed media %p for url %s", media, url->abspath); + + return media; +} + +static gchar * +default_gen_key (GstRTSPMediaFactory * factory, const GstRTSPUrl * url) +{ + gchar *result; + const gchar *pre_query; + const gchar *query; + + pre_query = url->query ? "?" : ""; + query = url->query ? url->query : ""; + + result = + g_strdup_printf ("%u%s%s%s", url->port, url->abspath, pre_query, query); + + return result; +} + +static GstElement * +default_create_element (GstRTSPMediaFactory * factory, const GstRTSPUrl * url) +{ + GstRTSPMediaFactoryPrivate *priv = factory->priv; + GstElement *element; + GError *error = NULL; + + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + /* we need a parse syntax */ + if (priv->launch == NULL) + goto no_launch; + + /* parse the user provided launch line */ + element = gst_parse_launch (priv->launch, &error); + if (element == NULL) + goto parse_error; + + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + if (error != NULL) { + /* a recoverable error was encountered */ + GST_WARNING ("recoverable parsing error: %s", error->message); + g_error_free (error); + } + return element; + + /* ERRORS */ +no_launch: + { + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + g_critical ("no launch line specified"); + return NULL; + } +parse_error: + { + g_critical ("could not parse launch syntax (%s): %s", priv->launch, + (error ? error->message : "unknown reason")); + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + if (error) + g_error_free (error); + return NULL; + } +} + +static GstRTSPMedia * +default_construct (GstRTSPMediaFactory * factory, const GstRTSPUrl * url) +{ + GstRTSPMedia *media; + GstElement *element, *pipeline; + GstRTSPMediaFactoryClass *klass; + + klass = GST_RTSP_MEDIA_FACTORY_GET_CLASS (factory); + + if (!klass->create_pipeline) + goto no_create; + + element = gst_rtsp_media_factory_create_element (factory, url); + if (element == NULL) + goto no_element; + + /* create a new empty media */ + media = gst_rtsp_media_new (element); + + gst_rtsp_media_collect_streams (media); + + pipeline = klass->create_pipeline (factory, media); + if (pipeline == NULL) + goto no_pipeline; + + return media; + + /* ERRORS */ +no_create: + { + g_critical ("no create_pipeline function"); + return NULL; + } +no_element: + { + g_critical ("could not create element"); + return NULL; + } +no_pipeline: + { + g_critical ("can't create pipeline"); + g_object_unref (media); + return NULL; + } +} + +static GstElement * +default_create_pipeline (GstRTSPMediaFactory * factory, GstRTSPMedia * media) +{ + GstElement *pipeline; + + pipeline = gst_pipeline_new ("media-pipeline"); + gst_rtsp_media_take_pipeline (media, GST_PIPELINE_CAST (pipeline)); + + return pipeline; +} + +static void +default_configure (GstRTSPMediaFactory * factory, GstRTSPMedia * media) +{ + GstRTSPMediaFactoryPrivate *priv = factory->priv; + gboolean shared, eos_shutdown; + guint size; + GstRTSPSuspendMode suspend_mode; + GstRTSPProfile profiles; + GstRTSPLowerTrans protocols; + GstRTSPAddressPool *pool; + GstRTSPPermissions *perms; + + /* configure the sharedness */ + GST_RTSP_MEDIA_FACTORY_LOCK (factory); + suspend_mode = priv->suspend_mode; + shared = priv->shared; + eos_shutdown = priv->eos_shutdown; + size = priv->buffer_size; + profiles = priv->profiles; + protocols = priv->protocols; + GST_RTSP_MEDIA_FACTORY_UNLOCK (factory); + + gst_rtsp_media_set_suspend_mode (media, suspend_mode); + gst_rtsp_media_set_shared (media, shared); + gst_rtsp_media_set_eos_shutdown (media, eos_shutdown); + gst_rtsp_media_set_buffer_size (media, size); + gst_rtsp_media_set_profiles (media, profiles); + gst_rtsp_media_set_protocols (media, protocols); + + if ((pool = gst_rtsp_media_factory_get_address_pool (factory))) { + gst_rtsp_media_set_address_pool (media, pool); + g_object_unref (pool); + } + if ((perms = gst_rtsp_media_factory_get_permissions (factory))) { + gst_rtsp_media_set_permissions (media, perms); + gst_rtsp_permissions_unref (perms); + } +} + +/** + * gst_rtsp_media_factory_create_element: + * @factory: a #GstRTSPMediaFactory + * @url: the url used + * + * Construct and return a #GstElement that is a #GstBin containing + * the elements to use for streaming the media. + * + * The bin should contain payloaders pay\%d for each stream. The default + * implementation of this function returns the bin created from the + * launch parameter. + * + * Returns: (transfer floating): a new #GstElement. + */ +GstElement * +gst_rtsp_media_factory_create_element (GstRTSPMediaFactory * factory, + const GstRTSPUrl * url) +{ + GstRTSPMediaFactoryClass *klass; + GstElement *result; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), NULL); + g_return_val_if_fail (url != NULL, NULL); + + klass = GST_RTSP_MEDIA_FACTORY_GET_CLASS (factory); + + if (klass->create_element) + result = klass->create_element (factory, url); + else + result = NULL; + + return result; +} diff --git a/gst/rtsp-server/rtsp-media-factory.h b/gst/rtsp-server/rtsp-media-factory.h new file mode 100644 index 0000000..bb6aec3 --- /dev/null +++ b/gst/rtsp-server/rtsp-media-factory.h @@ -0,0 +1,154 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include + +#include "rtsp-media.h" +#include "rtsp-permissions.h" +#include "rtsp-address-pool.h" + +#ifndef __GST_RTSP_MEDIA_FACTORY_H__ +#define __GST_RTSP_MEDIA_FACTORY_H__ + +G_BEGIN_DECLS + +/* types for the media factory */ +#define GST_TYPE_RTSP_MEDIA_FACTORY (gst_rtsp_media_factory_get_type ()) +#define GST_IS_RTSP_MEDIA_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_MEDIA_FACTORY)) +#define GST_IS_RTSP_MEDIA_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_MEDIA_FACTORY)) +#define GST_RTSP_MEDIA_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_MEDIA_FACTORY, GstRTSPMediaFactoryClass)) +#define GST_RTSP_MEDIA_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_MEDIA_FACTORY, GstRTSPMediaFactory)) +#define GST_RTSP_MEDIA_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_MEDIA_FACTORY, GstRTSPMediaFactoryClass)) +#define GST_RTSP_MEDIA_FACTORY_CAST(obj) ((GstRTSPMediaFactory*)(obj)) +#define GST_RTSP_MEDIA_FACTORY_CLASS_CAST(klass) ((GstRTSPMediaFactoryClass*)(klass)) + +typedef struct _GstRTSPMediaFactory GstRTSPMediaFactory; +typedef struct _GstRTSPMediaFactoryClass GstRTSPMediaFactoryClass; +typedef struct _GstRTSPMediaFactoryPrivate GstRTSPMediaFactoryPrivate; + +/** + * GstRTSPMediaFactory: + * + * The definition and logic for constructing the pipeline for a media. The media + * can contain multiple streams like audio and video. + */ +struct _GstRTSPMediaFactory { + GObject parent; + + /*< private >*/ + GstRTSPMediaFactoryPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPMediaFactoryClass: + * @gen_key: convert @url to a key for caching shared #GstRTSPMedia objects. + * The default implementation of this function will use the complete URL + * including the query parameters to return a key. + * @create_element: Construct and return a #GstElement that is a #GstBin containing + * the elements to use for streaming the media. The bin should contain + * payloaders pay\%d for each stream. The default implementation of this + * function returns the bin created from the launch parameter. + * @construct: the vmethod that will be called when the factory has to create the + * #GstRTSPMedia for @url. The default implementation of this + * function calls create_element to retrieve an element and then looks for + * pay\%d to create the streams. + * @create_pipeline: create a new pipeline or re-use an existing one and + * add the #GstRTSPMedia's element created by @construct to the pipeline. + * @configure: configure the media created with @construct. The default + * implementation will configure the 'shared' property of the media. + * @media_constructed: signal emited when a media was constructed + * @media_configure: signal emited when a media should be configured + * + * The #GstRTSPMediaFactory class structure. + */ +struct _GstRTSPMediaFactoryClass { + GObjectClass parent_class; + + gchar * (*gen_key) (GstRTSPMediaFactory *factory, const GstRTSPUrl *url); + + GstElement * (*create_element) (GstRTSPMediaFactory *factory, const GstRTSPUrl *url); + GstRTSPMedia * (*construct) (GstRTSPMediaFactory *factory, const GstRTSPUrl *url); + GstElement * (*create_pipeline) (GstRTSPMediaFactory *factory, GstRTSPMedia *media); + void (*configure) (GstRTSPMediaFactory *factory, GstRTSPMedia *media); + + /* signals */ + void (*media_constructed) (GstRTSPMediaFactory *factory, GstRTSPMedia *media); + void (*media_configure) (GstRTSPMediaFactory *factory, GstRTSPMedia *media); + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING_LARGE]; +}; + +GType gst_rtsp_media_factory_get_type (void); + +/* creating the factory */ +GstRTSPMediaFactory * gst_rtsp_media_factory_new (void); + +/* configuring the factory */ +void gst_rtsp_media_factory_set_launch (GstRTSPMediaFactory *factory, + const gchar *launch); +gchar * gst_rtsp_media_factory_get_launch (GstRTSPMediaFactory *factory); + +void gst_rtsp_media_factory_set_permissions (GstRTSPMediaFactory *factory, + GstRTSPPermissions *permissions); +GstRTSPPermissions * gst_rtsp_media_factory_get_permissions (GstRTSPMediaFactory *factory); +void gst_rtsp_media_factory_add_role (GstRTSPMediaFactory *factory, + const gchar *role, + const gchar *fieldname, ...); + +void gst_rtsp_media_factory_set_shared (GstRTSPMediaFactory *factory, + gboolean shared); +gboolean gst_rtsp_media_factory_is_shared (GstRTSPMediaFactory *factory); + +void gst_rtsp_media_factory_set_suspend_mode (GstRTSPMediaFactory *factory, + GstRTSPSuspendMode mode); +GstRTSPSuspendMode gst_rtsp_media_factory_get_suspend_mode (GstRTSPMediaFactory *factory); + +void gst_rtsp_media_factory_set_eos_shutdown (GstRTSPMediaFactory *factory, + gboolean eos_shutdown); +gboolean gst_rtsp_media_factory_is_eos_shutdown (GstRTSPMediaFactory *factory); + +void gst_rtsp_media_factory_set_profiles (GstRTSPMediaFactory *factory, + GstRTSPProfile profiles); +GstRTSPProfile gst_rtsp_media_factory_get_profiles (GstRTSPMediaFactory *factory); + +void gst_rtsp_media_factory_set_protocols (GstRTSPMediaFactory *factory, + GstRTSPLowerTrans protocols); +GstRTSPLowerTrans gst_rtsp_media_factory_get_protocols (GstRTSPMediaFactory *factory); + +void gst_rtsp_media_factory_set_address_pool (GstRTSPMediaFactory * factory, + GstRTSPAddressPool * pool); +GstRTSPAddressPool * gst_rtsp_media_factory_get_address_pool (GstRTSPMediaFactory * factory); + +void gst_rtsp_media_factory_set_buffer_size (GstRTSPMediaFactory * factory, + guint size); +guint gst_rtsp_media_factory_get_buffer_size (GstRTSPMediaFactory * factory); + +/* creating the media from the factory and a url */ +GstRTSPMedia * gst_rtsp_media_factory_construct (GstRTSPMediaFactory *factory, + const GstRTSPUrl *url); + +GstElement * gst_rtsp_media_factory_create_element (GstRTSPMediaFactory *factory, + const GstRTSPUrl *url); + +G_END_DECLS + +#endif /* __GST_RTSP_MEDIA_FACTORY_H__ */ diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c new file mode 100644 index 0000000..48868f5 --- /dev/null +++ b/gst/rtsp-server/rtsp-media.c @@ -0,0 +1,3078 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-media + * @short_description: The media pipeline + * @see_also: #GstRTSPMediaFactory, #GstRTSPStream, #GstRTSPSession, + * #GstRTSPSessionMedia + * + * a #GstRTSPMedia contains the complete GStreamer pipeline to manage the + * streaming to the clients. The actual data transfer is done by the + * #GstRTSPStream objects that are created and exposed by the #GstRTSPMedia. + * + * The #GstRTSPMedia is usually created from a #GstRTSPMediaFactory when the + * client does a DESCRIBE or SETUP of a resource. + * + * A media is created with gst_rtsp_media_new() that takes the element that will + * provide the streaming elements. For each of the streams, a new #GstRTSPStream + * object needs to be made with the gst_rtsp_media_create_stream() which takes + * the payloader element and the source pad that produces the RTP stream. + * + * The pipeline of the media is set to PAUSED with gst_rtsp_media_prepare(). The + * prepare method will add rtpbin and sinks and sources to send and receive RTP + * and RTCP packets from the clients. Each stream srcpad is connected to an + * input into the internal rtpbin. + * + * It is also possible to dynamically create #GstRTSPStream objects during the + * prepare phase. With gst_rtsp_media_get_status() you can check the status of + * the prepare phase. + * + * After the media is prepared, it is ready for streaming. It will usually be + * managed in a session with gst_rtsp_session_manage_media(). See + * #GstRTSPSession and #GstRTSPSessionMedia. + * + * The state of the media can be controlled with gst_rtsp_media_set_state (). + * Seeking can be done with gst_rtsp_media_seek(). + * + * With gst_rtsp_media_unprepare() the pipeline is stopped and shut down. When + * gst_rtsp_media_set_eos_shutdown() an EOS will be sent to the pipeline to + * cleanly shut down. + * + * With gst_rtsp_media_set_shared(), the media can be shared between multiple + * clients. With gst_rtsp_media_set_reusable() you can control if the pipeline + * can be prepared again after an unprepare. + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include +#include + +#include +#include + +#include "rtsp-media.h" + +#define GST_RTSP_MEDIA_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_MEDIA, GstRTSPMediaPrivate)) + +struct _GstRTSPMediaPrivate +{ + GMutex lock; + GCond cond; + + /* protected by lock */ + GstRTSPPermissions *permissions; + gboolean shared; + gboolean suspend_mode; + gboolean reusable; + GstRTSPProfile profiles; + GstRTSPLowerTrans protocols; + gboolean reused; + gboolean eos_shutdown; + guint buffer_size; + GstRTSPAddressPool *pool; + gboolean blocked; + + GstElement *element; + GRecMutex state_lock; /* locking order: state lock, lock */ + GPtrArray *streams; /* protected by lock */ + GList *dynamic; /* protected by lock */ + GstRTSPMediaStatus status; /* protected by lock */ + gint prepare_count; + gint n_active; + gboolean adding; + + /* the pipeline for the media */ + GstElement *pipeline; + GstElement *fakesink; /* protected by lock */ + GSource *source; + guint id; + GstRTSPThread *thread; + + gboolean time_provider; + GstNetTimeProvider *nettime; + + gboolean is_live; + gboolean seekable; + gboolean buffering; + GstState target_state; + + /* RTP session manager */ + GstElement *rtpbin; + + /* the range of media */ + GstRTSPTimeRange range; /* protected by lock */ + GstClockTime range_start; + GstClockTime range_stop; +}; + +#define DEFAULT_SHARED FALSE +#define DEFAULT_SUSPEND_MODE GST_RTSP_SUSPEND_MODE_NONE +#define DEFAULT_REUSABLE FALSE +#define DEFAULT_PROFILES GST_RTSP_PROFILE_AVP +#define DEFAULT_PROTOCOLS GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_UDP_MCAST | \ + GST_RTSP_LOWER_TRANS_TCP +#define DEFAULT_EOS_SHUTDOWN FALSE +#define DEFAULT_BUFFER_SIZE 0x80000 +#define DEFAULT_TIME_PROVIDER FALSE + +/* define to dump received RTCP packets */ +#undef DUMP_STATS + +enum +{ + PROP_0, + PROP_SHARED, + PROP_SUSPEND_MODE, + PROP_REUSABLE, + PROP_PROFILES, + PROP_PROTOCOLS, + PROP_EOS_SHUTDOWN, + PROP_BUFFER_SIZE, + PROP_ELEMENT, + PROP_TIME_PROVIDER, + PROP_LAST +}; + +enum +{ + SIGNAL_NEW_STREAM, + SIGNAL_REMOVED_STREAM, + SIGNAL_PREPARED, + SIGNAL_UNPREPARED, + SIGNAL_TARGET_STATE, + SIGNAL_NEW_STATE, + SIGNAL_LAST +}; + +GST_DEBUG_CATEGORY_STATIC (rtsp_media_debug); +#define GST_CAT_DEFAULT rtsp_media_debug + +static void gst_rtsp_media_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec); +static void gst_rtsp_media_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec); +static void gst_rtsp_media_finalize (GObject * obj); + +static gboolean default_handle_message (GstRTSPMedia * media, + GstMessage * message); +static void finish_unprepare (GstRTSPMedia * media); +static gboolean default_prepare (GstRTSPMedia * media, GstRTSPThread * thread); +static gboolean default_unprepare (GstRTSPMedia * media); +static gboolean default_suspend (GstRTSPMedia * media); +static gboolean default_unsuspend (GstRTSPMedia * media); +static gboolean default_convert_range (GstRTSPMedia * media, + GstRTSPTimeRange * range, GstRTSPRangeUnit unit); +static gboolean default_query_position (GstRTSPMedia * media, + gint64 * position); +static gboolean default_query_stop (GstRTSPMedia * media, gint64 * stop); +static GstElement *default_create_rtpbin (GstRTSPMedia * media); +static gboolean default_setup_sdp (GstRTSPMedia * media, GstSDPMessage * sdp, + GstSDPInfo * info); + +static gboolean wait_preroll (GstRTSPMedia * media); + +static guint gst_rtsp_media_signals[SIGNAL_LAST] = { 0 }; + +#define C_ENUM(v) ((gint) v) + +#define GST_TYPE_RTSP_SUSPEND_MODE (gst_rtsp_suspend_mode_get_type()) +GType +gst_rtsp_suspend_mode_get_type (void) +{ + static gsize id = 0; + static const GEnumValue values[] = { + {C_ENUM (GST_RTSP_SUSPEND_MODE_NONE), "GST_RTSP_SUSPEND_MODE_NONE", "none"}, + {C_ENUM (GST_RTSP_SUSPEND_MODE_PAUSE), "GST_RTSP_SUSPEND_MODE_PAUSE", + "pause"}, + {C_ENUM (GST_RTSP_SUSPEND_MODE_RESET), "GST_RTSP_SUSPEND_MODE_RESET", + "reset"}, + {0, NULL, NULL} + }; + + if (g_once_init_enter (&id)) { + GType tmp = g_enum_register_static ("GstRTSPSuspendMode", values); + g_once_init_leave (&id, tmp); + } + return (GType) id; +} + +G_DEFINE_TYPE (GstRTSPMedia, gst_rtsp_media, G_TYPE_OBJECT); + +static void +gst_rtsp_media_class_init (GstRTSPMediaClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPMediaPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->get_property = gst_rtsp_media_get_property; + gobject_class->set_property = gst_rtsp_media_set_property; + gobject_class->finalize = gst_rtsp_media_finalize; + + g_object_class_install_property (gobject_class, PROP_SHARED, + g_param_spec_boolean ("shared", "Shared", + "If this media pipeline can be shared", DEFAULT_SHARED, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_SUSPEND_MODE, + g_param_spec_enum ("suspend-mode", "Suspend Mode", + "How to suspend the media in PAUSED", GST_TYPE_RTSP_SUSPEND_MODE, + DEFAULT_SUSPEND_MODE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_REUSABLE, + g_param_spec_boolean ("reusable", "Reusable", + "If this media pipeline can be reused after an unprepare", + DEFAULT_REUSABLE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_PROFILES, + g_param_spec_flags ("profiles", "Profiles", + "Allowed transfer profiles", GST_TYPE_RTSP_PROFILE, + DEFAULT_PROFILES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_PROTOCOLS, + g_param_spec_flags ("protocols", "Protocols", + "Allowed lower transport protocols", GST_TYPE_RTSP_LOWER_TRANS, + DEFAULT_PROTOCOLS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_EOS_SHUTDOWN, + g_param_spec_boolean ("eos-shutdown", "EOS Shutdown", + "Send an EOS event to the pipeline before unpreparing", + DEFAULT_EOS_SHUTDOWN, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_BUFFER_SIZE, + g_param_spec_uint ("buffer-size", "Buffer Size", + "The kernel UDP buffer size to use", 0, G_MAXUINT, + DEFAULT_BUFFER_SIZE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_ELEMENT, + g_param_spec_object ("element", "The Element", + "The GstBin to use for streaming the media", GST_TYPE_ELEMENT, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); + + g_object_class_install_property (gobject_class, PROP_TIME_PROVIDER, + g_param_spec_boolean ("time-provider", "Time Provider", + "Use a NetTimeProvider for clients", + DEFAULT_TIME_PROVIDER, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_rtsp_media_signals[SIGNAL_NEW_STREAM] = + g_signal_new ("new-stream", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstRTSPMediaClass, new_stream), NULL, NULL, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, GST_TYPE_RTSP_STREAM); + + gst_rtsp_media_signals[SIGNAL_REMOVED_STREAM] = + g_signal_new ("removed-stream", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPMediaClass, removed_stream), + NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, + GST_TYPE_RTSP_STREAM); + + gst_rtsp_media_signals[SIGNAL_PREPARED] = + g_signal_new ("prepared", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstRTSPMediaClass, prepared), NULL, NULL, + g_cclosure_marshal_generic, G_TYPE_NONE, 0, G_TYPE_NONE); + + gst_rtsp_media_signals[SIGNAL_UNPREPARED] = + g_signal_new ("unprepared", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstRTSPMediaClass, unprepared), NULL, NULL, + g_cclosure_marshal_generic, G_TYPE_NONE, 0, G_TYPE_NONE); + + gst_rtsp_media_signals[SIGNAL_TARGET_STATE] = + g_signal_new ("target-state", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPMediaClass, target_state), + NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_INT); + + gst_rtsp_media_signals[SIGNAL_NEW_STATE] = + g_signal_new ("new-state", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstRTSPMediaClass, new_state), NULL, NULL, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_INT); + + GST_DEBUG_CATEGORY_INIT (rtsp_media_debug, "rtspmedia", 0, "GstRTSPMedia"); + + klass->handle_message = default_handle_message; + klass->prepare = default_prepare; + klass->unprepare = default_unprepare; + klass->suspend = default_suspend; + klass->unsuspend = default_unsuspend; + klass->convert_range = default_convert_range; + klass->query_position = default_query_position; + klass->query_stop = default_query_stop; + klass->create_rtpbin = default_create_rtpbin; + klass->setup_sdp = default_setup_sdp; +} + +static void +gst_rtsp_media_init (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = GST_RTSP_MEDIA_GET_PRIVATE (media); + + media->priv = priv; + + priv->streams = g_ptr_array_new_with_free_func (g_object_unref); + g_mutex_init (&priv->lock); + g_cond_init (&priv->cond); + g_rec_mutex_init (&priv->state_lock); + + priv->shared = DEFAULT_SHARED; + priv->suspend_mode = DEFAULT_SUSPEND_MODE; + priv->reusable = DEFAULT_REUSABLE; + priv->profiles = DEFAULT_PROFILES; + priv->protocols = DEFAULT_PROTOCOLS; + priv->eos_shutdown = DEFAULT_EOS_SHUTDOWN; + priv->buffer_size = DEFAULT_BUFFER_SIZE; + priv->time_provider = DEFAULT_TIME_PROVIDER; +} + +static void +gst_rtsp_media_finalize (GObject * obj) +{ + GstRTSPMediaPrivate *priv; + GstRTSPMedia *media; + + media = GST_RTSP_MEDIA (obj); + priv = media->priv; + + GST_INFO ("finalize media %p", media); + + if (priv->permissions) + gst_rtsp_permissions_unref (priv->permissions); + + g_ptr_array_unref (priv->streams); + + g_list_free_full (priv->dynamic, gst_object_unref); + + if (priv->pipeline) + gst_object_unref (priv->pipeline); + if (priv->nettime) + gst_object_unref (priv->nettime); + gst_object_unref (priv->element); + if (priv->pool) + g_object_unref (priv->pool); + g_mutex_clear (&priv->lock); + g_cond_clear (&priv->cond); + g_rec_mutex_clear (&priv->state_lock); + + G_OBJECT_CLASS (gst_rtsp_media_parent_class)->finalize (obj); +} + +static void +gst_rtsp_media_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + GstRTSPMedia *media = GST_RTSP_MEDIA (object); + + switch (propid) { + case PROP_ELEMENT: + g_value_set_object (value, media->priv->element); + break; + case PROP_SHARED: + g_value_set_boolean (value, gst_rtsp_media_is_shared (media)); + break; + case PROP_SUSPEND_MODE: + g_value_set_enum (value, gst_rtsp_media_get_suspend_mode (media)); + break; + case PROP_REUSABLE: + g_value_set_boolean (value, gst_rtsp_media_is_reusable (media)); + break; + case PROP_PROFILES: + g_value_set_flags (value, gst_rtsp_media_get_profiles (media)); + break; + case PROP_PROTOCOLS: + g_value_set_flags (value, gst_rtsp_media_get_protocols (media)); + break; + case PROP_EOS_SHUTDOWN: + g_value_set_boolean (value, gst_rtsp_media_is_eos_shutdown (media)); + break; + case PROP_BUFFER_SIZE: + g_value_set_uint (value, gst_rtsp_media_get_buffer_size (media)); + break; + case PROP_TIME_PROVIDER: + g_value_set_boolean (value, gst_rtsp_media_is_time_provider (media)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_media_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + GstRTSPMedia *media = GST_RTSP_MEDIA (object); + + switch (propid) { + case PROP_ELEMENT: + media->priv->element = g_value_get_object (value); + gst_object_ref_sink (media->priv->element); + break; + case PROP_SHARED: + gst_rtsp_media_set_shared (media, g_value_get_boolean (value)); + break; + case PROP_SUSPEND_MODE: + gst_rtsp_media_set_suspend_mode (media, g_value_get_enum (value)); + break; + case PROP_REUSABLE: + gst_rtsp_media_set_reusable (media, g_value_get_boolean (value)); + break; + case PROP_PROFILES: + gst_rtsp_media_set_profiles (media, g_value_get_flags (value)); + break; + case PROP_PROTOCOLS: + gst_rtsp_media_set_protocols (media, g_value_get_flags (value)); + break; + case PROP_EOS_SHUTDOWN: + gst_rtsp_media_set_eos_shutdown (media, g_value_get_boolean (value)); + break; + case PROP_BUFFER_SIZE: + gst_rtsp_media_set_buffer_size (media, g_value_get_uint (value)); + break; + case PROP_TIME_PROVIDER: + gst_rtsp_media_use_time_provider (media, g_value_get_boolean (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +typedef struct +{ + gint64 position; + gboolean ret; +} DoQueryPositionData; + +static void +do_query_position (GstRTSPStream * stream, DoQueryPositionData * data) +{ + gint64 tmp; + + if (gst_rtsp_stream_query_position (stream, &tmp)) { + data->position = MAX (data->position, tmp); + data->ret = TRUE; + } +} + +static gboolean +default_query_position (GstRTSPMedia * media, gint64 * position) +{ + GstRTSPMediaPrivate *priv; + DoQueryPositionData data; + + priv = media->priv; + + data.position = -1; + data.ret = FALSE; + + g_ptr_array_foreach (priv->streams, (GFunc) do_query_position, &data); + + *position = data.position; + + return data.ret; +} + +typedef struct +{ + gint64 stop; + gboolean ret; +} DoQueryStopData; + +static void +do_query_stop (GstRTSPStream * stream, DoQueryStopData * data) +{ + gint64 tmp; + + if (gst_rtsp_stream_query_stop (stream, &tmp)) { + data->stop = MAX (data->stop, tmp); + data->ret = TRUE; + } +} + +static gboolean +default_query_stop (GstRTSPMedia * media, gint64 * stop) +{ + GstRTSPMediaPrivate *priv; + DoQueryStopData data; + + priv = media->priv; + + data.stop = -1; + data.ret = FALSE; + + g_ptr_array_foreach (priv->streams, (GFunc) do_query_stop, &data); + + *stop = data.stop; + + return data.ret; +} + +static GstElement * +default_create_rtpbin (GstRTSPMedia * media) +{ + GstElement *rtpbin; + + rtpbin = gst_element_factory_make ("rtpbin", NULL); + + return rtpbin; +} + +/* must be called with state lock */ +static void +collect_media_stats (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + gint64 position = 0, stop = -1; + + if (priv->status != GST_RTSP_MEDIA_STATUS_PREPARED && + priv->status != GST_RTSP_MEDIA_STATUS_PREPARING) + return; + + priv->range.unit = GST_RTSP_RANGE_NPT; + + GST_INFO ("collect media stats"); + + if (priv->is_live) { + priv->range.min.type = GST_RTSP_TIME_NOW; + priv->range.min.seconds = -1; + priv->range_start = -1; + priv->range.max.type = GST_RTSP_TIME_END; + priv->range.max.seconds = -1; + priv->range_stop = -1; + } else { + GstRTSPMediaClass *klass; + gboolean ret; + + klass = GST_RTSP_MEDIA_GET_CLASS (media); + + /* get the position */ + ret = FALSE; + if (klass->query_position) + ret = klass->query_position (media, &position); + + if (!ret) { + GST_INFO ("position query failed"); + position = 0; + } + + /* get the current segment stop */ + ret = FALSE; + if (klass->query_stop) + ret = klass->query_stop (media, &stop); + + if (!ret) { + GST_INFO ("stop query failed"); + stop = -1; + } + + GST_INFO ("stats: position %" GST_TIME_FORMAT ", stop %" + GST_TIME_FORMAT, GST_TIME_ARGS (position), GST_TIME_ARGS (stop)); + + if (position == -1) { + priv->range.min.type = GST_RTSP_TIME_NOW; + priv->range.min.seconds = -1; + priv->range_start = -1; + } else { + priv->range.min.type = GST_RTSP_TIME_SECONDS; + priv->range.min.seconds = ((gdouble) position) / GST_SECOND; + priv->range_start = position; + } + if (stop == -1) { + priv->range.max.type = GST_RTSP_TIME_END; + priv->range.max.seconds = -1; + priv->range_stop = -1; + } else { + priv->range.max.type = GST_RTSP_TIME_SECONDS; + priv->range.max.seconds = ((gdouble) stop) / GST_SECOND; + priv->range_stop = stop; + } + } +} + +/** + * gst_rtsp_media_new: + * @element: (transfer full): a #GstElement + * + * Create a new #GstRTSPMedia instance. @element is the bin element that + * provides the different streams. The #GstRTSPMedia object contains the + * element to produce RTP data for one or more related (audio/video/..) + * streams. + * + * Ownership is taken of @element. + * + * Returns: (transfer full): a new #GstRTSPMedia object. + */ +GstRTSPMedia * +gst_rtsp_media_new (GstElement * element) +{ + GstRTSPMedia *result; + + g_return_val_if_fail (GST_IS_ELEMENT (element), NULL); + + result = g_object_new (GST_TYPE_RTSP_MEDIA, "element", element, NULL); + + return result; +} + +/** + * gst_rtsp_media_get_element: + * @media: a #GstRTSPMedia + * + * Get the element that was used when constructing @media. + * + * Returns: (transfer full): a #GstElement. Unref after usage. + */ +GstElement * +gst_rtsp_media_get_element (GstRTSPMedia * media) +{ + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL); + + return gst_object_ref (media->priv->element); +} + +/** + * gst_rtsp_media_take_pipeline: + * @media: a #GstRTSPMedia + * @pipeline: (transfer full): a #GstPipeline + * + * Set @pipeline as the #GstPipeline for @media. Ownership is + * taken of @pipeline. + */ +void +gst_rtsp_media_take_pipeline (GstRTSPMedia * media, GstPipeline * pipeline) +{ + GstRTSPMediaPrivate *priv; + GstElement *old; + GstNetTimeProvider *nettime; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + g_return_if_fail (GST_IS_PIPELINE (pipeline)); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + old = priv->pipeline; + priv->pipeline = GST_ELEMENT_CAST (pipeline); + nettime = priv->nettime; + priv->nettime = NULL; + g_mutex_unlock (&priv->lock); + + if (old) + gst_object_unref (old); + + if (nettime) + gst_object_unref (nettime); + + gst_bin_add (GST_BIN_CAST (pipeline), priv->element); +} + +/** + * gst_rtsp_media_set_permissions: + * @media: a #GstRTSPMedia + * @permissions: (transfer none): a #GstRTSPPermissions + * + * Set @permissions on @media. + */ +void +gst_rtsp_media_set_permissions (GstRTSPMedia * media, + GstRTSPPermissions * permissions) +{ + GstRTSPMediaPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + if (priv->permissions) + gst_rtsp_permissions_unref (priv->permissions); + if ((priv->permissions = permissions)) + gst_rtsp_permissions_ref (permissions); + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_media_get_permissions: + * @media: a #GstRTSPMedia + * + * Get the permissions object from @media. + * + * Returns: (transfer full): a #GstRTSPPermissions object, unref after usage. + */ +GstRTSPPermissions * +gst_rtsp_media_get_permissions (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + GstRTSPPermissions *result; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + if ((result = priv->permissions)) + gst_rtsp_permissions_ref (result); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_media_set_suspend_mode: + * @media: a #GstRTSPMedia + * @mode: the new #GstRTSPSuspendMode + * + * Control how @ media will be suspended after the SDP has been generated and + * after a PAUSE request has been performed. + * + * Media must be unprepared when setting the suspend mode. + */ +void +gst_rtsp_media_set_suspend_mode (GstRTSPMedia * media, GstRTSPSuspendMode mode) +{ + GstRTSPMediaPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + priv = media->priv; + + g_rec_mutex_lock (&priv->state_lock); + if (priv->status == GST_RTSP_MEDIA_STATUS_PREPARED) + goto was_prepared; + priv->suspend_mode = mode; + g_rec_mutex_unlock (&priv->state_lock); + + return; + + /* ERRORS */ +was_prepared: + { + GST_WARNING ("media %p was prepared", media); + g_rec_mutex_unlock (&priv->state_lock); + } +} + +/** + * gst_rtsp_media_get_suspend_mode: + * @media: a #GstRTSPMedia + * + * Get how @media will be suspended. + * + * Returns: #GstRTSPSuspendMode. + */ +GstRTSPSuspendMode +gst_rtsp_media_get_suspend_mode (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + GstRTSPSuspendMode res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), GST_RTSP_SUSPEND_MODE_NONE); + + priv = media->priv; + + g_rec_mutex_lock (&priv->state_lock); + res = priv->suspend_mode; + g_rec_mutex_unlock (&priv->state_lock); + + return res; +} + +/** + * gst_rtsp_media_set_shared: + * @media: a #GstRTSPMedia + * @shared: the new value + * + * Set or unset if the pipeline for @media can be shared will multiple clients. + * When @shared is %TRUE, client requests for this media will share the media + * pipeline. + */ +void +gst_rtsp_media_set_shared (GstRTSPMedia * media, gboolean shared) +{ + GstRTSPMediaPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + priv->shared = shared; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_media_is_shared: + * @media: a #GstRTSPMedia + * + * Check if the pipeline for @media can be shared between multiple clients. + * + * Returns: %TRUE if the media can be shared between clients. + */ +gboolean +gst_rtsp_media_is_shared (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + gboolean res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + res = priv->shared; + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_media_set_reusable: + * @media: a #GstRTSPMedia + * @reusable: the new value + * + * Set or unset if the pipeline for @media can be reused after the pipeline has + * been unprepared. + */ +void +gst_rtsp_media_set_reusable (GstRTSPMedia * media, gboolean reusable) +{ + GstRTSPMediaPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + priv->reusable = reusable; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_media_is_reusable: + * @media: a #GstRTSPMedia + * + * Check if the pipeline for @media can be reused after an unprepare. + * + * Returns: %TRUE if the media can be reused + */ +gboolean +gst_rtsp_media_is_reusable (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + gboolean res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + res = priv->reusable; + g_mutex_unlock (&priv->lock); + + return res; +} + +static void +do_set_profiles (GstRTSPStream * stream, GstRTSPProfile * profiles) +{ + gst_rtsp_stream_set_profiles (stream, *profiles); +} + +/** + * gst_rtsp_media_set_profiles: + * @media: a #GstRTSPMedia + * @profiles: the new flags + * + * Configure the allowed lower transport for @media. + */ +void +gst_rtsp_media_set_profiles (GstRTSPMedia * media, GstRTSPProfile profiles) +{ + GstRTSPMediaPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + priv->profiles = profiles; + g_ptr_array_foreach (priv->streams, (GFunc) do_set_profiles, &profiles); + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_media_get_profiles: + * @media: a #GstRTSPMedia + * + * Get the allowed profiles of @media. + * + * Returns: a #GstRTSPProfile + */ +GstRTSPProfile +gst_rtsp_media_get_profiles (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + GstRTSPProfile res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), GST_RTSP_PROFILE_UNKNOWN); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + res = priv->profiles; + g_mutex_unlock (&priv->lock); + + return res; +} + +static void +do_set_protocols (GstRTSPStream * stream, GstRTSPLowerTrans * protocols) +{ + gst_rtsp_stream_set_protocols (stream, *protocols); +} + +/** + * gst_rtsp_media_set_protocols: + * @media: a #GstRTSPMedia + * @protocols: the new flags + * + * Configure the allowed lower transport for @media. + */ +void +gst_rtsp_media_set_protocols (GstRTSPMedia * media, GstRTSPLowerTrans protocols) +{ + GstRTSPMediaPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + priv->protocols = protocols; + g_ptr_array_foreach (priv->streams, (GFunc) do_set_protocols, &protocols); + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_media_get_protocols: + * @media: a #GstRTSPMedia + * + * Get the allowed protocols of @media. + * + * Returns: a #GstRTSPLowerTrans + */ +GstRTSPLowerTrans +gst_rtsp_media_get_protocols (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + GstRTSPLowerTrans res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), + GST_RTSP_LOWER_TRANS_UNKNOWN); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + res = priv->protocols; + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_media_set_eos_shutdown: + * @media: a #GstRTSPMedia + * @eos_shutdown: the new value + * + * Set or unset if an EOS event will be sent to the pipeline for @media before + * it is unprepared. + */ +void +gst_rtsp_media_set_eos_shutdown (GstRTSPMedia * media, gboolean eos_shutdown) +{ + GstRTSPMediaPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + priv->eos_shutdown = eos_shutdown; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_media_is_eos_shutdown: + * @media: a #GstRTSPMedia + * + * Check if the pipeline for @media will send an EOS down the pipeline before + * unpreparing. + * + * Returns: %TRUE if the media will send EOS before unpreparing. + */ +gboolean +gst_rtsp_media_is_eos_shutdown (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + gboolean res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + res = priv->eos_shutdown; + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_media_set_buffer_size: + * @media: a #GstRTSPMedia + * @size: the new value + * + * Set the kernel UDP buffer size. + */ +void +gst_rtsp_media_set_buffer_size (GstRTSPMedia * media, guint size) +{ + GstRTSPMediaPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + GST_LOG_OBJECT (media, "set buffer size %u", size); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + priv->buffer_size = size; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_media_get_buffer_size: + * @media: a #GstRTSPMedia + * + * Get the kernel UDP buffer size. + * + * Returns: the kernel UDP buffer size. + */ +guint +gst_rtsp_media_get_buffer_size (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + guint res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + + priv = media->priv; + + g_mutex_unlock (&priv->lock); + res = priv->buffer_size; + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_media_use_time_provider: + * @media: a #GstRTSPMedia + * @time_provider: if a #GstNetTimeProvider should be used + * + * Set @media to provide a #GstNetTimeProvider. + */ +void +gst_rtsp_media_use_time_provider (GstRTSPMedia * media, gboolean time_provider) +{ + GstRTSPMediaPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + priv->time_provider = time_provider; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_media_is_time_provider: + * @media: a #GstRTSPMedia + * + * Check if @media can provide a #GstNetTimeProvider for its pipeline clock. + * + * Use gst_rtsp_media_get_time_provider() to get the network clock. + * + * Returns: %TRUE if @media can provide a #GstNetTimeProvider. + */ +gboolean +gst_rtsp_media_is_time_provider (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + gboolean res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + + priv = media->priv; + + g_mutex_unlock (&priv->lock); + res = priv->time_provider; + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_media_set_address_pool: + * @media: a #GstRTSPMedia + * @pool: (transfer none): a #GstRTSPAddressPool + * + * configure @pool to be used as the address pool of @media. + */ +void +gst_rtsp_media_set_address_pool (GstRTSPMedia * media, + GstRTSPAddressPool * pool) +{ + GstRTSPMediaPrivate *priv; + GstRTSPAddressPool *old; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + priv = media->priv; + + GST_LOG_OBJECT (media, "set address pool %p", pool); + + g_mutex_lock (&priv->lock); + if ((old = priv->pool) != pool) + priv->pool = pool ? g_object_ref (pool) : NULL; + else + old = NULL; + g_ptr_array_foreach (priv->streams, (GFunc) gst_rtsp_stream_set_address_pool, + pool); + g_mutex_unlock (&priv->lock); + + if (old) + g_object_unref (old); +} + +/** + * gst_rtsp_media_get_address_pool: + * @media: a #GstRTSPMedia + * + * Get the #GstRTSPAddressPool used as the address pool of @media. + * + * Returns: (transfer full): the #GstRTSPAddressPool of @media. g_object_unref() after + * usage. + */ +GstRTSPAddressPool * +gst_rtsp_media_get_address_pool (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + GstRTSPAddressPool *result; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + if ((result = priv->pool)) + g_object_ref (result); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_media_collect_streams: + * @media: a #GstRTSPMedia + * + * Find all payloader elements, they should be named pay\%d in the + * element of @media, and create #GstRTSPStreams for them. + * + * Collect all dynamic elements, named dynpay\%d, and add them to + * the list of dynamic elements. + */ +void +gst_rtsp_media_collect_streams (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + GstElement *element, *elem; + GstPad *pad; + gint i; + gboolean have_elem; + + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + priv = media->priv; + element = priv->element; + + have_elem = TRUE; + for (i = 0; have_elem; i++) { + gchar *name; + + have_elem = FALSE; + + name = g_strdup_printf ("pay%d", i); + if ((elem = gst_bin_get_by_name (GST_BIN (element), name))) { + GST_INFO ("found stream %d with payloader %p", i, elem); + + /* take the pad of the payloader */ + pad = gst_element_get_static_pad (elem, "src"); + /* create the stream */ + gst_rtsp_media_create_stream (media, elem, pad); + gst_object_unref (pad); + gst_object_unref (elem); + + have_elem = TRUE; + } + g_free (name); + + name = g_strdup_printf ("dynpay%d", i); + if ((elem = gst_bin_get_by_name (GST_BIN (element), name))) { + /* a stream that will dynamically create pads to provide RTP packets */ + GST_INFO ("found dynamic element %d, %p", i, elem); + + g_mutex_lock (&priv->lock); + priv->dynamic = g_list_prepend (priv->dynamic, elem); + g_mutex_unlock (&priv->lock); + + have_elem = TRUE; + } + g_free (name); + } +} + +/** + * gst_rtsp_media_create_stream: + * @media: a #GstRTSPMedia + * @payloader: a #GstElement + * @srcpad: a source #GstPad + * + * Create a new stream in @media that provides RTP data on @srcpad. + * @srcpad should be a pad of an element inside @media->element. + * + * Returns: (transfer none): a new #GstRTSPStream that remains valid for as long + * as @media exists. + */ +GstRTSPStream * +gst_rtsp_media_create_stream (GstRTSPMedia * media, GstElement * payloader, + GstPad * pad) +{ + GstRTSPMediaPrivate *priv; + GstRTSPStream *stream; + GstPad *srcpad; + gchar *name; + gint idx; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL); + g_return_val_if_fail (GST_IS_ELEMENT (payloader), NULL); + g_return_val_if_fail (GST_IS_PAD (pad), NULL); + g_return_val_if_fail (GST_PAD_IS_SRC (pad), NULL); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + idx = priv->streams->len; + + GST_DEBUG ("media %p: creating stream with index %d", media, idx); + + name = g_strdup_printf ("src_%u", idx); + srcpad = gst_ghost_pad_new (name, pad); + gst_pad_set_active (srcpad, TRUE); + gst_element_add_pad (priv->element, srcpad); + g_free (name); + + stream = gst_rtsp_stream_new (idx, payloader, srcpad); + if (priv->pool) + gst_rtsp_stream_set_address_pool (stream, priv->pool); + gst_rtsp_stream_set_profiles (stream, priv->profiles); + gst_rtsp_stream_set_protocols (stream, priv->protocols); + + g_ptr_array_add (priv->streams, stream); + g_mutex_unlock (&priv->lock); + + g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_NEW_STREAM], 0, stream, + NULL); + + return stream; +} + +static void +gst_rtsp_media_remove_stream (GstRTSPMedia * media, GstRTSPStream * stream) +{ + GstRTSPMediaPrivate *priv; + GstPad *srcpad; + + priv = media->priv; + + g_mutex_lock (&priv->lock); + /* remove the ghostpad */ + srcpad = gst_rtsp_stream_get_srcpad (stream); + gst_element_remove_pad (priv->element, srcpad); + gst_object_unref (srcpad); + /* now remove the stream */ + g_object_ref (stream); + g_ptr_array_remove (priv->streams, stream); + g_mutex_unlock (&priv->lock); + + g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_REMOVED_STREAM], 0, + stream, NULL); + + g_object_unref (stream); +} + +/** + * gst_rtsp_media_n_streams: + * @media: a #GstRTSPMedia + * + * Get the number of streams in this media. + * + * Returns: The number of streams. + */ +guint +gst_rtsp_media_n_streams (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + guint res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), 0); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + res = priv->streams->len; + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_media_get_stream: + * @media: a #GstRTSPMedia + * @idx: the stream index + * + * Retrieve the stream with index @idx from @media. + * + * Returns: (nullable) (transfer none): the #GstRTSPStream at index + * @idx or %NULL when a stream with that index did not exist. + */ +GstRTSPStream * +gst_rtsp_media_get_stream (GstRTSPMedia * media, guint idx) +{ + GstRTSPMediaPrivate *priv; + GstRTSPStream *res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + if (idx < priv->streams->len) + res = g_ptr_array_index (priv->streams, idx); + else + res = NULL; + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_media_find_stream: + * @media: a #GstRTSPMedia + * @control: the control of the stream + * + * Find a stream in @media with @control as the control uri. + * + * Returns: (nullable) (transfer none): the #GstRTSPStream with + * control uri @control or %NULL when a stream with that control did + * not exist. + */ +GstRTSPStream * +gst_rtsp_media_find_stream (GstRTSPMedia * media, const gchar * control) +{ + GstRTSPMediaPrivate *priv; + GstRTSPStream *res; + gint i; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL); + g_return_val_if_fail (control != NULL, NULL); + + priv = media->priv; + + res = NULL; + + g_mutex_lock (&priv->lock); + for (i = 0; i < priv->streams->len; i++) { + GstRTSPStream *test; + + test = g_ptr_array_index (priv->streams, i); + if (gst_rtsp_stream_has_control (test, control)) { + res = test; + break; + } + } + g_mutex_unlock (&priv->lock); + + return res; +} + +/* called with state-lock */ +static gboolean +default_convert_range (GstRTSPMedia * media, GstRTSPTimeRange * range, + GstRTSPRangeUnit unit) +{ + return gst_rtsp_range_convert_units (range, unit); +} + +/** + * gst_rtsp_media_get_range_string: + * @media: a #GstRTSPMedia + * @play: for the PLAY request + * @unit: the unit to use for the string + * + * Get the current range as a string. @media must be prepared with + * gst_rtsp_media_prepare (). + * + * Returns: (transfer full): The range as a string, g_free() after usage. + */ +gchar * +gst_rtsp_media_get_range_string (GstRTSPMedia * media, gboolean play, + GstRTSPRangeUnit unit) +{ + GstRTSPMediaClass *klass; + GstRTSPMediaPrivate *priv; + gchar *result; + GstRTSPTimeRange range; + + klass = GST_RTSP_MEDIA_GET_CLASS (media); + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL); + g_return_val_if_fail (klass->convert_range != NULL, FALSE); + + priv = media->priv; + + g_rec_mutex_lock (&priv->state_lock); + if (priv->status != GST_RTSP_MEDIA_STATUS_PREPARED && + priv->status != GST_RTSP_MEDIA_STATUS_SUSPENDED) + goto not_prepared; + + g_mutex_lock (&priv->lock); + + /* Update the range value with current position/duration */ + collect_media_stats (media); + + /* make copy */ + range = priv->range; + + if (!play && priv->n_active > 0) { + range.min.type = GST_RTSP_TIME_NOW; + range.min.seconds = -1; + } + g_mutex_unlock (&priv->lock); + g_rec_mutex_unlock (&priv->state_lock); + + if (!klass->convert_range (media, &range, unit)) + goto conversion_failed; + + result = gst_rtsp_range_to_string (&range); + + return result; + + /* ERRORS */ +not_prepared: + { + GST_WARNING ("media %p was not prepared", media); + g_rec_mutex_unlock (&priv->state_lock); + return NULL; + } +conversion_failed: + { + GST_WARNING ("range conversion to unit %d failed", unit); + return NULL; + } +} + +static void +stream_update_blocked (GstRTSPStream * stream, GstRTSPMedia * media) +{ + gst_rtsp_stream_set_blocked (stream, media->priv->blocked); +} + +static void +media_streams_set_blocked (GstRTSPMedia * media, gboolean blocked) +{ + GstRTSPMediaPrivate *priv = media->priv; + + GST_DEBUG ("media %p set blocked %d", media, blocked); + priv->blocked = blocked; + g_ptr_array_foreach (priv->streams, (GFunc) stream_update_blocked, media); +} + +static void +gst_rtsp_media_set_status (GstRTSPMedia * media, GstRTSPMediaStatus status) +{ + GstRTSPMediaPrivate *priv = media->priv; + + g_mutex_lock (&priv->lock); + priv->status = status; + GST_DEBUG ("setting new status to %d", status); + g_cond_broadcast (&priv->cond); + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_media_get_status: + * @media: a #GstRTSPMedia + * + * Get the status of @media. When @media is busy preparing, this function waits + * until @media is prepared or in error. + * + * Returns: the status of @media. + */ +GstRTSPMediaStatus +gst_rtsp_media_get_status (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + GstRTSPMediaStatus result; + gint64 end_time; + + g_mutex_lock (&priv->lock); + end_time = g_get_monotonic_time () + 20 * G_TIME_SPAN_SECOND; + /* while we are preparing, wait */ + while (priv->status == GST_RTSP_MEDIA_STATUS_PREPARING) { + GST_DEBUG ("waiting for status change"); + if (!g_cond_wait_until (&priv->cond, &priv->lock, end_time)) { + GST_DEBUG ("timeout, assuming error status"); + priv->status = GST_RTSP_MEDIA_STATUS_ERROR; + } + } + /* could be success or error */ + result = priv->status; + GST_DEBUG ("got status %d", result); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_media_seek: + * @media: a #GstRTSPMedia + * @range: (transfer none): a #GstRTSPTimeRange + * + * Seek the pipeline of @media to @range. @media must be prepared with + * gst_rtsp_media_prepare(). + * + * Returns: %TRUE on success. + */ +gboolean +gst_rtsp_media_seek (GstRTSPMedia * media, GstRTSPTimeRange * range) +{ + GstRTSPMediaClass *klass; + GstRTSPMediaPrivate *priv; + gboolean res; + GstClockTime start, stop; + GstSeekType start_type, stop_type; + GstQuery *query; + + klass = GST_RTSP_MEDIA_GET_CLASS (media); + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + g_return_val_if_fail (range != NULL, FALSE); + g_return_val_if_fail (klass->convert_range != NULL, FALSE); + + priv = media->priv; + + g_rec_mutex_lock (&priv->state_lock); + if (priv->status != GST_RTSP_MEDIA_STATUS_PREPARED) + goto not_prepared; + + /* Update the seekable state of the pipeline in case it changed */ + query = gst_query_new_seeking (GST_FORMAT_TIME); + if (gst_element_query (priv->pipeline, query)) { + GstFormat format; + gboolean seekable; + gint64 start, end; + + gst_query_parse_seeking (query, &format, &seekable, &start, &end); + priv->seekable = seekable; + } + gst_query_unref (query); + + if (!priv->seekable) + goto not_seekable; + + start_type = stop_type = GST_SEEK_TYPE_NONE; + + if (!klass->convert_range (media, range, GST_RTSP_RANGE_NPT)) + goto not_supported; + gst_rtsp_range_get_times (range, &start, &stop); + + GST_INFO ("got %" GST_TIME_FORMAT " - %" GST_TIME_FORMAT, + GST_TIME_ARGS (start), GST_TIME_ARGS (stop)); + GST_INFO ("current %" GST_TIME_FORMAT " - %" GST_TIME_FORMAT, + GST_TIME_ARGS (priv->range_start), GST_TIME_ARGS (priv->range_stop)); + + if (start != GST_CLOCK_TIME_NONE) + start_type = GST_SEEK_TYPE_SET; + + if (priv->range_stop == stop) + stop = GST_CLOCK_TIME_NONE; + else if (stop != GST_CLOCK_TIME_NONE) + stop_type = GST_SEEK_TYPE_SET; + + if (start != GST_CLOCK_TIME_NONE || stop != GST_CLOCK_TIME_NONE) { + GstSeekFlags flags; + + GST_INFO ("seeking to %" GST_TIME_FORMAT " - %" GST_TIME_FORMAT, + GST_TIME_ARGS (start), GST_TIME_ARGS (stop)); + + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARING); + if (priv->blocked) + media_streams_set_blocked (media, TRUE); + + /* depends on the current playing state of the pipeline. We might need to + * queue this until we get EOS. */ + flags = GST_SEEK_FLAG_FLUSH; + + /* if range start was not supplied we must continue from current position. + * but since we're doing a flushing seek, let us query the current position + * so we end up at exactly the same position after the seek. */ + if (range->min.type == GST_RTSP_TIME_END) { /* Yepp, that's right! */ + gint64 position; + gboolean ret = FALSE; + + if (klass->query_position) + ret = klass->query_position (media, &position); + + if (!ret) { + GST_WARNING ("position query failed"); + } else { + GST_DEBUG ("doing accurate seek to %" GST_TIME_FORMAT, + GST_TIME_ARGS (position)); + start = position; + start_type = GST_SEEK_TYPE_SET; + flags |= GST_SEEK_FLAG_ACCURATE; + } + } else { + /* only set keyframe flag when modifying start */ + if (start_type != GST_SEEK_TYPE_NONE) + flags |= GST_SEEK_FLAG_KEY_UNIT; + } + + /* FIXME, we only do forwards playback, no trick modes yet */ + res = gst_element_seek (priv->pipeline, 1.0, GST_FORMAT_TIME, + flags, start_type, start, stop_type, stop); + + /* and block for the seek to complete */ + GST_INFO ("done seeking %d", res); + g_rec_mutex_unlock (&priv->state_lock); + + /* wait until pipeline is prerolled again, this will also collect stats */ + if (!wait_preroll (media)) + goto preroll_failed; + + g_rec_mutex_lock (&priv->state_lock); + GST_INFO ("prerolled again"); + } else { + GST_INFO ("no seek needed"); + res = TRUE; + } + g_rec_mutex_unlock (&priv->state_lock); + + return res; + + /* ERRORS */ +not_prepared: + { + g_rec_mutex_unlock (&priv->state_lock); + GST_INFO ("media %p is not prepared", media); + return FALSE; + } +not_seekable: + { + g_rec_mutex_unlock (&priv->state_lock); + GST_INFO ("pipeline is not seekable"); + return FALSE; + } +not_supported: + { + g_rec_mutex_unlock (&priv->state_lock); + GST_WARNING ("conversion to npt not supported"); + return FALSE; + } +preroll_failed: + { + GST_WARNING ("failed to preroll after seek"); + return FALSE; + } +} + +static void +stream_collect_blocking (GstRTSPStream * stream, gboolean * blocked) +{ + *blocked &= gst_rtsp_stream_is_blocking (stream); +} + +static gboolean +media_streams_blocking (GstRTSPMedia * media) +{ + gboolean blocking = TRUE; + + g_ptr_array_foreach (media->priv->streams, (GFunc) stream_collect_blocking, + &blocking); + + return blocking; +} + +static GstStateChangeReturn +set_state (GstRTSPMedia * media, GstState state) +{ + GstRTSPMediaPrivate *priv = media->priv; + GstStateChangeReturn ret; + + GST_INFO ("set state to %s for media %p", gst_element_state_get_name (state), + media); + ret = gst_element_set_state (priv->pipeline, state); + + return ret; +} + +static GstStateChangeReturn +set_target_state (GstRTSPMedia * media, GstState state, gboolean do_state) +{ + GstRTSPMediaPrivate *priv = media->priv; + GstStateChangeReturn ret; + + GST_INFO ("set target state to %s for media %p", + gst_element_state_get_name (state), media); + priv->target_state = state; + + g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_TARGET_STATE], 0, + priv->target_state, NULL); + + if (do_state) + ret = set_state (media, state); + else + ret = GST_STATE_CHANGE_SUCCESS; + + return ret; +} + +/* called with state-lock */ +static gboolean +default_handle_message (GstRTSPMedia * media, GstMessage * message) +{ + GstRTSPMediaPrivate *priv = media->priv; + GstMessageType type; + + type = GST_MESSAGE_TYPE (message); + + switch (type) { + case GST_MESSAGE_STATE_CHANGED: + break; + case GST_MESSAGE_BUFFERING: + { + gint percent; + + gst_message_parse_buffering (message, &percent); + + /* no state management needed for live pipelines */ + if (priv->is_live) + break; + + if (percent == 100) { + /* a 100% message means buffering is done */ + priv->buffering = FALSE; + /* if the desired state is playing, go back */ + if (priv->target_state == GST_STATE_PLAYING) { + GST_INFO ("Buffering done, setting pipeline to PLAYING"); + set_state (media, GST_STATE_PLAYING); + } else { + GST_INFO ("Buffering done"); + } + } else { + /* buffering busy */ + if (priv->buffering == FALSE) { + if (priv->target_state == GST_STATE_PLAYING) { + /* we were not buffering but PLAYING, PAUSE the pipeline. */ + GST_INFO ("Buffering, setting pipeline to PAUSED ..."); + set_state (media, GST_STATE_PAUSED); + } else { + GST_INFO ("Buffering ..."); + } + } + priv->buffering = TRUE; + } + break; + } + case GST_MESSAGE_LATENCY: + { + gst_bin_recalculate_latency (GST_BIN_CAST (priv->pipeline)); + break; + } + case GST_MESSAGE_ERROR: + { + GError *gerror; + gchar *debug; + + gst_message_parse_error (message, &gerror, &debug); + GST_WARNING ("%p: got error %s (%s)", media, gerror->message, debug); + g_error_free (gerror); + g_free (debug); + + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_ERROR); + break; + } + case GST_MESSAGE_WARNING: + { + GError *gerror; + gchar *debug; + + gst_message_parse_warning (message, &gerror, &debug); + GST_WARNING ("%p: got warning %s (%s)", media, gerror->message, debug); + g_error_free (gerror); + g_free (debug); + break; + } + case GST_MESSAGE_ELEMENT: + { + const GstStructure *s; + + s = gst_message_get_structure (message); + if (gst_structure_has_name (s, "GstRTSPStreamBlocking")) { + GST_DEBUG ("media received blocking message"); + if (priv->blocked && media_streams_blocking (media)) { + GST_DEBUG ("media is blocking"); + collect_media_stats (media); + + if (priv->status == GST_RTSP_MEDIA_STATUS_PREPARING) + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARED); + } + } + break; + } + case GST_MESSAGE_STREAM_STATUS: + break; + case GST_MESSAGE_ASYNC_DONE: + if (priv->adding) { + /* when we are dynamically adding pads, the addition of the udpsrc will + * temporarily produce ASYNC_DONE messages. We have to ignore them and + * wait for the final ASYNC_DONE after everything prerolled */ + GST_INFO ("%p: ignoring ASYNC_DONE", media); + } else { + GST_INFO ("%p: got ASYNC_DONE", media); + collect_media_stats (media); + + if (priv->status == GST_RTSP_MEDIA_STATUS_PREPARING) + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARED); + } + break; + case GST_MESSAGE_EOS: + GST_INFO ("%p: got EOS", media); + + if (priv->status == GST_RTSP_MEDIA_STATUS_UNPREPARING) { + GST_DEBUG ("shutting down after EOS"); + finish_unprepare (media); + } + break; + default: + GST_INFO ("%p: got message type %d (%s)", media, type, + gst_message_type_get_name (type)); + break; + } + return TRUE; +} + +static gboolean +bus_message (GstBus * bus, GstMessage * message, GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + GstRTSPMediaClass *klass; + gboolean ret; + + klass = GST_RTSP_MEDIA_GET_CLASS (media); + + g_rec_mutex_lock (&priv->state_lock); + if (klass->handle_message) + ret = klass->handle_message (media, message); + else + ret = FALSE; + g_rec_mutex_unlock (&priv->state_lock); + + return ret; +} + +static void +watch_destroyed (GstRTSPMedia * media) +{ + GST_DEBUG_OBJECT (media, "source destroyed"); + g_object_unref (media); +} + +static GstElement * +find_payload_element (GstElement * payloader) +{ + GstElement *pay = NULL; + + if (GST_IS_BIN (payloader)) { + GstIterator *iter; + GValue item = { 0 }; + + iter = gst_bin_iterate_recurse (GST_BIN (payloader)); + while (gst_iterator_next (iter, &item) == GST_ITERATOR_OK) { + GstElement *element = (GstElement *) g_value_get_object (&item); + GstElementClass *eclass = GST_ELEMENT_GET_CLASS (element); + const gchar *klass; + + klass = + gst_element_class_get_metadata (eclass, GST_ELEMENT_METADATA_KLASS); + if (klass == NULL) + continue; + + if (strstr (klass, "Payloader") && strstr (klass, "RTP")) { + pay = gst_object_ref (element); + g_value_unset (&item); + break; + } + g_value_unset (&item); + } + gst_iterator_free (iter); + } else { + pay = g_object_ref (payloader); + } + + return pay; +} + +/* called from streaming threads */ +static void +pad_added_cb (GstElement * element, GstPad * pad, GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + GstRTSPStream *stream; + GstElement *pay; + + /* find the real payload element */ + pay = find_payload_element (element); + stream = gst_rtsp_media_create_stream (media, pay, pad); + gst_object_unref (pay); + + GST_INFO ("pad added %s:%s, stream %p", GST_DEBUG_PAD_NAME (pad), stream); + + g_rec_mutex_lock (&priv->state_lock); + if (priv->status != GST_RTSP_MEDIA_STATUS_PREPARING) + goto not_preparing; + + g_object_set_data (G_OBJECT (pad), "gst-rtsp-dynpad-stream", stream); + + /* we will be adding elements below that will cause ASYNC_DONE to be + * posted in the bus. We want to ignore those messages until the + * pipeline really prerolled. */ + priv->adding = TRUE; + + /* join the element in the PAUSED state because this callback is + * called from the streaming thread and it is PAUSED */ + if (!gst_rtsp_stream_join_bin (stream, GST_BIN (priv->pipeline), + priv->rtpbin, GST_STATE_PAUSED)) { + GST_WARNING ("failed to join bin element"); + } + + priv->adding = FALSE; + g_rec_mutex_unlock (&priv->state_lock); + + return; + + /* ERRORS */ +not_preparing: + { + gst_rtsp_media_remove_stream (media, stream); + g_rec_mutex_unlock (&priv->state_lock); + GST_INFO ("ignore pad because we are not preparing"); + return; + } +} + +static void +pad_removed_cb (GstElement * element, GstPad * pad, GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + GstRTSPStream *stream; + + stream = g_object_get_data (G_OBJECT (pad), "gst-rtsp-dynpad-stream"); + if (stream == NULL) + return; + + GST_INFO ("pad removed %s:%s, stream %p", GST_DEBUG_PAD_NAME (pad), stream); + + g_rec_mutex_lock (&priv->state_lock); + gst_rtsp_stream_leave_bin (stream, GST_BIN (priv->pipeline), priv->rtpbin); + g_rec_mutex_unlock (&priv->state_lock); + + gst_rtsp_media_remove_stream (media, stream); +} + +static void +remove_fakesink (GstRTSPMediaPrivate * priv) +{ + GstElement *fakesink; + + g_mutex_lock (&priv->lock); + if ((fakesink = priv->fakesink)) + gst_object_ref (fakesink); + priv->fakesink = NULL; + g_mutex_unlock (&priv->lock); + + if (fakesink) { + gst_bin_remove (GST_BIN (priv->pipeline), fakesink); + gst_element_set_state (fakesink, GST_STATE_NULL); + gst_object_unref (fakesink); + GST_INFO ("removed fakesink"); + } +} + +static void +no_more_pads_cb (GstElement * element, GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + + GST_INFO ("no more pads"); + remove_fakesink (priv); +} + +typedef struct _DynPaySignalHandlers DynPaySignalHandlers; + +struct _DynPaySignalHandlers +{ + gulong pad_added_handler; + gulong pad_removed_handler; + gulong no_more_pads_handler; +}; + +static gboolean +start_preroll (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + GstStateChangeReturn ret; + + GST_INFO ("setting pipeline to PAUSED for media %p", media); + /* first go to PAUSED */ + ret = set_target_state (media, GST_STATE_PAUSED, TRUE); + + switch (ret) { + case GST_STATE_CHANGE_SUCCESS: + GST_INFO ("SUCCESS state change for media %p", media); + priv->seekable = TRUE; + break; + case GST_STATE_CHANGE_ASYNC: + GST_INFO ("ASYNC state change for media %p", media); + priv->seekable = TRUE; + break; + case GST_STATE_CHANGE_NO_PREROLL: + /* we need to go to PLAYING */ + GST_INFO ("NO_PREROLL state change: live media %p", media); + /* FIXME we disable seeking for live streams for now. We should perform a + * seeking query in preroll instead */ + priv->seekable = FALSE; + priv->is_live = TRUE; + /* start blocked to make sure nothing goes to the sink */ + media_streams_set_blocked (media, TRUE); + ret = set_state (media, GST_STATE_PLAYING); + if (ret == GST_STATE_CHANGE_FAILURE) + goto state_failed; + break; + case GST_STATE_CHANGE_FAILURE: + goto state_failed; + } + + return TRUE; + +state_failed: + { + GST_WARNING ("failed to preroll pipeline"); + return FALSE; + } +} + +static gboolean +wait_preroll (GstRTSPMedia * media) +{ + GstRTSPMediaStatus status; + + GST_DEBUG ("wait to preroll pipeline"); + + /* wait until pipeline is prerolled */ + status = gst_rtsp_media_get_status (media); + if (status == GST_RTSP_MEDIA_STATUS_ERROR) + goto preroll_failed; + + return TRUE; + +preroll_failed: + { + GST_WARNING ("failed to preroll pipeline"); + return FALSE; + } +} + +static gboolean +start_prepare (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + guint i; + GList *walk; + + /* link streams we already have, other streams might appear when we have + * dynamic elements */ + for (i = 0; i < priv->streams->len; i++) { + GstRTSPStream *stream; + + stream = g_ptr_array_index (priv->streams, i); + + if (!gst_rtsp_stream_join_bin (stream, GST_BIN (priv->pipeline), + priv->rtpbin, GST_STATE_NULL)) { + goto join_bin_failed; + } + } + + for (walk = priv->dynamic; walk; walk = g_list_next (walk)) { + GstElement *elem = walk->data; + DynPaySignalHandlers *handlers = g_slice_new (DynPaySignalHandlers); + + GST_INFO ("adding callbacks for dynamic element %p", elem); + + handlers->pad_added_handler = g_signal_connect (elem, "pad-added", + (GCallback) pad_added_cb, media); + handlers->pad_removed_handler = g_signal_connect (elem, "pad-removed", + (GCallback) pad_removed_cb, media); + handlers->no_more_pads_handler = g_signal_connect (elem, "no-more-pads", + (GCallback) no_more_pads_cb, media); + + g_object_set_data (G_OBJECT (elem), "gst-rtsp-dynpay-handlers", handlers); + + /* we add a fakesink here in order to make the state change async. We remove + * the fakesink again in the no-more-pads callback. */ + priv->fakesink = gst_element_factory_make ("fakesink", "fakesink"); + gst_bin_add (GST_BIN (priv->pipeline), priv->fakesink); + } + + if (!start_preroll (media)) + goto preroll_failed; + + return FALSE; + +join_bin_failed: + { + GST_WARNING ("failed to join bin element"); + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_ERROR); + return FALSE; + } +preroll_failed: + { + GST_WARNING ("failed to preroll pipeline"); + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_ERROR); + return FALSE; + } +} + +static gboolean +default_prepare (GstRTSPMedia * media, GstRTSPThread * thread) +{ + GstRTSPMediaPrivate *priv; + GstRTSPMediaClass *klass; + GstBus *bus; + GMainContext *context; + GSource *source; + + priv = media->priv; + + klass = GST_RTSP_MEDIA_GET_CLASS (media); + + if (!klass->create_rtpbin) + goto no_create_rtpbin; + + priv->rtpbin = klass->create_rtpbin (media); + if (priv->rtpbin != NULL) { + gboolean success = TRUE; + + if (klass->setup_rtpbin) + success = klass->setup_rtpbin (media, priv->rtpbin); + + if (success == FALSE) { + gst_object_unref (priv->rtpbin); + priv->rtpbin = NULL; + } + } + if (priv->rtpbin == NULL) + goto no_rtpbin; + + priv->thread = thread; + context = (thread != NULL) ? (thread->context) : NULL; + + bus = gst_pipeline_get_bus (GST_PIPELINE_CAST (priv->pipeline)); + + /* add the pipeline bus to our custom mainloop */ + priv->source = gst_bus_create_watch (bus); + gst_object_unref (bus); + + g_source_set_callback (priv->source, (GSourceFunc) bus_message, + g_object_ref (media), (GDestroyNotify) watch_destroyed); + + priv->id = g_source_attach (priv->source, context); + + /* add stuff to the bin */ + gst_bin_add (GST_BIN (priv->pipeline), priv->rtpbin); + + /* do remainder in context */ + source = g_idle_source_new (); + g_source_set_callback (source, (GSourceFunc) start_prepare, media, NULL); + g_source_attach (source, context); + g_source_unref (source); + + return TRUE; + + /* ERRORS */ +no_create_rtpbin: + { + GST_ERROR ("no create_rtpbin function"); + g_critical ("no create_rtpbin vmethod function set"); + return FALSE; + } +no_rtpbin: + { + GST_WARNING ("no rtpbin element"); + g_warning ("failed to create element 'rtpbin', check your installation"); + return FALSE; + } +} + +/** + * gst_rtsp_media_prepare: + * @media: a #GstRTSPMedia + * @thread: (transfer full) (allow-none): a #GstRTSPThread to run the + * bus handler or %NULL + * + * Prepare @media for streaming. This function will create the objects + * to manage the streaming. A pipeline must have been set on @media with + * gst_rtsp_media_take_pipeline(). + * + * It will preroll the pipeline and collect vital information about the streams + * such as the duration. + * + * Returns: %TRUE on success. + */ +gboolean +gst_rtsp_media_prepare (GstRTSPMedia * media, GstRTSPThread * thread) +{ + GstRTSPMediaPrivate *priv; + GstRTSPMediaClass *klass; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + + priv = media->priv; + + g_rec_mutex_lock (&priv->state_lock); + priv->prepare_count++; + + if (priv->status == GST_RTSP_MEDIA_STATUS_PREPARED || + priv->status == GST_RTSP_MEDIA_STATUS_SUSPENDED) + goto was_prepared; + + if (priv->status == GST_RTSP_MEDIA_STATUS_PREPARING) + goto is_preparing; + + if (priv->status != GST_RTSP_MEDIA_STATUS_UNPREPARED) + goto not_unprepared; + + if (!priv->reusable && priv->reused) + goto is_reused; + + GST_INFO ("preparing media %p", media); + + /* reset some variables */ + priv->is_live = FALSE; + priv->seekable = FALSE; + priv->buffering = FALSE; + + /* we're preparing now */ + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARING); + + klass = GST_RTSP_MEDIA_GET_CLASS (media); + if (klass->prepare) { + if (!klass->prepare (media, thread)) + goto prepare_failed; + } + +wait_status: + g_rec_mutex_unlock (&priv->state_lock); + + /* now wait for all pads to be prerolled, FIXME, we should somehow be + * able to do this async so that we don't block the server thread. */ + if (!wait_preroll (media)) + goto preroll_failed; + + g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_PREPARED], 0, NULL); + + GST_INFO ("object %p is prerolled", media); + + return TRUE; + + /* OK */ +is_preparing: + { + /* we are not going to use the giving thread, so stop it. */ + if (thread) + gst_rtsp_thread_stop (thread); + goto wait_status; + } +was_prepared: + { + GST_LOG ("media %p was prepared", media); + /* we are not going to use the giving thread, so stop it. */ + if (thread) + gst_rtsp_thread_stop (thread); + g_rec_mutex_unlock (&priv->state_lock); + return TRUE; + } + /* ERRORS */ +not_unprepared: + { + /* we are not going to use the giving thread, so stop it. */ + if (thread) + gst_rtsp_thread_stop (thread); + GST_WARNING ("media %p was not unprepared", media); + priv->prepare_count--; + g_rec_mutex_unlock (&priv->state_lock); + return FALSE; + } +is_reused: + { + /* we are not going to use the giving thread, so stop it. */ + if (thread) + gst_rtsp_thread_stop (thread); + priv->prepare_count--; + g_rec_mutex_unlock (&priv->state_lock); + GST_WARNING ("can not reuse media %p", media); + return FALSE; + } +prepare_failed: + { + /* we are not going to use the giving thread, so stop it. */ + if (thread) + gst_rtsp_thread_stop (thread); + priv->prepare_count--; + g_rec_mutex_unlock (&priv->state_lock); + GST_ERROR ("failed to prepare media"); + return FALSE; + } +preroll_failed: + { + GST_WARNING ("failed to preroll pipeline"); + gst_rtsp_media_unprepare (media); + return FALSE; + } +} + +/* must be called with state-lock */ +static void +finish_unprepare (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + gint i; + GList *walk; + + GST_DEBUG ("shutting down"); + + /* release the lock on shutdown, otherwise pad_added_cb might try to + * acquire the lock and then we deadlock */ + g_rec_mutex_unlock (&priv->state_lock); + set_state (media, GST_STATE_NULL); + g_rec_mutex_lock (&priv->state_lock); + remove_fakesink (priv); + + for (i = 0; i < priv->streams->len; i++) { + GstRTSPStream *stream; + + GST_INFO ("Removing elements of stream %d from pipeline", i); + + stream = g_ptr_array_index (priv->streams, i); + + gst_rtsp_stream_leave_bin (stream, GST_BIN (priv->pipeline), priv->rtpbin); + } + + /* remove the pad signal handlers */ + for (walk = priv->dynamic; walk; walk = g_list_next (walk)) { + GstElement *elem = walk->data; + DynPaySignalHandlers *handlers; + + handlers = + g_object_steal_data (G_OBJECT (elem), "gst-rtsp-dynpay-handlers"); + g_assert (handlers != NULL); + + g_signal_handler_disconnect (G_OBJECT (elem), handlers->pad_added_handler); + g_signal_handler_disconnect (G_OBJECT (elem), + handlers->pad_removed_handler); + g_signal_handler_disconnect (G_OBJECT (elem), + handlers->no_more_pads_handler); + + g_slice_free (DynPaySignalHandlers, handlers); + } + + gst_bin_remove (GST_BIN (priv->pipeline), priv->rtpbin); + priv->rtpbin = NULL; + + if (priv->nettime) + gst_object_unref (priv->nettime); + priv->nettime = NULL; + + priv->reused = TRUE; + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_UNPREPARED); + + /* when the media is not reusable, this will effectively unref the media and + * recreate it */ + g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_UNPREPARED], 0, NULL); + + /* the source has the last ref to the media */ + if (priv->source) { + GST_DEBUG ("destroy source"); + g_source_destroy (priv->source); + g_source_unref (priv->source); + } + if (priv->thread) { + GST_DEBUG ("stop thread"); + gst_rtsp_thread_stop (priv->thread); + } +} + +/* called with state-lock */ +static gboolean +default_unprepare (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + + if (priv->eos_shutdown) { + GST_DEBUG ("sending EOS for shutdown"); + /* ref so that we don't disappear */ + gst_element_send_event (priv->pipeline, gst_event_new_eos ()); + /* we need to go to playing again for the EOS to propagate, normally in this + * state, nothing is receiving data from us anymore so this is ok. */ + set_state (media, GST_STATE_PLAYING); + } else { + finish_unprepare (media); + } + return TRUE; +} + +/** + * gst_rtsp_media_unprepare: + * @media: a #GstRTSPMedia + * + * Unprepare @media. After this call, the media should be prepared again before + * it can be used again. If the media is set to be non-reusable, a new instance + * must be created. + * + * Returns: %TRUE on success. + */ +gboolean +gst_rtsp_media_unprepare (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv; + gboolean success; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + + priv = media->priv; + + g_rec_mutex_lock (&priv->state_lock); + if (priv->status == GST_RTSP_MEDIA_STATUS_UNPREPARED) + goto was_unprepared; + + priv->prepare_count--; + if (priv->prepare_count > 0) + goto is_busy; + + GST_INFO ("unprepare media %p", media); + if (priv->blocked) + media_streams_set_blocked (media, FALSE); + set_target_state (media, GST_STATE_NULL, FALSE); + success = TRUE; + + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_UNPREPARING); + + if (priv->status == GST_RTSP_MEDIA_STATUS_PREPARED) { + GstRTSPMediaClass *klass; + + klass = GST_RTSP_MEDIA_GET_CLASS (media); + if (klass->unprepare) + success = klass->unprepare (media); + } else { + finish_unprepare (media); + } + g_rec_mutex_unlock (&priv->state_lock); + + return success; + +was_unprepared: + { + g_rec_mutex_unlock (&priv->state_lock); + GST_INFO ("media %p was already unprepared", media); + return TRUE; + } +is_busy: + { + GST_INFO ("media %p still prepared %d times", media, priv->prepare_count); + g_rec_mutex_unlock (&priv->state_lock); + return TRUE; + } +} + +/* should be called with state-lock */ +static GstClock * +get_clock_unlocked (GstRTSPMedia * media) +{ + if (media->priv->status != GST_RTSP_MEDIA_STATUS_PREPARED) { + GST_DEBUG_OBJECT (media, "media was not prepared"); + return NULL; + } + return gst_pipeline_get_clock (GST_PIPELINE_CAST (media->priv->pipeline)); +} + +/** + * gst_rtsp_media_get_clock: + * @media: a #GstRTSPMedia + * + * Get the clock that is used by the pipeline in @media. + * + * @media must be prepared before this method returns a valid clock object. + * + * Returns: (transfer full): the #GstClock used by @media. unref after usage. + */ +GstClock * +gst_rtsp_media_get_clock (GstRTSPMedia * media) +{ + GstClock *clock; + GstRTSPMediaPrivate *priv; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL); + + priv = media->priv; + + g_rec_mutex_lock (&priv->state_lock); + clock = get_clock_unlocked (media); + g_rec_mutex_unlock (&priv->state_lock); + + return clock; +} + +/** + * gst_rtsp_media_get_base_time: + * @media: a #GstRTSPMedia + * + * Get the base_time that is used by the pipeline in @media. + * + * @media must be prepared before this method returns a valid base_time. + * + * Returns: the base_time used by @media. + */ +GstClockTime +gst_rtsp_media_get_base_time (GstRTSPMedia * media) +{ + GstClockTime result; + GstRTSPMediaPrivate *priv; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), GST_CLOCK_TIME_NONE); + + priv = media->priv; + + g_rec_mutex_lock (&priv->state_lock); + if (media->priv->status != GST_RTSP_MEDIA_STATUS_PREPARED) + goto not_prepared; + + result = gst_element_get_base_time (media->priv->pipeline); + g_rec_mutex_unlock (&priv->state_lock); + + return result; + + /* ERRORS */ +not_prepared: + { + g_rec_mutex_unlock (&priv->state_lock); + GST_DEBUG_OBJECT (media, "media was not prepared"); + return GST_CLOCK_TIME_NONE; + } +} + +/** + * gst_rtsp_media_get_time_provider: + * @media: a #GstRTSPMedia + * @address: (allow-none): an address or %NULL + * @port: a port or 0 + * + * Get the #GstNetTimeProvider for the clock used by @media. The time provider + * will listen on @address and @port for client time requests. + * + * Returns: (transfer full): the #GstNetTimeProvider of @media. + */ +GstNetTimeProvider * +gst_rtsp_media_get_time_provider (GstRTSPMedia * media, const gchar * address, + guint16 port) +{ + GstRTSPMediaPrivate *priv; + GstNetTimeProvider *provider = NULL; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL); + + priv = media->priv; + + g_rec_mutex_lock (&priv->state_lock); + if (priv->time_provider) { + if ((provider = priv->nettime) == NULL) { + GstClock *clock; + + if (priv->time_provider && (clock = get_clock_unlocked (media))) { + provider = gst_net_time_provider_new (clock, address, port); + gst_object_unref (clock); + + priv->nettime = provider; + } + } + } + g_rec_mutex_unlock (&priv->state_lock); + + if (provider) + gst_object_ref (provider); + + return provider; +} + +static gboolean +default_setup_sdp (GstRTSPMedia * media, GstSDPMessage * sdp, GstSDPInfo * info) +{ + return gst_rtsp_sdp_from_media (sdp, info, media); +} + +/** + * gst_rtsp_media_setup_sdp: + * @media: a #GstRTSPMedia + * @sdp: (transfer none): a #GstSDPMessage + * @info: (transfer none): a #GstSDPInfo + * + * Add @media specific info to @sdp. @info is used to configure the connection + * information in the SDP. + * + * Returns: TRUE on success. + */ +gboolean +gst_rtsp_media_setup_sdp (GstRTSPMedia * media, GstSDPMessage * sdp, + GstSDPInfo * info) +{ + GstRTSPMediaPrivate *priv; + GstRTSPMediaClass *klass; + gboolean res; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + g_return_val_if_fail (sdp != NULL, FALSE); + g_return_val_if_fail (info != NULL, FALSE); + + priv = media->priv; + + g_rec_mutex_lock (&priv->state_lock); + + klass = GST_RTSP_MEDIA_GET_CLASS (media); + + if (!klass->setup_sdp) + goto no_setup_sdp; + + res = klass->setup_sdp (media, sdp, info); + + g_rec_mutex_unlock (&priv->state_lock); + + return res; + + /* ERRORS */ +no_setup_sdp: + { + g_rec_mutex_unlock (&priv->state_lock); + GST_ERROR ("no setup_sdp function"); + g_critical ("no setup_sdp vmethod function set"); + return FALSE; + } +} + +/* call with state_lock */ +gboolean +default_suspend (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + GstStateChangeReturn ret; + + switch (priv->suspend_mode) { + case GST_RTSP_SUSPEND_MODE_NONE: + GST_DEBUG ("media %p no suspend", media); + break; + case GST_RTSP_SUSPEND_MODE_PAUSE: + GST_DEBUG ("media %p suspend to PAUSED", media); + ret = set_target_state (media, GST_STATE_PAUSED, TRUE); + if (ret == GST_STATE_CHANGE_FAILURE) + goto state_failed; + break; + case GST_RTSP_SUSPEND_MODE_RESET: + GST_DEBUG ("media %p suspend to NULL", media); + ret = set_target_state (media, GST_STATE_NULL, TRUE); + if (ret == GST_STATE_CHANGE_FAILURE) + goto state_failed; + break; + default: + break; + } + + /* let the streams do the state changes freely, if any */ + media_streams_set_blocked (media, FALSE); + + return TRUE; + + /* ERRORS */ +state_failed: + { + GST_WARNING ("failed changing pipeline's state for media %p", media); + return FALSE; + } +} + +/** + * gst_rtsp_media_suspend: + * @media: a #GstRTSPMedia + * + * Suspend @media. The state of the pipeline managed by @media is set to + * GST_STATE_NULL but all streams are kept. @media can be prepared again + * with gst_rtsp_media_unsuspend() + * + * @media must be prepared with gst_rtsp_media_prepare(); + * + * Returns: %TRUE on success. + */ +gboolean +gst_rtsp_media_suspend (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + GstRTSPMediaClass *klass; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + + GST_FIXME ("suspend for dynamic pipelines needs fixing"); + + g_rec_mutex_lock (&priv->state_lock); + if (priv->status != GST_RTSP_MEDIA_STATUS_PREPARED) + goto not_prepared; + + /* don't attempt to suspend when something is busy */ + if (priv->n_active > 0) + goto done; + + klass = GST_RTSP_MEDIA_GET_CLASS (media); + if (klass->suspend) { + if (!klass->suspend (media)) + goto suspend_failed; + } + + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_SUSPENDED); +done: + g_rec_mutex_unlock (&priv->state_lock); + + return TRUE; + + /* ERRORS */ +not_prepared: + { + g_rec_mutex_unlock (&priv->state_lock); + GST_WARNING ("media %p was not prepared", media); + return FALSE; + } +suspend_failed: + { + g_rec_mutex_unlock (&priv->state_lock); + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_ERROR); + GST_WARNING ("failed to suspend media %p", media); + return FALSE; + } +} + +/* call with state_lock */ +gboolean +default_unsuspend (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + + switch (priv->suspend_mode) { + case GST_RTSP_SUSPEND_MODE_NONE: + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARED); + break; + case GST_RTSP_SUSPEND_MODE_PAUSE: + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARED); + break; + case GST_RTSP_SUSPEND_MODE_RESET: + { + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARING); + if (!start_preroll (media)) + goto start_failed; + g_rec_mutex_unlock (&priv->state_lock); + + if (!wait_preroll (media)) + goto preroll_failed; + + g_rec_mutex_lock (&priv->state_lock); + } + default: + break; + } + + return TRUE; + + /* ERRORS */ +start_failed: + { + GST_WARNING ("failed to preroll pipeline"); + return FALSE; + } +preroll_failed: + { + GST_WARNING ("failed to preroll pipeline"); + return FALSE; + } +} + +/** + * gst_rtsp_media_unsuspend: + * @media: a #GstRTSPMedia + * + * Unsuspend @media if it was in a suspended state. This method does nothing + * when the media was not in the suspended state. + * + * Returns: %TRUE on success. + */ +gboolean +gst_rtsp_media_unsuspend (GstRTSPMedia * media) +{ + GstRTSPMediaPrivate *priv = media->priv; + GstRTSPMediaClass *klass; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + + g_rec_mutex_lock (&priv->state_lock); + if (priv->status != GST_RTSP_MEDIA_STATUS_SUSPENDED) + goto done; + + klass = GST_RTSP_MEDIA_GET_CLASS (media); + if (klass->unsuspend) { + if (!klass->unsuspend (media)) + goto unsuspend_failed; + } + +done: + g_rec_mutex_unlock (&priv->state_lock); + + return TRUE; + + /* ERRORS */ +unsuspend_failed: + { + g_rec_mutex_unlock (&priv->state_lock); + GST_WARNING ("failed to unsuspend media %p", media); + gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_ERROR); + return FALSE; + } +} + +/* must be called with state-lock */ +static void +media_set_pipeline_state_locked (GstRTSPMedia * media, GstState state) +{ + GstRTSPMediaPrivate *priv = media->priv; + + if (state == GST_STATE_NULL) { + gst_rtsp_media_unprepare (media); + } else { + GST_INFO ("state %s media %p", gst_element_state_get_name (state), media); + set_target_state (media, state, FALSE); + /* when we are buffering, don't update the state yet, this will be done + * when buffering finishes */ + if (priv->buffering) { + GST_INFO ("Buffering busy, delay state change"); + } else { + if (state == GST_STATE_PLAYING) + /* make sure pads are not blocking anymore when going to PLAYING */ + media_streams_set_blocked (media, FALSE); + + set_state (media, state); + + /* and suspend after pause */ + if (state == GST_STATE_PAUSED) + gst_rtsp_media_suspend (media); + } + } +} + +/** + * gst_rtsp_media_set_pipeline_state: + * @media: a #GstRTSPMedia + * @state: the target state of the pipeline + * + * Set the state of the pipeline managed by @media to @state + */ +void +gst_rtsp_media_set_pipeline_state (GstRTSPMedia * media, GstState state) +{ + g_return_if_fail (GST_IS_RTSP_MEDIA (media)); + + g_rec_mutex_lock (&media->priv->state_lock); + media_set_pipeline_state_locked (media, state); + g_rec_mutex_unlock (&media->priv->state_lock); +} + +/** + * gst_rtsp_media_set_state: + * @media: a #GstRTSPMedia + * @state: the target state of the media + * @transports: (transfer none) (element-type GstRtspServer.RTSPStreamTransport): + * a #GPtrArray of #GstRTSPStreamTransport pointers + * + * Set the state of @media to @state and for the transports in @transports. + * + * @media must be prepared with gst_rtsp_media_prepare(); + * + * Returns: %TRUE on success. + */ +gboolean +gst_rtsp_media_set_state (GstRTSPMedia * media, GstState state, + GPtrArray * transports) +{ + GstRTSPMediaPrivate *priv; + gint i; + gboolean activate, deactivate, do_state; + gint old_active; + + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); + g_return_val_if_fail (transports != NULL, FALSE); + + priv = media->priv; + + g_rec_mutex_lock (&priv->state_lock); + if (priv->status == GST_RTSP_MEDIA_STATUS_ERROR) + goto error_status; + if (priv->status != GST_RTSP_MEDIA_STATUS_PREPARED && + priv->status != GST_RTSP_MEDIA_STATUS_SUSPENDED) + goto not_prepared; + + /* NULL and READY are the same */ + if (state == GST_STATE_READY) + state = GST_STATE_NULL; + + activate = deactivate = FALSE; + + GST_INFO ("going to state %s media %p", gst_element_state_get_name (state), + media); + + switch (state) { + case GST_STATE_NULL: + case GST_STATE_PAUSED: + /* we're going from PLAYING to PAUSED, READY or NULL, deactivate */ + if (priv->target_state == GST_STATE_PLAYING) + deactivate = TRUE; + break; + case GST_STATE_PLAYING: + /* we're going to PLAYING, activate */ + activate = TRUE; + break; + default: + break; + } + old_active = priv->n_active; + + for (i = 0; i < transports->len; i++) { + GstRTSPStreamTransport *trans; + + /* we need a non-NULL entry in the array */ + trans = g_ptr_array_index (transports, i); + if (trans == NULL) + continue; + + if (activate) { + if (gst_rtsp_stream_transport_set_active (trans, TRUE)) + priv->n_active++; + } else if (deactivate) { + if (gst_rtsp_stream_transport_set_active (trans, FALSE)) + priv->n_active--; + } + } + + /* we just activated the first media, do the playing state change */ + if (old_active == 0 && activate) + do_state = TRUE; + /* if we have no more active media, do the downward state changes */ + else if (priv->n_active == 0) + do_state = TRUE; + else + do_state = FALSE; + + GST_INFO ("state %d active %d media %p do_state %d", state, priv->n_active, + media, do_state); + + if (priv->target_state != state) { + if (do_state) + media_set_pipeline_state_locked (media, state); + + g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_NEW_STATE], 0, state, + NULL); + } + + /* remember where we are */ + if (state != GST_STATE_NULL && (state == GST_STATE_PAUSED || + old_active != priv->n_active)) + collect_media_stats (media); + + g_rec_mutex_unlock (&priv->state_lock); + + return TRUE; + + /* ERRORS */ +not_prepared: + { + GST_WARNING ("media %p was not prepared", media); + g_rec_mutex_unlock (&priv->state_lock); + return FALSE; + } +error_status: + { + GST_WARNING ("media %p in error status while changing to state %d", + media, state); + if (state == GST_STATE_NULL) { + for (i = 0; i < transports->len; i++) { + GstRTSPStreamTransport *trans; + + /* we need a non-NULL entry in the array */ + trans = g_ptr_array_index (transports, i); + if (trans == NULL) + continue; + + gst_rtsp_stream_transport_set_active (trans, FALSE); + } + priv->n_active = 0; + } + g_rec_mutex_unlock (&priv->state_lock); + return FALSE; + } +} diff --git a/gst/rtsp-server/rtsp-media.h b/gst/rtsp-server/rtsp-media.h new file mode 100644 index 0000000..a78650d --- /dev/null +++ b/gst/rtsp-server/rtsp-media.h @@ -0,0 +1,235 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include +#include +#include + +#ifndef __GST_RTSP_MEDIA_H__ +#define __GST_RTSP_MEDIA_H__ + +G_BEGIN_DECLS + +/* types for the media */ +#define GST_TYPE_RTSP_MEDIA (gst_rtsp_media_get_type ()) +#define GST_IS_RTSP_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_MEDIA)) +#define GST_IS_RTSP_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_MEDIA)) +#define GST_RTSP_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_MEDIA, GstRTSPMediaClass)) +#define GST_RTSP_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_MEDIA, GstRTSPMedia)) +#define GST_RTSP_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_MEDIA, GstRTSPMediaClass)) +#define GST_RTSP_MEDIA_CAST(obj) ((GstRTSPMedia*)(obj)) +#define GST_RTSP_MEDIA_CLASS_CAST(klass) ((GstRTSPMediaClass*)(klass)) + +typedef struct _GstRTSPMedia GstRTSPMedia; +typedef struct _GstRTSPMediaClass GstRTSPMediaClass; +typedef struct _GstRTSPMediaPrivate GstRTSPMediaPrivate; + +/** + * GstRTSPMediaStatus: + * @GST_RTSP_MEDIA_STATUS_UNPREPARED: media pipeline not prerolled + * @GST_RTSP_MEDIA_STATUS_UNPREPARING: media pipeline is busy doing a clean + * shutdown. + * @GST_RTSP_MEDIA_STATUS_PREPARING: media pipeline is prerolling + * @GST_RTSP_MEDIA_STATUS_PREPARED: media pipeline is prerolled + * @GST_RTSP_MEDIA_STATUS_SUSPENDED: media is suspended + * @GST_RTSP_MEDIA_STATUS_ERROR: media pipeline is in error + * + * The state of the media pipeline. + */ +typedef enum { + GST_RTSP_MEDIA_STATUS_UNPREPARED = 0, + GST_RTSP_MEDIA_STATUS_UNPREPARING = 1, + GST_RTSP_MEDIA_STATUS_PREPARING = 2, + GST_RTSP_MEDIA_STATUS_PREPARED = 3, + GST_RTSP_MEDIA_STATUS_SUSPENDED = 4, + GST_RTSP_MEDIA_STATUS_ERROR = 5 +} GstRTSPMediaStatus; + +/** + * GstRTSPSuspendMode: + * @GST_RTSP_SUSPEND_MODE_NONE: Media is not suspended + * @GST_RTSP_SUSPEND_MODE_PAUSE: Media is PAUSED in suspend + * @GST_RTSP_SUSPEND_MODE_RESET: The media is set to NULL when suspended + * + * The suspend mode of the media pipeline. A media pipeline is suspended right + * after creating the SDP and when the client performs a PAUSED request. + */ +typedef enum { + GST_RTSP_SUSPEND_MODE_NONE = 0, + GST_RTSP_SUSPEND_MODE_PAUSE = 1, + GST_RTSP_SUSPEND_MODE_RESET = 2 +} GstRTSPSuspendMode; + +#define GST_TYPE_RTSP_SUSPEND_MODE (gst_rtsp_suspend_mode_get_type()) +GType gst_rtsp_suspend_mode_get_type (void); + +#include "rtsp-stream.h" +#include "rtsp-thread-pool.h" +#include "rtsp-permissions.h" +#include "rtsp-address-pool.h" +#include "rtsp-sdp.h" + +/** + * GstRTSPMedia: + * + * A class that contains the GStreamer element along with a list of + * #GstRTSPStream objects that can produce data. + * + * This object is usually created from a #GstRTSPMediaFactory. + */ +struct _GstRTSPMedia { + GObject parent; + + /*< private >*/ + GstRTSPMediaPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPMediaClass: + * @handle_message: handle a message + * @prepare: the default implementation adds all elements and sets the + * pipeline's state to GST_STATE_PAUSED (or GST_STATE_PLAYING + * in case of NO_PREROLL elements). + * @unprepare: the default implementation sets the pipeline's state + * to GST_STATE_NULL and removes all elements. + * @suspend: the default implementation sets the pipeline's state to + * GST_STATE_NULL GST_STATE_PAUSED depending on the selected + * suspend mode. + * @unsuspend: the default implementation reverts the suspend operation. + * The pipeline will be prerolled again if it's state was + * set to GST_STATE_NULL in suspend. + * @convert_range: convert a range to the given unit + * @query_position: query the current position in the pipeline + * @query_stop: query when playback will stop + * + * The RTSP media class + */ +struct _GstRTSPMediaClass { + GObjectClass parent_class; + + /* vmethods */ + gboolean (*handle_message) (GstRTSPMedia *media, GstMessage *message); + gboolean (*prepare) (GstRTSPMedia *media, GstRTSPThread *thread); + gboolean (*unprepare) (GstRTSPMedia *media); + gboolean (*suspend) (GstRTSPMedia *media); + gboolean (*unsuspend) (GstRTSPMedia *media); + gboolean (*convert_range) (GstRTSPMedia *media, GstRTSPTimeRange *range, + GstRTSPRangeUnit unit); + gboolean (*query_position) (GstRTSPMedia *media, gint64 *position); + gboolean (*query_stop) (GstRTSPMedia *media, gint64 *stop); + GstElement * (*create_rtpbin) (GstRTSPMedia *media); + gboolean (*setup_rtpbin) (GstRTSPMedia *media, GstElement *rtpbin); + gboolean (*setup_sdp) (GstRTSPMedia *media, GstSDPMessage *sdp, GstSDPInfo *info); + + /* signals */ + void (*new_stream) (GstRTSPMedia *media, GstRTSPStream * stream); + void (*removed_stream) (GstRTSPMedia *media, GstRTSPStream * stream); + + void (*prepared) (GstRTSPMedia *media); + void (*unprepared) (GstRTSPMedia *media); + + void (*target_state) (GstRTSPMedia *media, GstState state); + void (*new_state) (GstRTSPMedia *media, GstState state); + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING_LARGE]; +}; + +GType gst_rtsp_media_get_type (void); + +/* creating the media */ +GstRTSPMedia * gst_rtsp_media_new (GstElement *element); +GstElement * gst_rtsp_media_get_element (GstRTSPMedia *media); + +void gst_rtsp_media_take_pipeline (GstRTSPMedia *media, GstPipeline *pipeline); + +GstRTSPMediaStatus gst_rtsp_media_get_status (GstRTSPMedia *media); + +void gst_rtsp_media_set_permissions (GstRTSPMedia *media, + GstRTSPPermissions *permissions); +GstRTSPPermissions * gst_rtsp_media_get_permissions (GstRTSPMedia *media); + +void gst_rtsp_media_set_shared (GstRTSPMedia *media, gboolean shared); +gboolean gst_rtsp_media_is_shared (GstRTSPMedia *media); + +void gst_rtsp_media_set_reusable (GstRTSPMedia *media, gboolean reusable); +gboolean gst_rtsp_media_is_reusable (GstRTSPMedia *media); + +void gst_rtsp_media_set_profiles (GstRTSPMedia *media, GstRTSPProfile profiles); +GstRTSPProfile gst_rtsp_media_get_profiles (GstRTSPMedia *media); + +void gst_rtsp_media_set_protocols (GstRTSPMedia *media, GstRTSPLowerTrans protocols); +GstRTSPLowerTrans gst_rtsp_media_get_protocols (GstRTSPMedia *media); + +void gst_rtsp_media_set_eos_shutdown (GstRTSPMedia *media, gboolean eos_shutdown); +gboolean gst_rtsp_media_is_eos_shutdown (GstRTSPMedia *media); + +void gst_rtsp_media_set_address_pool (GstRTSPMedia *media, GstRTSPAddressPool *pool); +GstRTSPAddressPool * gst_rtsp_media_get_address_pool (GstRTSPMedia *media); + +void gst_rtsp_media_set_buffer_size (GstRTSPMedia *media, guint size); +guint gst_rtsp_media_get_buffer_size (GstRTSPMedia *media); + +void gst_rtsp_media_use_time_provider (GstRTSPMedia *media, gboolean time_provider); +gboolean gst_rtsp_media_is_time_provider (GstRTSPMedia *media); +GstNetTimeProvider * gst_rtsp_media_get_time_provider (GstRTSPMedia *media, + const gchar *address, guint16 port); + +/* prepare the media for playback */ +gboolean gst_rtsp_media_prepare (GstRTSPMedia *media, GstRTSPThread *thread); +gboolean gst_rtsp_media_unprepare (GstRTSPMedia *media); + +void gst_rtsp_media_set_suspend_mode (GstRTSPMedia *media, GstRTSPSuspendMode mode); +GstRTSPSuspendMode gst_rtsp_media_get_suspend_mode (GstRTSPMedia *media); + +gboolean gst_rtsp_media_suspend (GstRTSPMedia *media); +gboolean gst_rtsp_media_unsuspend (GstRTSPMedia *media); + +gboolean gst_rtsp_media_setup_sdp (GstRTSPMedia * media, GstSDPMessage * sdp, + GstSDPInfo * info); + +/* creating streams */ +void gst_rtsp_media_collect_streams (GstRTSPMedia *media); +GstRTSPStream * gst_rtsp_media_create_stream (GstRTSPMedia *media, + GstElement *payloader, + GstPad *srcpad); + +/* dealing with the media */ +GstClock * gst_rtsp_media_get_clock (GstRTSPMedia *media); +GstClockTime gst_rtsp_media_get_base_time (GstRTSPMedia *media); + +guint gst_rtsp_media_n_streams (GstRTSPMedia *media); +GstRTSPStream * gst_rtsp_media_get_stream (GstRTSPMedia *media, guint idx); +GstRTSPStream * gst_rtsp_media_find_stream (GstRTSPMedia *media, const gchar * control); + +gboolean gst_rtsp_media_seek (GstRTSPMedia *media, GstRTSPTimeRange *range); +gchar * gst_rtsp_media_get_range_string (GstRTSPMedia *media, + gboolean play, + GstRTSPRangeUnit unit); + +gboolean gst_rtsp_media_set_state (GstRTSPMedia *media, GstState state, + GPtrArray *transports); +void gst_rtsp_media_set_pipeline_state (GstRTSPMedia * media, + GstState state); + +G_END_DECLS + +#endif /* __GST_RTSP_MEDIA_H__ */ diff --git a/gst/rtsp-server/rtsp-mount-points.c b/gst/rtsp-server/rtsp-mount-points.c new file mode 100644 index 0000000..c6a8c06 --- /dev/null +++ b/gst/rtsp-server/rtsp-mount-points.c @@ -0,0 +1,370 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-mount-points + * @short_description: Map a path to media + * @see_also: #GstRTSPMediaFactory, #GstRTSPClient + * + * A #GstRTSPMountPoints object maintains a relation between paths + * and #GstRTSPMediaFactory objects. This object is usually given to + * #GstRTSPClient and used to find the media attached to a path. + * + * With gst_rtsp_mount_points_add_factory () and + * gst_rtsp_mount_points_remove_factory(), factories can be added and + * removed. + * + * With gst_rtsp_mount_points_match() you can find the #GstRTSPMediaFactory + * object that completely matches the given path. + * + * Last reviewed on 2013-07-11 (1.0.0) + */ +#include + +#include "rtsp-mount-points.h" + +#define GST_RTSP_MOUNT_POINTS_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_MOUNT_POINTS, GstRTSPMountPointsPrivate)) + +typedef struct +{ + gchar *path; + gint len; + GstRTSPMediaFactory *factory; +} DataItem; + +static DataItem * +data_item_new (gchar * path, gint len, GstRTSPMediaFactory * factory) +{ + DataItem *item; + + item = g_slice_alloc (sizeof (DataItem)); + item->path = path; + item->len = len; + item->factory = factory; + + return item; +} + +static void +data_item_free (gpointer data) +{ + DataItem *item = data; + + g_free (item->path); + g_object_unref (item->factory); + g_slice_free1 (sizeof (DataItem), item); +} + +static void +data_item_dump (gconstpointer a, gconstpointer prefix) +{ + const DataItem *item = a; + + GST_DEBUG ("%s%s %p", (gchar *) prefix, item->path, item->factory); +} + +static gint +data_item_compare (gconstpointer a, gconstpointer b, gpointer user_data) +{ + const DataItem *item1 = a, *item2 = b; + gint res; + + res = g_strcmp0 (item1->path, item2->path); + + return res; +} + +struct _GstRTSPMountPointsPrivate +{ + GMutex lock; + GSequence *mounts; /* protected by lock */ + gboolean dirty; +}; + +G_DEFINE_TYPE (GstRTSPMountPoints, gst_rtsp_mount_points, G_TYPE_OBJECT); + +GST_DEBUG_CATEGORY_STATIC (rtsp_media_debug); +#define GST_CAT_DEFAULT rtsp_media_debug + +static gchar *default_make_path (GstRTSPMountPoints * mounts, + const GstRTSPUrl * url); +static void gst_rtsp_mount_points_finalize (GObject * obj); + +static void +gst_rtsp_mount_points_class_init (GstRTSPMountPointsClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPMountPointsPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = gst_rtsp_mount_points_finalize; + + klass->make_path = default_make_path; + + GST_DEBUG_CATEGORY_INIT (rtsp_media_debug, "rtspmountpoints", 0, + "GstRTSPMountPoints"); +} + +static void +gst_rtsp_mount_points_init (GstRTSPMountPoints * mounts) +{ + GstRTSPMountPointsPrivate *priv = GST_RTSP_MOUNT_POINTS_GET_PRIVATE (mounts); + + GST_DEBUG_OBJECT (mounts, "created"); + + mounts->priv = priv; + + g_mutex_init (&priv->lock); + priv->mounts = g_sequence_new (data_item_free); + priv->dirty = FALSE; +} + +static void +gst_rtsp_mount_points_finalize (GObject * obj) +{ + GstRTSPMountPoints *mounts = GST_RTSP_MOUNT_POINTS (obj); + GstRTSPMountPointsPrivate *priv = mounts->priv; + + GST_DEBUG_OBJECT (mounts, "finalized"); + + g_sequence_free (priv->mounts); + g_mutex_clear (&priv->lock); + + G_OBJECT_CLASS (gst_rtsp_mount_points_parent_class)->finalize (obj); +} + +/** + * gst_rtsp_mount_points_new: + * + * Make a new mount points object. + * + * Returns: (transfer full): a new #GstRTSPMountPoints + */ +GstRTSPMountPoints * +gst_rtsp_mount_points_new (void) +{ + GstRTSPMountPoints *result; + + result = g_object_new (GST_TYPE_RTSP_MOUNT_POINTS, NULL); + + return result; +} + +static gchar * +default_make_path (GstRTSPMountPoints * mounts, const GstRTSPUrl * url) +{ + return g_strdup (url->abspath); +} + +/** + * gst_rtsp_mount_points_make_path: + * @mounts: a #GstRTSPMountPoints + * @url: a #GstRTSPUrl + * + * Make a path string from @url. + * + * Returns: (transfer full): a path string for @url, g_free() after usage. + */ +gchar * +gst_rtsp_mount_points_make_path (GstRTSPMountPoints * mounts, + const GstRTSPUrl * url) +{ + GstRTSPMountPointsClass *klass; + gchar *result; + + g_return_val_if_fail (GST_IS_RTSP_MOUNT_POINTS (mounts), NULL); + g_return_val_if_fail (url != NULL, NULL); + + klass = GST_RTSP_MOUNT_POINTS_GET_CLASS (mounts); + + if (klass->make_path) + result = klass->make_path (mounts, url); + else + result = NULL; + + return result; +} + +static gboolean +has_prefix (DataItem * str, DataItem * prefix) +{ + /* prefix needs to be smaller than str */ + if (str->len < prefix->len) + return FALSE; + + /* if str is larger, it there should be a / following the prefix */ + if (str->len > prefix->len && str->path[prefix->len] != '/') + return FALSE; + + return strncmp (str->path, prefix->path, prefix->len) == 0; +} + +/** + * gst_rtsp_mount_points_match: + * @mounts: a #GstRTSPMountPoints + * @path: a mount point + * @matched: (out) (allow-none): the amount of @path matched + * + * Find the factory in @mounts that has the longest match with @path. + * + * If @matched is %NULL, @path will match the factory exactly otherwise + * the amount of characters that matched is returned in @matched. + * + * Returns: (transfer full): the #GstRTSPMediaFactory for @path. + * g_object_unref() after usage. + */ +GstRTSPMediaFactory * +gst_rtsp_mount_points_match (GstRTSPMountPoints * mounts, + const gchar * path, gint * matched) +{ + GstRTSPMountPointsPrivate *priv; + GstRTSPMediaFactory *result = NULL; + GSequenceIter *iter, *best; + DataItem item, *ritem; + + g_return_val_if_fail (GST_IS_RTSP_MOUNT_POINTS (mounts), NULL); + g_return_val_if_fail (path != NULL, NULL); + + priv = mounts->priv; + + item.path = (gchar *) path; + item.len = strlen (path); + + g_mutex_lock (&priv->lock); + if (priv->dirty) { + g_sequence_sort (priv->mounts, data_item_compare, mounts); + g_sequence_foreach (priv->mounts, (GFunc) data_item_dump, + (gpointer) "sort :"); + priv->dirty = FALSE; + } + + /* find the location of the media in the hashtable we only use the absolute + * path of the uri to find a media factory. If the factory depends on other + * properties found in the url, this method should be overridden. */ + iter = g_sequence_get_begin_iter (priv->mounts); + best = NULL; + while (!g_sequence_iter_is_end (iter)) { + ritem = g_sequence_get (iter); + + data_item_dump (ritem, "inspect: "); + + if (best == NULL) { + if (has_prefix (&item, ritem)) { + data_item_dump (ritem, "prefix: "); + best = iter; + } + } else { + if (!has_prefix (&item, ritem)) + break; + + best = iter; + data_item_dump (ritem, "new best: "); + } + iter = g_sequence_iter_next (iter); + } + if (best) { + ritem = g_sequence_get (best); + data_item_dump (ritem, "result: "); + if (matched || ritem->len == item.len) { + result = g_object_ref (ritem->factory); + if (matched) + *matched = ritem->len; + } + } + g_mutex_unlock (&priv->lock); + + GST_INFO ("found media factory %p for path %s", result, path); + + return result; +} + +/** + * gst_rtsp_mount_points_add_factory: + * @mounts: a #GstRTSPMountPoints + * @path: a mount point + * @factory: (transfer full): a #GstRTSPMediaFactory + * + * Attach @factory to the mount point @path in @mounts. + * + * @path is of the form (/node)+. Any previous mount point will be freed. + * + * Ownership is taken of the reference on @factory so that @factory should not be + * used after calling this function. + */ +void +gst_rtsp_mount_points_add_factory (GstRTSPMountPoints * mounts, + const gchar * path, GstRTSPMediaFactory * factory) +{ + GstRTSPMountPointsPrivate *priv; + DataItem *item; + + g_return_if_fail (GST_IS_RTSP_MOUNT_POINTS (mounts)); + g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory)); + g_return_if_fail (path != NULL); + + priv = mounts->priv; + + item = data_item_new (g_strdup (path), strlen (path), factory); + + GST_INFO ("adding media factory %p for path %s", factory, path); + + g_mutex_lock (&priv->lock); + g_sequence_append (priv->mounts, item); + priv->dirty = TRUE; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_mount_points_remove_factory: + * @mounts: a #GstRTSPMountPoints + * @path: a mount point + * + * Remove the #GstRTSPMediaFactory associated with @path in @mounts. + */ +void +gst_rtsp_mount_points_remove_factory (GstRTSPMountPoints * mounts, + const gchar * path) +{ + GstRTSPMountPointsPrivate *priv; + DataItem item; + GSequenceIter *iter; + + g_return_if_fail (GST_IS_RTSP_MOUNT_POINTS (mounts)); + g_return_if_fail (path != NULL); + + priv = mounts->priv; + + item.path = (gchar *) path; + + GST_INFO ("removing media factory for path %s", path); + + g_mutex_lock (&priv->lock); + if (priv->dirty) { + g_sequence_sort (priv->mounts, data_item_compare, mounts); + priv->dirty = FALSE; + } + iter = g_sequence_lookup (priv->mounts, &item, data_item_compare, mounts); + if (iter) { + g_sequence_remove (iter); + priv->dirty = TRUE; + } + g_mutex_unlock (&priv->lock); +} diff --git a/gst/rtsp-server/rtsp-mount-points.h b/gst/rtsp-server/rtsp-mount-points.h new file mode 100644 index 0000000..ed13d59 --- /dev/null +++ b/gst/rtsp-server/rtsp-mount-points.h @@ -0,0 +1,91 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include "rtsp-media-factory.h" + +#ifndef __GST_RTSP_MOUNT_POINTS_H__ +#define __GST_RTSP_MOUNT_POINTS_H__ + +G_BEGIN_DECLS + +#define GST_TYPE_RTSP_MOUNT_POINTS (gst_rtsp_mount_points_get_type ()) +#define GST_IS_RTSP_MOUNT_POINTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_MOUNT_POINTS)) +#define GST_IS_RTSP_MOUNT_POINTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_MOUNT_POINTS)) +#define GST_RTSP_MOUNT_POINTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_MOUNT_POINTS, GstRTSPMountPointsClass)) +#define GST_RTSP_MOUNT_POINTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_MOUNT_POINTS, GstRTSPMountPoints)) +#define GST_RTSP_MOUNT_POINTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_MOUNT_POINTS, GstRTSPMountPointsClass)) +#define GST_RTSP_MOUNT_POINTS_CAST(obj) ((GstRTSPMountPoints*)(obj)) +#define GST_RTSP_MOUNT_POINTS_CLASS_CAST(klass) ((GstRTSPMountPointsClass*)(klass)) + +typedef struct _GstRTSPMountPoints GstRTSPMountPoints; +typedef struct _GstRTSPMountPointsClass GstRTSPMountPointsClass; +typedef struct _GstRTSPMountPointsPrivate GstRTSPMountPointsPrivate; + +/** + * GstRTSPMountPoints: + * + * Creates a #GstRTSPMediaFactory object for a given url. + */ +struct _GstRTSPMountPoints { + GObject parent; + + /*< private >*/ + GstRTSPMountPointsPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPMountPointsClass: + * @make_path: make a path from the given url. + * + * The class for the media mounts object. + */ +struct _GstRTSPMountPointsClass { + GObjectClass parent_class; + + gchar * (*make_path) (GstRTSPMountPoints *mounts, + const GstRTSPUrl *url); + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +GType gst_rtsp_mount_points_get_type (void); + +/* creating a mount points */ +GstRTSPMountPoints * gst_rtsp_mount_points_new (void); + +gchar * gst_rtsp_mount_points_make_path (GstRTSPMountPoints *mounts, + const GstRTSPUrl * url); +/* finding a media factory */ +GstRTSPMediaFactory * gst_rtsp_mount_points_match (GstRTSPMountPoints *mounts, + const gchar *path, + gint * matched); +/* managing media to a mount point */ +void gst_rtsp_mount_points_add_factory (GstRTSPMountPoints *mounts, + const gchar *path, + GstRTSPMediaFactory *factory); +void gst_rtsp_mount_points_remove_factory (GstRTSPMountPoints *mounts, + const gchar *path); + +G_END_DECLS + +#endif /* __GST_RTSP_MOUNT_POINTS_H__ */ diff --git a/gst/rtsp-server/rtsp-params.c b/gst/rtsp-server/rtsp-params.c new file mode 100644 index 0000000..6025722 --- /dev/null +++ b/gst/rtsp-server/rtsp-params.c @@ -0,0 +1,77 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-params + * @short_description: Param get and set implementation + * @see_also: #GstRTSPClient + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include + +#include "rtsp-params.h" + +/** + * gst_rtsp_params_set: + * @client: a #GstRTSPClient + * @ctx: (transfer none): a #GstRTSPContext + * + * Set parameters (not implemented yet) + * + * Returns: a #GstRTSPResult + */ +GstRTSPResult +gst_rtsp_params_set (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPStatusCode code; + + /* FIXME, actually parse the request based on the mime type and try to repond + * with a list of the parameters */ + code = GST_RTSP_STS_PARAMETER_NOT_UNDERSTOOD; + + gst_rtsp_message_init_response (ctx->response, code, + gst_rtsp_status_as_text (code), ctx->request); + + return GST_RTSP_OK; +} + +/** + * gst_rtsp_params_get: + * @client: a #GstRTSPClient + * @ctx: (transfer none): a #GstRTSPContext + * + * Get parameters (not implemented yet) + * + * Returns: a #GstRTSPResult + */ +GstRTSPResult +gst_rtsp_params_get (GstRTSPClient * client, GstRTSPContext * ctx) +{ + GstRTSPStatusCode code; + + /* FIXME, actually parse the request based on the mime type and try to repond + * with a list of the parameters */ + code = GST_RTSP_STS_PARAMETER_NOT_UNDERSTOOD; + + gst_rtsp_message_init_response (ctx->response, code, + gst_rtsp_status_as_text (code), ctx->request); + + return GST_RTSP_OK; +} diff --git a/gst/rtsp-server/rtsp-params.h b/gst/rtsp-server/rtsp-params.h new file mode 100644 index 0000000..563757d --- /dev/null +++ b/gst/rtsp-server/rtsp-params.h @@ -0,0 +1,38 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include +#include + +#ifndef __GST_RTSP_PARAMS_H__ +#define __GST_RTSP_PARAMS_H__ + +#include "rtsp-client.h" +#include "rtsp-session.h" + +G_BEGIN_DECLS + +GstRTSPResult gst_rtsp_params_set (GstRTSPClient * client, GstRTSPContext * ctx); +GstRTSPResult gst_rtsp_params_get (GstRTSPClient * client, GstRTSPContext * ctx); + +G_END_DECLS + +#endif /* __GST_RTSP_PARAMS_H__ */ diff --git a/gst/rtsp-server/rtsp-permissions.c b/gst/rtsp-server/rtsp-permissions.c new file mode 100644 index 0000000..66e9e44 --- /dev/null +++ b/gst/rtsp-server/rtsp-permissions.c @@ -0,0 +1,276 @@ +/* GStreamer + * Copyright (C) 2013 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-permissions + * @short_description: Roles and associated permissions + * @see_also: #GstRTSPToken, #GstRTSPAuth + * + * The #GstRTSPPermissions object contains an array of roles and associated + * permissions. The roles are represented with a string and the permissions with + * a generic #GstStructure. + * + * The permissions are deliberately kept generic. The possible values of the + * roles and #GstStructure keys and values are only determined by the #GstRTSPAuth + * object that performs the checks on the permissions and the current + * #GstRTSPToken. + * + * As a convenience function, gst_rtsp_permissions_is_allowed() can be used to + * check if the permissions contains a role that contains the boolean value + * %TRUE for the the given key. + * + * Last reviewed on 2013-07-15 (1.0.0) + */ + +#include + +#include "rtsp-permissions.h" + +typedef struct _GstRTSPPermissionsImpl +{ + GstRTSPPermissions permissions; + + /* Roles, array of GstStructure */ + GPtrArray *roles; +} GstRTSPPermissionsImpl; + +static void +free_structure (GstStructure * structure) +{ + gst_structure_set_parent_refcount (structure, NULL); + gst_structure_free (structure); +} + +//GST_DEBUG_CATEGORY_STATIC (rtsp_permissions_debug); +//#define GST_CAT_DEFAULT rtsp_permissions_debug + +GST_DEFINE_MINI_OBJECT_TYPE (GstRTSPPermissions, gst_rtsp_permissions); + +static void gst_rtsp_permissions_init (GstRTSPPermissionsImpl * permissions); + +static void +_gst_rtsp_permissions_free (GstRTSPPermissions * permissions) +{ + GstRTSPPermissionsImpl *impl = (GstRTSPPermissionsImpl *) permissions; + + g_ptr_array_free (impl->roles, TRUE); + + g_slice_free1 (sizeof (GstRTSPPermissionsImpl), permissions); +} + +static GstRTSPPermissions * +_gst_rtsp_permissions_copy (GstRTSPPermissionsImpl * permissions) +{ + GstRTSPPermissionsImpl *copy; + guint i; + + copy = (GstRTSPPermissionsImpl *) gst_rtsp_permissions_new (); + + for (i = 0; i < permissions->roles->len; i++) { + GstStructure *entry = g_ptr_array_index (permissions->roles, i); + GstStructure *entry_copy = gst_structure_copy (entry); + + gst_structure_set_parent_refcount (entry_copy, + ©->permissions.mini_object.refcount); + g_ptr_array_add (copy->roles, entry_copy); + } + + return GST_RTSP_PERMISSIONS (copy); +} + +static void +gst_rtsp_permissions_init (GstRTSPPermissionsImpl * permissions) +{ + gst_mini_object_init (GST_MINI_OBJECT_CAST (permissions), 0, + GST_TYPE_RTSP_PERMISSIONS, + (GstMiniObjectCopyFunction) _gst_rtsp_permissions_copy, NULL, + (GstMiniObjectFreeFunction) _gst_rtsp_permissions_free); + + permissions->roles = + g_ptr_array_new_with_free_func ((GDestroyNotify) free_structure); +} + +/** + * gst_rtsp_permissions_new: + * + * Create a new empty Authorization permissions. + * + * Returns: (transfer full): a new empty authorization permissions. + */ +GstRTSPPermissions * +gst_rtsp_permissions_new (void) +{ + GstRTSPPermissionsImpl *permissions; + + permissions = g_slice_new0 (GstRTSPPermissionsImpl); + gst_rtsp_permissions_init (permissions); + + return GST_RTSP_PERMISSIONS (permissions); +} + +/** + * gst_rtsp_permissions_add_role: + * @permissions: a #GstRTSPPermissions + * @role: a role + * @fieldname: the first field name + * @...: additional arguments + * + * Add a new @role to @permissions with the given variables. The fields + * are the same layout as gst_structure_new(). + */ +void +gst_rtsp_permissions_add_role (GstRTSPPermissions * permissions, + const gchar * role, const gchar * fieldname, ...) +{ + va_list var_args; + + va_start (var_args, fieldname); + gst_rtsp_permissions_add_role_valist (permissions, role, fieldname, var_args); + va_end (var_args); +} + +/** + * gst_rtsp_permissions_add_role_valist: + * @permissions: a #GstRTSPPermissions + * @role: a role + * @fieldname: the first field name + * @var_args: additional fields to add + * + * Add a new @role to @permissions with the given variables. Structure fields + * are set according to the varargs in a manner similar to gst_structure_new(). + */ +void +gst_rtsp_permissions_add_role_valist (GstRTSPPermissions * permissions, + const gchar * role, const gchar * fieldname, va_list var_args) +{ + GstRTSPPermissionsImpl *impl = (GstRTSPPermissionsImpl *) permissions; + GstStructure *structure; + guint i, len; + + g_return_if_fail (GST_IS_RTSP_PERMISSIONS (permissions)); + g_return_if_fail (gst_mini_object_is_writable (&permissions->mini_object)); + g_return_if_fail (role != NULL); + g_return_if_fail (fieldname != NULL); + + structure = gst_structure_new_valist (role, fieldname, var_args); + g_return_if_fail (structure != NULL); + + len = impl->roles->len; + for (i = 0; i < len; i++) { + GstStructure *entry = g_ptr_array_index (impl->roles, i); + + if (gst_structure_has_name (entry, role)) { + g_ptr_array_remove_index_fast (impl->roles, i); + break; + } + } + + gst_structure_set_parent_refcount (structure, + &impl->permissions.mini_object.refcount); + g_ptr_array_add (impl->roles, structure); +} + +/** + * gst_rtsp_permissions_remove_role: + * @permissions: a #GstRTSPPermissions + * @role: a role + * + * Remove all permissions for @role in @permissions. + */ +void +gst_rtsp_permissions_remove_role (GstRTSPPermissions * permissions, + const gchar * role) +{ + GstRTSPPermissionsImpl *impl = (GstRTSPPermissionsImpl *) permissions; + guint i, len; + + g_return_if_fail (GST_IS_RTSP_PERMISSIONS (permissions)); + g_return_if_fail (gst_mini_object_is_writable (&permissions->mini_object)); + g_return_if_fail (role != NULL); + + len = impl->roles->len; + for (i = 0; i < len; i++) { + GstStructure *entry = g_ptr_array_index (impl->roles, i); + + if (gst_structure_has_name (entry, role)) { + g_ptr_array_remove_index_fast (impl->roles, i); + break; + } + } +} + +/** + * gst_rtsp_permissions_get_role: + * @permissions: a #GstRTSPPermissions + * @role: a role + * + * Get all permissions for @role in @permissions. + * + * Returns: (transfer none): the structure with permissions for @role. It + * remains valid for as long as @permissions is valid. + */ +const GstStructure * +gst_rtsp_permissions_get_role (GstRTSPPermissions * permissions, + const gchar * role) +{ + GstRTSPPermissionsImpl *impl = (GstRTSPPermissionsImpl *) permissions; + guint i, len; + + g_return_val_if_fail (GST_IS_RTSP_PERMISSIONS (permissions), NULL); + g_return_val_if_fail (role != NULL, NULL); + + len = impl->roles->len; + for (i = 0; i < len; i++) { + GstStructure *entry = g_ptr_array_index (impl->roles, i); + + if (gst_structure_has_name (entry, role)) + return entry; + } + return NULL; +} + +/** + * gst_rtsp_permissions_is_allowed: + * @permissions: a #GstRTSPPermissions + * @role: a role + * @permission: a permission + * + * Check if @role in @permissions is given permission for @permission. + * + * Returns: %TRUE if @role is allowed @permission. + */ +gboolean +gst_rtsp_permissions_is_allowed (GstRTSPPermissions * permissions, + const gchar * role, const gchar * permission) +{ + const GstStructure *str; + gboolean result; + + g_return_val_if_fail (GST_IS_RTSP_PERMISSIONS (permissions), FALSE); + g_return_val_if_fail (role != NULL, FALSE); + g_return_val_if_fail (permission != NULL, FALSE); + + str = gst_rtsp_permissions_get_role (permissions, role); + if (str == NULL) + return FALSE; + + if (!gst_structure_get_boolean (str, permission, &result)) + result = FALSE; + + return result; +} diff --git a/gst/rtsp-server/rtsp-permissions.h b/gst/rtsp-server/rtsp-permissions.h new file mode 100644 index 0000000..9e739c7 --- /dev/null +++ b/gst/rtsp-server/rtsp-permissions.h @@ -0,0 +1,101 @@ +/* GStreamer + * Copyright (C) 2010 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#ifndef __GST_RTSP_PERMISSIONS_H__ +#define __GST_RTSP_PERMISSIONS_H__ + +typedef struct _GstRTSPPermissions GstRTSPPermissions; + +G_BEGIN_DECLS + +GType gst_rtsp_permissions_get_type (void); + +#define GST_TYPE_RTSP_PERMISSIONS (gst_rtsp_permissions_get_type ()) +#define GST_IS_RTSP_PERMISSIONS(obj) (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_RTSP_PERMISSIONS)) +#define GST_RTSP_PERMISSIONS_CAST(obj) ((GstRTSPPermissions*)(obj)) +#define GST_RTSP_PERMISSIONS(obj) (GST_RTSP_PERMISSIONS_CAST(obj)) + +/** + * GstRTSPPermissions: + * + * The opaque permissions structure. It is used to define the permissions + * of objects in different roles. + */ +struct _GstRTSPPermissions { + GstMiniObject mini_object; +}; + +/* refcounting */ +/** + * gst_rtsp_permissions_ref: + * @permissions: The permissions to refcount + * + * Increase the refcount of this permissions. + * + * Returns: (transfer full): @permissions (for convenience when doing assignments) + */ +#ifdef _FOOL_GTK_DOC_ +G_INLINE_FUNC GstRTSPPermissions * gst_rtsp_permissions_ref (GstRTSPPermissions * permissions); +#endif + +static inline GstRTSPPermissions * +gst_rtsp_permissions_ref (GstRTSPPermissions * permissions) +{ + return (GstRTSPPermissions *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (permissions)); +} + +/** + * gst_rtsp_permissions_unref: + * @permissions: (transfer full): the permissions to refcount + * + * Decrease the refcount of an permissions, freeing it if the refcount reaches 0. + */ +#ifdef _FOOL_GTK_DOC_ +G_INLINE_FUNC void gst_rtsp_permissions_unref (GstRTSPPermissions * permissions); +#endif + +static inline void +gst_rtsp_permissions_unref (GstRTSPPermissions * permissions) +{ + gst_mini_object_unref (GST_MINI_OBJECT_CAST (permissions)); +} + + +GstRTSPPermissions * gst_rtsp_permissions_new (void); + +void gst_rtsp_permissions_add_role (GstRTSPPermissions *permissions, + const gchar *role, + const gchar *fieldname, ...); +void gst_rtsp_permissions_add_role_valist (GstRTSPPermissions *permissions, + const gchar *role, + const gchar *fieldname, + va_list var_args); +void gst_rtsp_permissions_remove_role (GstRTSPPermissions *permissions, + const gchar *role); +const GstStructure * gst_rtsp_permissions_get_role (GstRTSPPermissions *permissions, + const gchar *role); + +gboolean gst_rtsp_permissions_is_allowed (GstRTSPPermissions *permissions, + const gchar *role, const gchar *permission); + +G_END_DECLS + +#endif /* __GST_RTSP_PERMISSIONS_H__ */ diff --git a/gst/rtsp-server/rtsp-sdp.c b/gst/rtsp-server/rtsp-sdp.c new file mode 100644 index 0000000..07aea90 --- /dev/null +++ b/gst/rtsp-server/rtsp-sdp.c @@ -0,0 +1,482 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-sdp + * @short_description: Make SDP messages + * @see_also: #GstRTSPMedia + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include + +#include + +#include "rtsp-sdp.h" + +#define AES_128_KEY_LEN 16 +#define AES_256_KEY_LEN 32 + +#define HMAC_32_KEY_LEN 4 +#define HMAC_80_KEY_LEN 10 + +static gboolean +get_info_from_tags (GstPad * pad, GstEvent ** event, gpointer user_data) +{ + GstSDPMedia *media = (GstSDPMedia *) user_data; + + if (GST_EVENT_TYPE (*event) == GST_EVENT_TAG) { + GstTagList *tags; + guint bitrate = 0; + + gst_event_parse_tag (*event, &tags); + + if (gst_tag_list_get_scope (tags) != GST_TAG_SCOPE_STREAM) + return TRUE; + + if (!gst_tag_list_get_uint (tags, GST_TAG_MAXIMUM_BITRATE, + &bitrate) || bitrate == 0) + if (!gst_tag_list_get_uint (tags, GST_TAG_BITRATE, &bitrate) || + bitrate == 0) + return TRUE; + + /* set bandwidth (kbits/s) */ + gst_sdp_media_add_bandwidth (media, GST_SDP_BWTYPE_AS, bitrate / 1000); + + return FALSE; + + } + + return TRUE; +} + +static void +update_sdp_from_tags (GstRTSPStream * stream, GstSDPMedia * stream_media) +{ + GstPad *src_pad; + + src_pad = gst_rtsp_stream_get_srcpad (stream); + + gst_pad_sticky_events_foreach (src_pad, get_info_from_tags, stream_media); + + gst_object_unref (src_pad); +} + +static guint8 +enc_key_length_from_cipher_name (const gchar * cipher) +{ + if (g_strcmp0 (cipher, "aes-128-icm") == 0) + return AES_128_KEY_LEN; + else if (g_strcmp0 (cipher, "aes-256-icm") == 0) + return AES_256_KEY_LEN; + else { + GST_ERROR ("encryption algorithm '%s' not supported", cipher); + return 0; + } +} + +static guint8 +auth_key_length_from_auth_name (const gchar * auth) +{ + if (g_strcmp0 (auth, "hmac-sha1-32") == 0) + return HMAC_32_KEY_LEN; + else if (g_strcmp0 (auth, "hmac-sha1-80") == 0) + return HMAC_80_KEY_LEN; + else { + GST_ERROR ("authentication algorithm '%s' not supported", auth); + return 0; + } +} + +static void +make_media (GstSDPMessage * sdp, GstSDPInfo * info, GstRTSPMedia * media, + GstRTSPStream * stream, GstStructure * s, GstRTSPProfile profile) +{ + GstSDPMedia *smedia; + const gchar *caps_str, *caps_enc, *caps_params; + gchar *tmp; + gint caps_pt, caps_rate; + guint n_fields, j; + gboolean first; + GString *fmtp; + GstRTSPLowerTrans ltrans; + GSocketFamily family; + const gchar *addrtype, *proto; + gchar *address; + guint ttl; + + gst_sdp_media_new (&smedia); + + /* get media type and payload for the m= line */ + caps_str = gst_structure_get_string (s, "media"); + gst_sdp_media_set_media (smedia, caps_str); + + gst_structure_get_int (s, "payload", &caps_pt); + tmp = g_strdup_printf ("%d", caps_pt); + gst_sdp_media_add_format (smedia, tmp); + g_free (tmp); + + gst_sdp_media_set_port_info (smedia, 0, 1); + + switch (profile) { + case GST_RTSP_PROFILE_AVP: + proto = "RTP/AVP"; + break; + case GST_RTSP_PROFILE_AVPF: + proto = "RTP/AVPF"; + break; + case GST_RTSP_PROFILE_SAVP: + proto = "RTP/SAVP"; + break; + case GST_RTSP_PROFILE_SAVPF: + proto = "RTP/SAVPF"; + break; + default: + proto = "udp"; + break; + } + gst_sdp_media_set_proto (smedia, proto); + + if (info->is_ipv6) { + addrtype = "IP6"; + family = G_SOCKET_FAMILY_IPV6; + } else { + addrtype = "IP4"; + family = G_SOCKET_FAMILY_IPV4; + } + + ltrans = gst_rtsp_stream_get_protocols (stream); + if (ltrans == GST_RTSP_LOWER_TRANS_UDP_MCAST) { + GstRTSPAddress *addr; + + addr = gst_rtsp_stream_get_multicast_address (stream, family); + if (addr == NULL) + goto no_multicast; + + address = g_strdup (addr->address); + ttl = addr->ttl; + gst_rtsp_address_free (addr); + } else { + ttl = 16; + if (info->is_ipv6) + address = g_strdup ("::"); + else + address = g_strdup ("0.0.0.0"); + } + + /* for the c= line */ + gst_sdp_media_add_connection (smedia, "IN", addrtype, address, ttl, 1); + g_free (address); + + /* get clock-rate, media type and params for the rtpmap attribute */ + gst_structure_get_int (s, "clock-rate", &caps_rate); + caps_enc = gst_structure_get_string (s, "encoding-name"); + caps_params = gst_structure_get_string (s, "encoding-params"); + + if (caps_enc) { + if (caps_params) + tmp = g_strdup_printf ("%d %s/%d/%s", caps_pt, caps_enc, caps_rate, + caps_params); + else + tmp = g_strdup_printf ("%d %s/%d", caps_pt, caps_enc, caps_rate); + + gst_sdp_media_add_attribute (smedia, "rtpmap", tmp); + g_free (tmp); + } + + /* the config uri */ + tmp = gst_rtsp_stream_get_control (stream); + gst_sdp_media_add_attribute (smedia, "control", tmp); + g_free (tmp); + + + /* check for srtp */ + do { + GstBuffer *srtpkey; + const GValue *val; + const gchar *srtpcipher, *srtpauth, *srtcpcipher, *srtcpauth; + GstMIKEYMessage *msg; + GstMIKEYPayload *payload, *pkd; + GBytes *bytes; + GstMapInfo info; + const guint8 *data; + gsize size; + gchar *base64; + guint8 byte; + guint32 ssrc; + + val = gst_structure_get_value (s, "srtp-key"); + if (val == NULL) + break; + + srtpkey = gst_value_get_buffer (val); + if (srtpkey == NULL) + break; + + srtpcipher = gst_structure_get_string (s, "srtp-cipher"); + srtpauth = gst_structure_get_string (s, "srtp-auth"); + srtcpcipher = gst_structure_get_string (s, "srtcp-cipher"); + srtcpauth = gst_structure_get_string (s, "srtcp-auth"); + + if (srtpcipher == NULL || srtpauth == NULL || srtcpcipher == NULL || + srtcpauth == NULL) + break; + + msg = gst_mikey_message_new (); + /* unencrypted MIKEY message, we send this over TLS so this is allowed */ + gst_mikey_message_set_info (msg, GST_MIKEY_VERSION, GST_MIKEY_TYPE_PSK_INIT, + FALSE, GST_MIKEY_PRF_MIKEY_1, 0, GST_MIKEY_MAP_TYPE_SRTP); + /* add policy '0' for our SSRC */ + gst_rtsp_stream_get_ssrc (stream, &ssrc); + gst_mikey_message_add_cs_srtp (msg, 0, ssrc, 0); + /* timestamp is now */ + gst_mikey_message_add_t_now_ntp_utc (msg); + /* add some random data */ + gst_mikey_message_add_rand_len (msg, 16); + + /* the policy '0' is SRTP with the above discovered algorithms */ + payload = gst_mikey_payload_new (GST_MIKEY_PT_SP); + gst_mikey_payload_sp_set (payload, 0, GST_MIKEY_SEC_PROTO_SRTP); + + /* only AES-CM is supported */ + byte = 1; + gst_mikey_payload_sp_add_param (payload, GST_MIKEY_SP_SRTP_ENC_ALG, 1, + &byte); + /* Encryption key length */ + byte = enc_key_length_from_cipher_name (srtpcipher); + gst_mikey_payload_sp_add_param (payload, GST_MIKEY_SP_SRTP_ENC_KEY_LEN, 1, + &byte); + /* only HMAC-SHA1 */ + gst_mikey_payload_sp_add_param (payload, GST_MIKEY_SP_SRTP_AUTH_ALG, 1, + &byte); + /* Authentication key length */ + byte = auth_key_length_from_auth_name (srtpauth); + gst_mikey_payload_sp_add_param (payload, GST_MIKEY_SP_SRTP_AUTH_KEY_LEN, 1, + &byte); + /* we enable encryption on RTP and RTCP */ + gst_mikey_payload_sp_add_param (payload, GST_MIKEY_SP_SRTP_SRTP_ENC, 1, + &byte); + gst_mikey_payload_sp_add_param (payload, GST_MIKEY_SP_SRTP_SRTCP_ENC, 1, + &byte); + /* we enable authentication on RTP and RTCP */ + gst_mikey_payload_sp_add_param (payload, GST_MIKEY_SP_SRTP_SRTP_AUTH, 1, + &byte); + gst_mikey_message_add_payload (msg, payload); + + /* make unencrypted KEMAC */ + payload = gst_mikey_payload_new (GST_MIKEY_PT_KEMAC); + gst_mikey_payload_kemac_set (payload, GST_MIKEY_ENC_NULL, + GST_MIKEY_MAC_NULL); + + /* add the key in key data */ + pkd = gst_mikey_payload_new (GST_MIKEY_PT_KEY_DATA); + gst_buffer_map (srtpkey, &info, GST_MAP_READ); + gst_mikey_payload_key_data_set_key (pkd, GST_MIKEY_KD_TEK, info.size, + info.data); + gst_buffer_unmap (srtpkey, &info); + /* add key data to KEMAC */ + gst_mikey_payload_kemac_add_sub (payload, pkd); + gst_mikey_message_add_payload (msg, payload); + + /* now serialize this to bytes */ + bytes = gst_mikey_message_to_bytes (msg, NULL, NULL); + gst_mikey_message_unref (msg); + /* and make it into base64 */ + data = g_bytes_get_data (bytes, &size); + base64 = g_base64_encode (data, size); + g_bytes_unref (bytes); + + tmp = g_strdup_printf ("mikey %s", base64); + g_free (base64); + + gst_sdp_media_add_attribute (smedia, "key-mgmt", tmp); + g_free (tmp); + } while (FALSE); + + /* collect all other properties and add them to fmtp or attributes */ + fmtp = g_string_new (""); + g_string_append_printf (fmtp, "%d ", caps_pt); + first = TRUE; + n_fields = gst_structure_n_fields (s); + for (j = 0; j < n_fields; j++) { + const gchar *fname, *fval; + + fname = gst_structure_nth_field_name (s, j); + + /* filter out standard properties */ + if (!strcmp (fname, "media")) + continue; + if (!strcmp (fname, "payload")) + continue; + if (!strcmp (fname, "clock-rate")) + continue; + if (!strcmp (fname, "encoding-name")) + continue; + if (!strcmp (fname, "encoding-params")) + continue; + if (!strcmp (fname, "ssrc")) + continue; + if (!strcmp (fname, "clock-base")) + continue; + if (!strcmp (fname, "seqnum-base")) + continue; + if (g_str_has_prefix (fname, "srtp-")) + continue; + if (g_str_has_prefix (fname, "srtcp-")) + continue; + + if (g_str_has_prefix (fname, "a-")) { + /* attribute */ + if ((fval = gst_structure_get_string (s, fname))) + gst_sdp_media_add_attribute (smedia, fname + 2, fval); + continue; + } + if (g_str_has_prefix (fname, "x-")) { + /* attribute */ + if ((fval = gst_structure_get_string (s, fname))) + gst_sdp_media_add_attribute (smedia, fname, fval); + continue; + } + + if ((fval = gst_structure_get_string (s, fname))) { + g_string_append_printf (fmtp, "%s%s=%s", first ? "" : ";", fname, fval); + first = FALSE; + } + } + if (!first) { + tmp = g_string_free (fmtp, FALSE); + gst_sdp_media_add_attribute (smedia, "fmtp", tmp); + g_free (tmp); + } else { + g_string_free (fmtp, TRUE); + } + + update_sdp_from_tags (stream, smedia); + + gst_sdp_message_add_media (sdp, smedia); + gst_sdp_media_free (smedia); + + return; + + /* ERRORS */ +no_multicast: + { + gst_sdp_media_free (smedia); + g_warning ("ignoring stream %d without multicast address", + gst_rtsp_stream_get_index (stream)); + return; + } +} + +/** + * gst_rtsp_sdp_from_media: + * @sdp: a #GstSDPMessage + * @info: (transfer none): a #GstSDPInfo + * @media: (transfer none): a #GstRTSPMedia + * + * Add @media specific info to @sdp. @info is used to configure the connection + * information in the SDP. + * + * Returns: TRUE on success. + */ +gboolean +gst_rtsp_sdp_from_media (GstSDPMessage * sdp, GstSDPInfo * info, + GstRTSPMedia * media) +{ + guint i, n_streams; + gchar *rangestr; + + n_streams = gst_rtsp_media_n_streams (media); + + rangestr = gst_rtsp_media_get_range_string (media, FALSE, GST_RTSP_RANGE_NPT); + if (rangestr == NULL) + goto not_prepared; + + gst_sdp_message_add_attribute (sdp, "range", rangestr); + g_free (rangestr); + + for (i = 0; i < n_streams; i++) { + GstRTSPStream *stream; + GstCaps *caps; + GstStructure *s; + GstRTSPProfile profiles; + guint mask; + + stream = gst_rtsp_media_get_stream (media, i); + caps = gst_rtsp_stream_get_caps (stream); + + if (caps == NULL) { + g_warning ("ignoring stream %d without media type", i); + continue; + } + + s = gst_caps_get_structure (caps, 0); + if (s == NULL) { + gst_caps_unref (caps); + g_warning ("ignoring stream %d without media type", i); + continue; + } + + /* make a new media for each profile */ + profiles = gst_rtsp_stream_get_profiles (stream); + mask = 1; + while (profiles >= mask) { + GstRTSPProfile prof = profiles & mask; + + if (prof) + make_media (sdp, info, media, stream, s, prof); + + mask <<= 1; + } + gst_caps_unref (caps); + } + + { + GstNetTimeProvider *provider; + + if ((provider = + gst_rtsp_media_get_time_provider (media, info->server_ip, 0))) { + GstClock *clock; + gchar *address, *str; + gint port; + + g_object_get (provider, "clock", &clock, "address", &address, "port", + &port, NULL); + + str = g_strdup_printf ("GstNetTimeProvider %s %s:%d %" G_GUINT64_FORMAT, + g_type_name (G_TYPE_FROM_INSTANCE (clock)), address, port, + gst_clock_get_time (clock)); + + gst_sdp_message_add_attribute (sdp, "x-gst-clock", str); + g_free (str); + gst_object_unref (clock); + g_free (address); + gst_object_unref (provider); + } + } + + return TRUE; + + /* ERRORS */ +not_prepared: + { + GST_ERROR ("media %p is not prepared", media); + return FALSE; + } +} diff --git a/gst/rtsp-server/rtsp-sdp.h b/gst/rtsp-server/rtsp-sdp.h new file mode 100644 index 0000000..7732f36 --- /dev/null +++ b/gst/rtsp-server/rtsp-sdp.h @@ -0,0 +1,40 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include + +#include "rtsp-media.h" + +#ifndef __GST_RTSP_SDP_H__ +#define __GST_RTSP_SDP_H__ + +G_BEGIN_DECLS + +typedef struct { + gboolean is_ipv6; + const gchar *server_ip; +} GstSDPInfo; + +/* creating SDP */ +gboolean gst_rtsp_sdp_from_media (GstSDPMessage *sdp, GstSDPInfo *info, GstRTSPMedia * media); + +G_END_DECLS + +#endif /* __GST_RTSP_SDP_H__ */ diff --git a/gst/rtsp-server/rtsp-server-wfd.c b/gst/rtsp-server/rtsp-server-wfd.c new file mode 100644 index 0000000..8e14f97 --- /dev/null +++ b/gst/rtsp-server/rtsp-server-wfd.c @@ -0,0 +1,281 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-server + * @short_description: The main server object + * @see_also: #GstRTSPClient, #GstRTSPThreadPool + * + * The server object is the object listening for connections on a port and + * creating #GstRTSPClient objects to handle those connections. + * + * The server will listen on the address set with gst_rtsp_server_set_address() + * and the port or service configured with gst_rtsp_server_set_service(). + * Use gst_rtsp_server_set_backlog() to configure the amount of pending requests + * that the server will keep. By default the server listens on the current + * network (0.0.0.0) and port 8554. + * + * The server will require an SSL connection when a TLS certificate has been + * set in the auth object with gst_rtsp_auth_set_tls_certificate(). + * + * To start the server, use gst_rtsp_server_attach() to attach it to a + * #GMainContext. For more control, gst_rtsp_server_create_source() and + * gst_rtsp_server_create_socket() can be used to get a #GSource and #GSocket + * respectively. + * + * gst_rtsp_server_transfer_connection() can be used to transfer an existing + * socket to the RTSP server, for example from an HTTP server. + * + * Once the server socket is attached to a mainloop, it will start accepting + * connections. When a new connection is received, a new #GstRTSPClient object + * is created to handle the connection. The new client will be configured with + * the server #GstRTSPAuth, #GstRTSPMountPoints, #GstRTSPSessionPool and + * #GstRTSPThreadPool. + * + * The server uses the configured #GstRTSPThreadPool object to handle the + * remainder of the communication with this client. + * + * Last reviewed on 2013-07-11 (1.0.0) + */ +#include +#include + +#include "rtsp-server-wfd.h" +#include "rtsp-client-wfd.h" + +#define GST_RTSP_WFD_SERVER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_WFD_SERVER, GstRTSPWFDServerPrivate)) + +#define GST_RTSP_WFD_SERVER_GET_LOCK(server) (&(GST_RTSP_WFD_SERVER_CAST(server)->priv->lock)) +#define GST_RTSP_WFD_SERVER_LOCK(server) (g_mutex_lock(GST_RTSP_WFD_SERVER_GET_LOCK(server))) +#define GST_RTSP_WFD_SERVER_UNLOCK(server) (g_mutex_unlock(GST_RTSP_WFD_SERVER_GET_LOCK(server))) + +struct _GstRTSPWFDServerPrivate +{ + GMutex lock; /* protects everything in this struct */ + + /* the clients that are connected */ + GList *clients; + guint64 supported_resolution; +}; + +G_DEFINE_TYPE (GstRTSPWFDServer, gst_rtsp_wfd_server, GST_TYPE_RTSP_SERVER); + +GST_DEBUG_CATEGORY_STATIC (rtsp_wfd_server_debug); +#define GST_CAT_DEFAULT rtsp_wfd_server_debug + +static void gst_rtsp_wfd_server_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec); +static void gst_rtsp_wfd_server_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec); +static void gst_rtsp_wfd_server_finalize (GObject * object); + +static GstRTSPClient *create_client_wfd (GstRTSPServer * server); +static void client_connected_wfd (GstRTSPServer * server, + GstRTSPClient * client); + +static void +gst_rtsp_wfd_server_class_init (GstRTSPWFDServerClass * klass) +{ + GObjectClass *gobject_class; + GstRTSPServerClass *rtsp_server_class; + + g_type_class_add_private (klass, sizeof (GstRTSPWFDServerPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + rtsp_server_class = GST_RTSP_SERVER_CLASS (klass); + + gobject_class->get_property = gst_rtsp_wfd_server_get_property; + gobject_class->set_property = gst_rtsp_wfd_server_set_property; + gobject_class->finalize = gst_rtsp_wfd_server_finalize; + + rtsp_server_class->create_client = create_client_wfd; + rtsp_server_class->client_connected = client_connected_wfd; + + + GST_DEBUG_CATEGORY_INIT (rtsp_wfd_server_debug, "rtspwfdserver", 0, + "GstRTSPWFDServer"); +} + +static void +gst_rtsp_wfd_server_init (GstRTSPWFDServer * server) +{ + GstRTSPWFDServerPrivate *priv = GST_RTSP_WFD_SERVER_GET_PRIVATE (server); + + server->priv = priv; + server->priv->supported_resolution = 1; + GST_INFO_OBJECT (server, "New server is initialized"); +} + +static void +gst_rtsp_wfd_server_finalize (GObject * object) +{ + GstRTSPWFDServer *server = GST_RTSP_WFD_SERVER (object); + //GstRTSPWFDServerPrivate *priv = server->priv; + + GST_DEBUG_OBJECT (server, "finalize server"); + + G_OBJECT_CLASS (gst_rtsp_wfd_server_parent_class)->finalize (object); +} + +/** + * gst_rtsp_server_new: + * + * Create a new #GstRTSPWFDServer instance. + */ +GstRTSPWFDServer * +gst_rtsp_wfd_server_new (void) +{ + GstRTSPWFDServer *result; + + result = g_object_new (GST_TYPE_RTSP_WFD_SERVER, NULL); + + return result; +} + +static void +gst_rtsp_wfd_server_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + //GstRTSPWFDServer *server = GST_RTSP_WFD_SERVER (object); + + switch (propid) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_wfd_server_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + //GstRTSPWFDServer *server = GST_RTSP_WFD_SERVER (object); + + switch (propid) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static gboolean +_start_wfd (gpointer data) +{ + GstRTSPWFDClient *client = (GstRTSPWFDClient *) data; + + GST_INFO_OBJECT (client, "WFD client is STARTing"); + + gst_rtsp_wfd_client_start_wfd (client); + return FALSE; +} + +static void +client_connected_wfd (GstRTSPServer * server, GstRTSPClient * client) +{ + GST_INFO_OBJECT (server, "Client is connected"); + + g_idle_add (_start_wfd, client); + return; +} + +static GstRTSPClient * +create_client_wfd (GstRTSPServer * server) +{ + GstRTSPWFDClient *client; + GstRTSPThreadPool *thread_pool = NULL; + GstRTSPSessionPool *session_pool = NULL; + GstRTSPMountPoints *mount_points = NULL; + GstRTSPAuth *auth = NULL; + GstRTSPWFDServerPrivate *priv = GST_RTSP_WFD_SERVER_GET_PRIVATE(server); + + GST_INFO_OBJECT (server, "New Client is being created"); + + /* a new client connected, create a session to handle the client. */ + client = gst_rtsp_wfd_client_new (); + + thread_pool = gst_rtsp_server_get_thread_pool (server); + session_pool = gst_rtsp_server_get_session_pool (server); + mount_points = gst_rtsp_server_get_mount_points (server); + auth = gst_rtsp_server_get_auth (server); + + /* set the session pool that this client should use */ + GST_RTSP_WFD_SERVER_LOCK (server); + gst_rtsp_client_set_session_pool (GST_RTSP_CLIENT_CAST (client), + session_pool); + /* set the mount points that this client should use */ + gst_rtsp_client_set_mount_points (GST_RTSP_CLIENT_CAST (client), + mount_points); + /* set authentication manager */ + gst_rtsp_client_set_auth (GST_RTSP_CLIENT_CAST (client), auth); + /* set threadpool */ + gst_rtsp_client_set_thread_pool (GST_RTSP_CLIENT_CAST (client), thread_pool); + + gst_rtsp_wfd_client_set_video_supported_resolution (client, + priv->supported_resolution); + + GST_RTSP_WFD_SERVER_UNLOCK (server); + + return GST_RTSP_CLIENT (client); +} + +GstRTSPResult +gst_rtsp_wfd_server_trigger_request (GstRTSPServer * server, + GstWFDTriggerType type) +{ + GstRTSPResult res = GST_RTSP_OK; + GList *clients, *walk, *next; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), GST_RTSP_ERROR); + + clients = gst_rtsp_server_client_filter (server, NULL, NULL); + if (clients == NULL) { + GST_ERROR_OBJECT (server, "There is no client in this server"); + } + + for (walk = clients; walk; walk = next) { + GstRTSPClient *client = walk->data; + + next = g_list_next (walk); + + res = + gst_rtsp_wfd_client_trigger_request (GST_RTSP_WFD_CLIENT (client), + type); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (server, "Failed to send trigger request %d", type); + } + g_object_unref (client); + } + + return res; + +} + +GstRTSPResult +gst_rtsp_wfd_server_set_supported_reso(GstRTSPWFDServer *server, guint64 supported_reso) +{ + GstRTSPResult res = GST_RTSP_OK; + GstRTSPWFDServerPrivate *priv = GST_RTSP_WFD_SERVER_GET_PRIVATE(server); + + g_return_val_if_fail (GST_IS_RTSP_WFD_SERVER (server), GST_RTSP_ERROR); + + GST_RTSP_WFD_SERVER_LOCK (server); + + priv->supported_resolution = supported_reso; + + GST_RTSP_WFD_SERVER_UNLOCK (server); + return res; +} diff --git a/gst/rtsp-server/rtsp-server-wfd.h b/gst/rtsp-server/rtsp-server-wfd.h new file mode 100644 index 0000000..890a0fe --- /dev/null +++ b/gst/rtsp-server/rtsp-server-wfd.h @@ -0,0 +1,153 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_RTSP_SERVER_WFD_H__ +#define __GST_RTSP_SERVER_WFD_H__ + +#include + +G_BEGIN_DECLS + +typedef struct _GstRTSPWFDServer GstRTSPWFDServer; +typedef struct _GstRTSPWFDServerClass GstRTSPWFDServerClass; +typedef struct _GstRTSPWFDServerPrivate GstRTSPWFDServerPrivate; + +#include "rtsp-session-pool.h" +#include "rtsp-mount-points.h" +#include "rtsp-server.h" +#include "rtsp-client-wfd.h" +#include "rtsp-auth.h" + +#define GST_TYPE_RTSP_WFD_SERVER (gst_rtsp_wfd_server_get_type ()) +#define GST_IS_RTSP_WFD_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_WFD_SERVER)) +#define GST_IS_RTSP_WFD_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_WFD_SERVER)) +#define GST_RTSP_WFD_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_WFD_SERVER, GstRTSPWFDServerClass)) +#define GST_RTSP_WFD_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_WFD_SERVER, GstRTSPWFDServer)) +#define GST_RTSP_WFD_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_WFD_SERVER, GstRTSPWFDServerClass)) +#define GST_RTSP_WFD_SERVER_CAST(obj) ((GstRTSPWFDServer*)(obj)) +#define GST_RTSP_WFD_SERVER_CLASS_CAST(klass) ((GstRTSPWFDServerClass*)(klass)) + +/** + * GstRTSPWFDServer: + * + * This object listens on a port, creates and manages the clients connected to + * it. + */ +struct _GstRTSPWFDServer { + GstRTSPServer parent; + + /*< private >*/ + GstRTSPWFDServerPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPServerClass: + * @create_client: Create, configure a new GstRTSPClient + * object that handles the new connection on @socket. The default + * implementation will create a GstRTSPClient and will configure the + * mount-points, auth, session-pool and thread-pool on the client. + * @client_connected: emited when a new client connected. + * + * The RTSP server class structure + */ +struct _GstRTSPWFDServerClass { + GstRTSPServerClass parent_class; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING_LARGE]; +}; + +GType gst_rtsp_wfd_server_get_type (void); +GstRTSPWFDServer * gst_rtsp_wfd_server_new (void); +GstRTSPResult gst_rtsp_wfd_server_trigger_request (GstRTSPServer *server, GstWFDTriggerType type); + +GstRTSPResult gst_rtsp_wfd_server_set_supported_reso(GstRTSPWFDServer *server, guint64 supported_reso); + +#if 0 +void gst_rtsp_server_set_address (GstRTSPServer *server, const gchar *address); +gchar * gst_rtsp_server_get_address (GstRTSPServer *server); + +void gst_rtsp_server_set_service (GstRTSPServer *server, const gchar *service); +gchar * gst_rtsp_server_get_service (GstRTSPServer *server); + +void gst_rtsp_server_set_backlog (GstRTSPServer *server, gint backlog); +gint gst_rtsp_server_get_backlog (GstRTSPServer *server); + +int gst_rtsp_server_get_bound_port (GstRTSPServer *server); + +void gst_rtsp_server_set_session_pool (GstRTSPServer *server, GstRTSPSessionPool *pool); +GstRTSPSessionPool * gst_rtsp_server_get_session_pool (GstRTSPServer *server); + +void gst_rtsp_server_set_mount_points (GstRTSPServer *server, GstRTSPMountPoints *mounts); +GstRTSPMountPoints * gst_rtsp_server_get_mount_points (GstRTSPServer *server); + +void gst_rtsp_server_set_auth (GstRTSPServer *server, GstRTSPAuth *auth); +GstRTSPAuth * gst_rtsp_server_get_auth (GstRTSPServer *server); + +void gst_rtsp_server_set_thread_pool (GstRTSPServer *server, GstRTSPThreadPool *pool); +GstRTSPThreadPool * gst_rtsp_server_get_thread_pool (GstRTSPServer *server); + +gboolean gst_rtsp_server_transfer_connection (GstRTSPServer * server, GSocket *socket, + const gchar * ip, gint port, + const gchar *initial_buffer); + +gboolean gst_rtsp_server_io_func (GSocket *socket, GIOCondition condition, + GstRTSPServer *server); + +GSocket * gst_rtsp_server_create_socket (GstRTSPServer *server, + GCancellable *cancellable, + GError **error); +GSource * gst_rtsp_server_create_source (GstRTSPServer *server, + GCancellable * cancellable, + GError **error); +guint gst_rtsp_server_attach (GstRTSPServer *server, + GMainContext *context); +/** + * GstRTSPServerClientFilterFunc: + * @server: a #GstRTSPServer object + * @client: a #GstRTSPClient in @server + * @user_data: user data that has been given to gst_rtsp_server_client_filter() + * + * This function will be called by the gst_rtsp_server_client_filter(). An + * implementation should return a value of #GstRTSPFilterResult. + * + * When this function returns #GST_RTSP_FILTER_REMOVE, @client will be removed + * from @server. + * + * A return value of #GST_RTSP_FILTER_KEEP will leave @client untouched in + * @server. + * + * A value of #GST_RTSP_FILTER_REF will add @client to the result #GList of + * gst_rtsp_server_client_filter(). + * + * Returns: a #GstRTSPFilterResult. + */ +typedef GstRTSPFilterResult (*GstRTSPServerClientFilterFunc) (GstRTSPServer *server, + GstRTSPClient *client, + gpointer user_data); + +GList * gst_rtsp_server_client_filter (GstRTSPServer *server, + GstRTSPServerClientFilterFunc func, + gpointer user_data); +#endif + +G_END_DECLS + +#endif /* __GST_RTSP_SERVER_WFD_H__ */ diff --git a/gst/rtsp-server/rtsp-server.c b/gst/rtsp-server/rtsp-server.c new file mode 100644 index 0000000..686ba03 --- /dev/null +++ b/gst/rtsp-server/rtsp-server.c @@ -0,0 +1,1430 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-server + * @short_description: The main server object + * @see_also: #GstRTSPClient, #GstRTSPThreadPool + * + * The server object is the object listening for connections on a port and + * creating #GstRTSPClient objects to handle those connections. + * + * The server will listen on the address set with gst_rtsp_server_set_address() + * and the port or service configured with gst_rtsp_server_set_service(). + * Use gst_rtsp_server_set_backlog() to configure the amount of pending requests + * that the server will keep. By default the server listens on the current + * network (0.0.0.0) and port 8554. + * + * The server will require an SSL connection when a TLS certificate has been + * set in the auth object with gst_rtsp_auth_set_tls_certificate(). + * + * To start the server, use gst_rtsp_server_attach() to attach it to a + * #GMainContext. For more control, gst_rtsp_server_create_source() and + * gst_rtsp_server_create_socket() can be used to get a #GSource and #GSocket + * respectively. + * + * gst_rtsp_server_transfer_connection() can be used to transfer an existing + * socket to the RTSP server, for example from an HTTP server. + * + * Once the server socket is attached to a mainloop, it will start accepting + * connections. When a new connection is received, a new #GstRTSPClient object + * is created to handle the connection. The new client will be configured with + * the server #GstRTSPAuth, #GstRTSPMountPoints, #GstRTSPSessionPool and + * #GstRTSPThreadPool. + * + * The server uses the configured #GstRTSPThreadPool object to handle the + * remainder of the communication with this client. + * + * Last reviewed on 2013-07-11 (1.0.0) + */ +#include +#include + +#include "rtsp-server.h" +#include "rtsp-client.h" + +#define GST_RTSP_SERVER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_SERVER, GstRTSPServerPrivate)) + +#define GST_RTSP_SERVER_GET_LOCK(server) (&(GST_RTSP_SERVER_CAST(server)->priv->lock)) +#define GST_RTSP_SERVER_LOCK(server) (g_mutex_lock(GST_RTSP_SERVER_GET_LOCK(server))) +#define GST_RTSP_SERVER_UNLOCK(server) (g_mutex_unlock(GST_RTSP_SERVER_GET_LOCK(server))) + +struct _GstRTSPServerPrivate +{ + GMutex lock; /* protects everything in this struct */ + + /* server information */ + gchar *address; + gchar *service; + gint backlog; + + GSocket *socket; + + /* sessions on this server */ + GstRTSPSessionPool *session_pool; + + /* mount points for this server */ + GstRTSPMountPoints *mount_points; + + /* authentication manager */ + GstRTSPAuth *auth; + + /* resource manager */ + GstRTSPThreadPool *thread_pool; + + /* the clients that are connected */ + GList *clients; + guint clients_cookie; +}; + +#define DEFAULT_ADDRESS "0.0.0.0" +#define DEFAULT_BOUND_PORT -1 +/* #define DEFAULT_ADDRESS "::0" */ +#define DEFAULT_SERVICE "8554" +#define DEFAULT_BACKLOG 5 + +/* Define to use the SO_LINGER option so that the server sockets can be resused + * sooner. Disabled for now because it is not very well implemented by various + * OSes and it causes clients to fail to read the TEARDOWN response. */ +#undef USE_SOLINGER + +enum +{ + PROP_0, + PROP_ADDRESS, + PROP_SERVICE, + PROP_BOUND_PORT, + PROP_BACKLOG, + + PROP_SESSION_POOL, + PROP_MOUNT_POINTS, + PROP_LAST +}; + +enum +{ + SIGNAL_CLIENT_CONNECTED, + SIGNAL_LAST +}; + +G_DEFINE_TYPE (GstRTSPServer, gst_rtsp_server, G_TYPE_OBJECT); + +GST_DEBUG_CATEGORY_STATIC (rtsp_server_debug); +#define GST_CAT_DEFAULT rtsp_server_debug + +typedef struct _ClientContext ClientContext; + +static guint gst_rtsp_server_signals[SIGNAL_LAST] = { 0 }; + +static void gst_rtsp_server_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec); +static void gst_rtsp_server_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec); +static void gst_rtsp_server_finalize (GObject * object); + +static GstRTSPClient *default_create_client (GstRTSPServer * server); + +static void +gst_rtsp_server_class_init (GstRTSPServerClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPServerPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->get_property = gst_rtsp_server_get_property; + gobject_class->set_property = gst_rtsp_server_set_property; + gobject_class->finalize = gst_rtsp_server_finalize; + + /** + * GstRTSPServer::address: + * + * The address of the server. This is the address where the server will + * listen on. + */ + g_object_class_install_property (gobject_class, PROP_ADDRESS, + g_param_spec_string ("address", "Address", + "The address the server uses to listen on", DEFAULT_ADDRESS, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * GstRTSPServer::service: + * + * The service of the server. This is either a string with the service name or + * a port number (as a string) the server will listen on. + */ + g_object_class_install_property (gobject_class, PROP_SERVICE, + g_param_spec_string ("service", "Service", + "The service or port number the server uses to listen on", + DEFAULT_SERVICE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * GstRTSPServer::bound-port: + * + * The actual port the server is listening on. Can be used to retrieve the + * port number when the server is started on port 0, which means bind to a + * random port. Set to -1 if the server has not been bound yet. + */ + g_object_class_install_property (gobject_class, PROP_BOUND_PORT, + g_param_spec_int ("bound-port", "Bound port", + "The port number the server is listening on", + -1, G_MAXUINT16, DEFAULT_BOUND_PORT, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /** + * GstRTSPServer::backlog: + * + * The backlog argument defines the maximum length to which the queue of + * pending connections for the server may grow. If a connection request arrives + * when the queue is full, the client may receive an error with an indication of + * ECONNREFUSED or, if the underlying protocol supports retransmission, the + * request may be ignored so that a later reattempt at connection succeeds. + */ + g_object_class_install_property (gobject_class, PROP_BACKLOG, + g_param_spec_int ("backlog", "Backlog", + "The maximum length to which the queue " + "of pending connections may grow", 0, G_MAXINT, DEFAULT_BACKLOG, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * GstRTSPServer::session-pool: + * + * The session pool of the server. By default each server has a separate + * session pool but sessions can be shared between servers by setting the same + * session pool on multiple servers. + */ + g_object_class_install_property (gobject_class, PROP_SESSION_POOL, + g_param_spec_object ("session-pool", "Session Pool", + "The session pool to use for client session", + GST_TYPE_RTSP_SESSION_POOL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * GstRTSPServer::mount-points: + * + * The mount points to use for this server. By default the server has no + * mount points and thus cannot map urls to media streams. + */ + g_object_class_install_property (gobject_class, PROP_MOUNT_POINTS, + g_param_spec_object ("mount-points", "Mount Points", + "The mount points to use for client session", + GST_TYPE_RTSP_MOUNT_POINTS, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_rtsp_server_signals[SIGNAL_CLIENT_CONNECTED] = + g_signal_new ("client-connected", G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPServerClass, client_connected), + NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, + GST_TYPE_RTSP_CLIENT); + + klass->create_client = default_create_client; + + GST_DEBUG_CATEGORY_INIT (rtsp_server_debug, "rtspserver", 0, "GstRTSPServer"); +} + +static void +gst_rtsp_server_init (GstRTSPServer * server) +{ + GstRTSPServerPrivate *priv = GST_RTSP_SERVER_GET_PRIVATE (server); + + server->priv = priv; + + g_mutex_init (&priv->lock); + priv->address = g_strdup (DEFAULT_ADDRESS); + priv->service = g_strdup (DEFAULT_SERVICE); + priv->socket = NULL; + priv->backlog = DEFAULT_BACKLOG; + priv->session_pool = gst_rtsp_session_pool_new (); + priv->mount_points = gst_rtsp_mount_points_new (); + priv->thread_pool = gst_rtsp_thread_pool_new (); +} + +static void +gst_rtsp_server_finalize (GObject * object) +{ + GstRTSPServer *server = GST_RTSP_SERVER (object); + GstRTSPServerPrivate *priv = server->priv; + + GST_DEBUG_OBJECT (server, "finalize server"); + + g_free (priv->address); + g_free (priv->service); + + if (priv->socket) + g_object_unref (priv->socket); + + if (priv->session_pool) + g_object_unref (priv->session_pool); + if (priv->mount_points) + g_object_unref (priv->mount_points); + if (priv->thread_pool) + g_object_unref (priv->thread_pool); + + if (priv->auth) + g_object_unref (priv->auth); + + g_mutex_clear (&priv->lock); + + G_OBJECT_CLASS (gst_rtsp_server_parent_class)->finalize (object); +} + +/** + * gst_rtsp_server_new: + * + * Create a new #GstRTSPServer instance. + * + * Returns: (transfer full): a new #GstRTSPServer + */ +GstRTSPServer * +gst_rtsp_server_new (void) +{ + GstRTSPServer *result; + + result = g_object_new (GST_TYPE_RTSP_SERVER, NULL); + + return result; +} + +/** + * gst_rtsp_server_set_address: + * @server: a #GstRTSPServer + * @address: the address + * + * Configure @server to accept connections on the given address. + * + * This function must be called before the server is bound. + */ +void +gst_rtsp_server_set_address (GstRTSPServer * server, const gchar * address) +{ + GstRTSPServerPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_SERVER (server)); + g_return_if_fail (address != NULL); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + g_free (priv->address); + priv->address = g_strdup (address); + GST_RTSP_SERVER_UNLOCK (server); +} + +/** + * gst_rtsp_server_get_address: + * @server: a #GstRTSPServer + * + * Get the address on which the server will accept connections. + * + * Returns: (transfer full): the server address. g_free() after usage. + */ +gchar * +gst_rtsp_server_get_address (GstRTSPServer * server) +{ + GstRTSPServerPrivate *priv; + gchar *result; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + result = g_strdup (priv->address); + GST_RTSP_SERVER_UNLOCK (server); + + return result; +} + +/** + * gst_rtsp_server_get_bound_port: + * @server: a #GstRTSPServer + * + * Get the port number where the server was bound to. + * + * Returns: the port number + */ +int +gst_rtsp_server_get_bound_port (GstRTSPServer * server) +{ + GstRTSPServerPrivate *priv; + GSocketAddress *address; + int result = -1; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), result); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + if (priv->socket == NULL) + goto out; + + address = g_socket_get_local_address (priv->socket, NULL); + result = g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (address)); + g_object_unref (address); + +out: + GST_RTSP_SERVER_UNLOCK (server); + + return result; +} + +/** + * gst_rtsp_server_set_service: + * @server: a #GstRTSPServer + * @service: the service + * + * Configure @server to accept connections on the given service. + * @service should be a string containing the service name (see services(5)) or + * a string containing a port number between 1 and 65535. + * + * When @service is set to "0", the server will listen on a random free + * port. The actual used port can be retrieved with + * gst_rtsp_server_get_bound_port(). + * + * This function must be called before the server is bound. + */ +void +gst_rtsp_server_set_service (GstRTSPServer * server, const gchar * service) +{ + GstRTSPServerPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_SERVER (server)); + g_return_if_fail (service != NULL); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + g_free (priv->service); + priv->service = g_strdup (service); + GST_RTSP_SERVER_UNLOCK (server); +} + +/** + * gst_rtsp_server_get_service: + * @server: a #GstRTSPServer + * + * Get the service on which the server will accept connections. + * + * Returns: (transfer full): the service. use g_free() after usage. + */ +gchar * +gst_rtsp_server_get_service (GstRTSPServer * server) +{ + GstRTSPServerPrivate *priv; + gchar *result; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + result = g_strdup (priv->service); + GST_RTSP_SERVER_UNLOCK (server); + + return result; +} + +/** + * gst_rtsp_server_set_backlog: + * @server: a #GstRTSPServer + * @backlog: the backlog + * + * configure the maximum amount of requests that may be queued for the + * server. + * + * This function must be called before the server is bound. + */ +void +gst_rtsp_server_set_backlog (GstRTSPServer * server, gint backlog) +{ + GstRTSPServerPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_SERVER (server)); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + priv->backlog = backlog; + GST_RTSP_SERVER_UNLOCK (server); +} + +/** + * gst_rtsp_server_get_backlog: + * @server: a #GstRTSPServer + * + * The maximum amount of queued requests for the server. + * + * Returns: the server backlog. + */ +gint +gst_rtsp_server_get_backlog (GstRTSPServer * server) +{ + GstRTSPServerPrivate *priv; + gint result; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), -1); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + result = priv->backlog; + GST_RTSP_SERVER_UNLOCK (server); + + return result; +} + +/** + * gst_rtsp_server_set_session_pool: + * @server: a #GstRTSPServer + * @pool: (transfer none): a #GstRTSPSessionPool + * + * configure @pool to be used as the session pool of @server. + */ +void +gst_rtsp_server_set_session_pool (GstRTSPServer * server, + GstRTSPSessionPool * pool) +{ + GstRTSPServerPrivate *priv; + GstRTSPSessionPool *old; + + g_return_if_fail (GST_IS_RTSP_SERVER (server)); + + priv = server->priv; + + if (pool) + g_object_ref (pool); + + GST_RTSP_SERVER_LOCK (server); + old = priv->session_pool; + priv->session_pool = pool; + GST_RTSP_SERVER_UNLOCK (server); + + if (old) + g_object_unref (old); +} + +/** + * gst_rtsp_server_get_session_pool: + * @server: a #GstRTSPServer + * + * Get the #GstRTSPSessionPool used as the session pool of @server. + * + * Returns: (transfer full): the #GstRTSPSessionPool used for sessions. g_object_unref() after + * usage. + */ +GstRTSPSessionPool * +gst_rtsp_server_get_session_pool (GstRTSPServer * server) +{ + GstRTSPServerPrivate *priv; + GstRTSPSessionPool *result; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + if ((result = priv->session_pool)) + g_object_ref (result); + GST_RTSP_SERVER_UNLOCK (server); + + return result; +} + +/** + * gst_rtsp_server_set_mount_points: + * @server: a #GstRTSPServer + * @mounts: (transfer none): a #GstRTSPMountPoints + * + * configure @mounts to be used as the mount points of @server. + */ +void +gst_rtsp_server_set_mount_points (GstRTSPServer * server, + GstRTSPMountPoints * mounts) +{ + GstRTSPServerPrivate *priv; + GstRTSPMountPoints *old; + + g_return_if_fail (GST_IS_RTSP_SERVER (server)); + + priv = server->priv; + + if (mounts) + g_object_ref (mounts); + + GST_RTSP_SERVER_LOCK (server); + old = priv->mount_points; + priv->mount_points = mounts; + GST_RTSP_SERVER_UNLOCK (server); + + if (old) + g_object_unref (old); +} + + +/** + * gst_rtsp_server_get_mount_points: + * @server: a #GstRTSPServer + * + * Get the #GstRTSPMountPoints used as the mount points of @server. + * + * Returns: (transfer full): the #GstRTSPMountPoints of @server. g_object_unref() after + * usage. + */ +GstRTSPMountPoints * +gst_rtsp_server_get_mount_points (GstRTSPServer * server) +{ + GstRTSPServerPrivate *priv; + GstRTSPMountPoints *result; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + if ((result = priv->mount_points)) + g_object_ref (result); + GST_RTSP_SERVER_UNLOCK (server); + + return result; +} + +/** + * gst_rtsp_server_set_auth: + * @server: a #GstRTSPServer + * @auth: (transfer none): a #GstRTSPAuth + * + * configure @auth to be used as the authentication manager of @server. + */ +void +gst_rtsp_server_set_auth (GstRTSPServer * server, GstRTSPAuth * auth) +{ + GstRTSPServerPrivate *priv; + GstRTSPAuth *old; + + g_return_if_fail (GST_IS_RTSP_SERVER (server)); + + priv = server->priv; + + if (auth) + g_object_ref (auth); + + GST_RTSP_SERVER_LOCK (server); + old = priv->auth; + priv->auth = auth; + GST_RTSP_SERVER_UNLOCK (server); + + if (old) + g_object_unref (old); +} + + +/** + * gst_rtsp_server_get_auth: + * @server: a #GstRTSPServer + * + * Get the #GstRTSPAuth used as the authentication manager of @server. + * + * Returns: (transfer full): the #GstRTSPAuth of @server. g_object_unref() after + * usage. + */ +GstRTSPAuth * +gst_rtsp_server_get_auth (GstRTSPServer * server) +{ + GstRTSPServerPrivate *priv; + GstRTSPAuth *result; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + if ((result = priv->auth)) + g_object_ref (result); + GST_RTSP_SERVER_UNLOCK (server); + + return result; +} + +/** + * gst_rtsp_server_set_thread_pool: + * @server: a #GstRTSPServer + * @pool: (transfer none): a #GstRTSPThreadPool + * + * configure @pool to be used as the thread pool of @server. + */ +void +gst_rtsp_server_set_thread_pool (GstRTSPServer * server, + GstRTSPThreadPool * pool) +{ + GstRTSPServerPrivate *priv; + GstRTSPThreadPool *old; + + g_return_if_fail (GST_IS_RTSP_SERVER (server)); + + priv = server->priv; + + if (pool) + g_object_ref (pool); + + GST_RTSP_SERVER_LOCK (server); + old = priv->thread_pool; + priv->thread_pool = pool; + GST_RTSP_SERVER_UNLOCK (server); + + if (old) + g_object_unref (old); +} + +/** + * gst_rtsp_server_get_thread_pool: + * @server: a #GstRTSPServer + * + * Get the #GstRTSPThreadPool used as the thread pool of @server. + * + * Returns: (transfer full): the #GstRTSPThreadPool of @server. g_object_unref() after + * usage. + */ +GstRTSPThreadPool * +gst_rtsp_server_get_thread_pool (GstRTSPServer * server) +{ + GstRTSPServerPrivate *priv; + GstRTSPThreadPool *result; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + if ((result = priv->thread_pool)) + g_object_ref (result); + GST_RTSP_SERVER_UNLOCK (server); + + return result; +} + +static void +gst_rtsp_server_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + GstRTSPServer *server = GST_RTSP_SERVER (object); + + switch (propid) { + case PROP_ADDRESS: + g_value_take_string (value, gst_rtsp_server_get_address (server)); + break; + case PROP_SERVICE: + g_value_take_string (value, gst_rtsp_server_get_service (server)); + break; + case PROP_BOUND_PORT: + g_value_set_int (value, gst_rtsp_server_get_bound_port (server)); + break; + case PROP_BACKLOG: + g_value_set_int (value, gst_rtsp_server_get_backlog (server)); + break; + case PROP_SESSION_POOL: + g_value_take_object (value, gst_rtsp_server_get_session_pool (server)); + break; + case PROP_MOUNT_POINTS: + g_value_take_object (value, gst_rtsp_server_get_mount_points (server)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_server_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + GstRTSPServer *server = GST_RTSP_SERVER (object); + + switch (propid) { + case PROP_ADDRESS: + gst_rtsp_server_set_address (server, g_value_get_string (value)); + break; + case PROP_SERVICE: + gst_rtsp_server_set_service (server, g_value_get_string (value)); + break; + case PROP_BACKLOG: + gst_rtsp_server_set_backlog (server, g_value_get_int (value)); + break; + case PROP_SESSION_POOL: + gst_rtsp_server_set_session_pool (server, g_value_get_object (value)); + break; + case PROP_MOUNT_POINTS: + gst_rtsp_server_set_mount_points (server, g_value_get_object (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +/** + * gst_rtsp_server_create_socket: + * @server: a #GstRTSPServer + * @cancellable: (allow-none): a #GCancellable + * @error: (out): a #GError + * + * Create a #GSocket for @server. The socket will listen on the + * configured service. + * + * Returns: (transfer full): the #GSocket for @server or %NULL when an error + * occurred. + */ +GSocket * +gst_rtsp_server_create_socket (GstRTSPServer * server, + GCancellable * cancellable, GError ** error) +{ + GstRTSPServerPrivate *priv; + GSocketConnectable *conn; + GSocketAddressEnumerator *enumerator; + GSocket *socket = NULL; +#ifdef USE_SOLINGER + struct linger linger; +#endif + GError *sock_error = NULL; + GError *bind_error = NULL; + guint16 port; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL); + + priv = server->priv; + + GST_RTSP_SERVER_LOCK (server); + GST_DEBUG_OBJECT (server, "getting address info of %s/%s", priv->address, + priv->service); + + /* resolve the server IP address */ + port = atoi (priv->service); + if (port != 0 || !strcmp (priv->service, "0")) + conn = g_network_address_new (priv->address, port); + else + conn = g_network_service_new (priv->service, "tcp", priv->address); + + enumerator = g_socket_connectable_enumerate (conn); + g_object_unref (conn); + + /* create server socket, we loop through all the addresses until we manage to + * create a socket and bind. */ + while (TRUE) { + GSocketAddress *sockaddr; + + sockaddr = + g_socket_address_enumerator_next (enumerator, cancellable, error); + if (!sockaddr) { + if (!*error) + GST_DEBUG_OBJECT (server, "no more addresses %s", + *error ? (*error)->message : ""); + else + GST_DEBUG_OBJECT (server, "failed to retrieve next address %s", + (*error)->message); + break; + } + + /* only keep the first error */ + socket = g_socket_new (g_socket_address_get_family (sockaddr), + G_SOCKET_TYPE_STREAM, G_SOCKET_PROTOCOL_TCP, + sock_error ? NULL : &sock_error); + + if (socket == NULL) { + GST_DEBUG_OBJECT (server, "failed to make socket (%s), try next", + sock_error->message); + g_object_unref (sockaddr); + continue; + } + + if (g_socket_bind (socket, sockaddr, TRUE, bind_error ? NULL : &bind_error)) { + /* ask what port the socket has been bound to */ + if (port == 0 || !strcmp (priv->service, "0")) { + GError *addr_error = NULL; + + g_object_unref (sockaddr); + sockaddr = g_socket_get_local_address (socket, &addr_error); + + if (addr_error != NULL) { + GST_DEBUG_OBJECT (server, + "failed to get the local address of a bound socket %s", + addr_error->message); + g_clear_error (&addr_error); + break; + } + port = + g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (sockaddr)); + + if (port != 0) { + g_free (priv->service); + priv->service = g_strdup_printf ("%d", port); + } else { + GST_DEBUG_OBJECT (server, "failed to get the port of a bound socket"); + } + } + g_object_unref (sockaddr); + break; + } + + GST_DEBUG_OBJECT (server, "failed to bind socket (%s), try next", + bind_error->message); + g_object_unref (sockaddr); + g_object_unref (socket); + socket = NULL; + } + g_object_unref (enumerator); + + if (socket == NULL) + goto no_socket; + + g_clear_error (&sock_error); + g_clear_error (&bind_error); + + GST_DEBUG_OBJECT (server, "opened sending server socket"); + + /* keep connection alive; avoids SIGPIPE during write */ + g_socket_set_keepalive (socket, TRUE); + +#if 0 +#ifdef USE_SOLINGER + /* make sure socket is reset 5 seconds after close. This ensure that we can + * reuse the socket quickly while still having a chance to send data to the + * client. */ + linger.l_onoff = 1; + linger.l_linger = 5; + if (setsockopt (sockfd, SOL_SOCKET, SO_LINGER, + (void *) &linger, sizeof (linger)) < 0) + goto linger_failed; +#endif +#endif + + /* set the server socket to nonblocking */ + g_socket_set_blocking (socket, FALSE); + + /* set listen backlog */ + g_socket_set_listen_backlog (socket, priv->backlog); + + if (!g_socket_listen (socket, error)) + goto listen_failed; + + GST_DEBUG_OBJECT (server, "listening on server socket %p with queue of %d", + socket, priv->backlog); + + GST_RTSP_SERVER_UNLOCK (server); + + return socket; + + /* ERRORS */ +no_socket: + { + GST_ERROR_OBJECT (server, "failed to create socket"); + goto close_error; + } +#if 0 +#ifdef USE_SOLINGER +linger_failed: + { + GST_ERROR_OBJECT (server, "failed to no linger socket: %s", + g_strerror (errno)); + goto close_error; + } +#endif +#endif +listen_failed: + { + GST_ERROR_OBJECT (server, "failed to listen on socket: %s", + (*error)->message); + goto close_error; + } +close_error: + { + if (socket) + g_object_unref (socket); + + if (sock_error) { + if (error == NULL) + g_propagate_error (error, sock_error); + else + g_error_free (sock_error); + } + if (bind_error) { + if ((error == NULL) || (*error == NULL)) + g_propagate_error (error, bind_error); + else + g_error_free (bind_error); + } + GST_RTSP_SERVER_UNLOCK (server); + return NULL; + } +} + +struct _ClientContext +{ + GstRTSPServer *server; + GstRTSPThread *thread; + GstRTSPClient *client; +}; + +static gboolean +free_client_context (ClientContext * ctx) +{ + GST_DEBUG ("free context %p", ctx); + + GST_RTSP_SERVER_LOCK (ctx->server); + if (ctx->thread) + gst_rtsp_thread_stop (ctx->thread); + GST_RTSP_SERVER_UNLOCK (ctx->server); + + g_object_unref (ctx->client); + g_object_unref (ctx->server); + g_slice_free (ClientContext, ctx); + + return G_SOURCE_REMOVE; +} + +static void +unmanage_client (GstRTSPClient * client, ClientContext * ctx) +{ + GstRTSPServer *server = ctx->server; + GstRTSPServerPrivate *priv = server->priv; + + GST_DEBUG_OBJECT (server, "unmanage client %p", client); + + GST_RTSP_SERVER_LOCK (server); + priv->clients = g_list_remove (priv->clients, ctx); + priv->clients_cookie++; + GST_RTSP_SERVER_UNLOCK (server); + + if (ctx->thread) { + GSource *src; + + src = g_idle_source_new (); + g_source_set_callback (src, (GSourceFunc) free_client_context, ctx, NULL); + g_source_attach (src, ctx->thread->context); + g_source_unref (src); + } else { + free_client_context (ctx); + } +} + +/* add the client context to the active list of clients, takes ownership + * of client */ +static void +manage_client (GstRTSPServer * server, GstRTSPClient * client) +{ + ClientContext *cctx; + GstRTSPServerPrivate *priv = server->priv; + GMainContext *mainctx = NULL; + GstRTSPContext ctx = { NULL }; + + GST_DEBUG_OBJECT (server, "manage client %p", client); + + g_signal_emit (server, gst_rtsp_server_signals[SIGNAL_CLIENT_CONNECTED], 0, + client); + + cctx = g_slice_new0 (ClientContext); + cctx->server = g_object_ref (server); + cctx->client = client; + + GST_RTSP_SERVER_LOCK (server); + + ctx.server = server; + ctx.client = client; + + cctx->thread = gst_rtsp_thread_pool_get_thread (priv->thread_pool, + GST_RTSP_THREAD_TYPE_CLIENT, &ctx); + if (cctx->thread) + mainctx = cctx->thread->context; + else { + GSource *source; + /* find the context to add the watch */ + if ((source = g_main_current_source ())) + mainctx = g_source_get_context (source); + } + + g_signal_connect (client, "closed", (GCallback) unmanage_client, cctx); + priv->clients = g_list_prepend (priv->clients, cctx); + priv->clients_cookie++; + + gst_rtsp_client_attach (client, mainctx); + + GST_RTSP_SERVER_UNLOCK (server); +} + +static GstRTSPClient * +default_create_client (GstRTSPServer * server) +{ + GstRTSPClient *client; + GstRTSPServerPrivate *priv = server->priv; + + /* a new client connected, create a session to handle the client. */ + client = gst_rtsp_client_new (); + + /* set the session pool that this client should use */ + GST_RTSP_SERVER_LOCK (server); + gst_rtsp_client_set_session_pool (client, priv->session_pool); + /* set the mount points that this client should use */ + gst_rtsp_client_set_mount_points (client, priv->mount_points); + /* set authentication manager */ + gst_rtsp_client_set_auth (client, priv->auth); + /* set threadpool */ + gst_rtsp_client_set_thread_pool (client, priv->thread_pool); + GST_RTSP_SERVER_UNLOCK (server); + + return client; +} + +/** + * gst_rtsp_server_transfer_connection: + * @server: a #GstRTSPServer + * @socket: (transfer full): a network socket + * @ip: the IP address of the remote client + * @port: the port used by the other end + * @initial_buffer: any initial data that was already read from the socket + * + * Take an existing network socket and use it for an RTSP connection. This + * is used when transferring a socket from an HTTP server which should be used + * as an RTSP over HTTP tunnel. The @initial_buffer contains any remaining data + * that the HTTP server read from the socket while parsing the HTTP header. + * + * Returns: TRUE if all was ok, FALSE if an error occurred. + */ +gboolean +gst_rtsp_server_transfer_connection (GstRTSPServer * server, GSocket * socket, + const gchar * ip, gint port, const gchar * initial_buffer) +{ + GstRTSPClient *client = NULL; + GstRTSPServerClass *klass; + GstRTSPConnection *conn; + GstRTSPResult res; + + klass = GST_RTSP_SERVER_GET_CLASS (server); + + if (klass->create_client) + client = klass->create_client (server); + if (client == NULL) + goto client_failed; + + GST_RTSP_CHECK (gst_rtsp_connection_create_from_socket (socket, ip, port, + initial_buffer, &conn), no_connection); + g_object_unref (socket); + + /* set connection on the client now */ + gst_rtsp_client_set_connection (client, conn); + + /* manage the client connection */ + manage_client (server, client); + + return TRUE; + + /* ERRORS */ +client_failed: + { + GST_ERROR_OBJECT (server, "failed to create a client"); + g_object_unref (socket); + return FALSE; + } +no_connection: + { + gchar *str = gst_rtsp_strresult (res); + GST_ERROR ("could not create connection from socket %p: %s", socket, str); + g_free (str); + g_object_unref (socket); + return FALSE; + } +} + +/** + * gst_rtsp_server_io_func: + * @socket: a #GSocket + * @condition: the condition on @source + * @server: (transfer none): a #GstRTSPServer + * + * A default #GSocketSourceFunc that creates a new #GstRTSPClient to accept and handle a + * new connection on @socket or @server. + * + * Returns: TRUE if the source could be connected, FALSE if an error occurred. + */ +gboolean +gst_rtsp_server_io_func (GSocket * socket, GIOCondition condition, + GstRTSPServer * server) +{ + GstRTSPServerPrivate *priv = server->priv; + GstRTSPClient *client = NULL; + GstRTSPServerClass *klass; + GstRTSPResult res; + GstRTSPConnection *conn = NULL; + GstRTSPContext ctx = { NULL }; + + if (condition & G_IO_IN) { + /* a new client connected. */ + GST_RTSP_CHECK (gst_rtsp_connection_accept (socket, &conn, NULL), + accept_failed); + + ctx.server = server; + ctx.conn = conn; + ctx.auth = priv->auth; + gst_rtsp_context_push_current (&ctx); + + if (!gst_rtsp_auth_check (GST_RTSP_AUTH_CHECK_CONNECT)) + goto connection_refused; + + klass = GST_RTSP_SERVER_GET_CLASS (server); + /* a new client connected, create a client object to handle the client. */ + if (klass->create_client) + client = klass->create_client (server); + if (client == NULL) + goto client_failed; + + /* set connection on the client now */ + gst_rtsp_client_set_connection (client, conn); + + /* manage the client connection */ + manage_client (server, client); + } else { + GST_WARNING_OBJECT (server, "received unknown event %08x", condition); + } +exit: + gst_rtsp_context_pop_current (&ctx); + + return G_SOURCE_CONTINUE; + + /* ERRORS */ +accept_failed: + { + gchar *str = gst_rtsp_strresult (res); + GST_ERROR_OBJECT (server, "Could not accept client on socket %p: %s", + socket, str); + g_free (str); + goto exit; + } +connection_refused: + { + GST_ERROR_OBJECT (server, "connection refused"); + gst_rtsp_connection_free (conn); + goto exit; + } +client_failed: + { + GST_ERROR_OBJECT (server, "failed to create a client"); + gst_rtsp_connection_free (conn); + goto exit; + } +} + +static void +watch_destroyed (GstRTSPServer * server) +{ + GstRTSPServerPrivate *priv = server->priv; + + GST_DEBUG_OBJECT (server, "source destroyed"); + + g_object_unref (priv->socket); + priv->socket = NULL; + g_object_unref (server); +} + +/** + * gst_rtsp_server_create_source: + * @server: a #GstRTSPServer + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @error: (out): a #GError + * + * Create a #GSource for @server. The new source will have a default + * #GSocketSourceFunc of gst_rtsp_server_io_func(). + * + * @cancellable if not %NULL can be used to cancel the source, which will cause + * the source to trigger, reporting the current condition (which is likely 0 + * unless cancellation happened at the same time as a condition change). You can + * check for this in the callback using g_cancellable_is_cancelled(). + * + * Returns: (transfer full): the #GSource for @server or %NULL when an error + * occurred. Free with g_source_unref () + */ +GSource * +gst_rtsp_server_create_source (GstRTSPServer * server, + GCancellable * cancellable, GError ** error) +{ + GstRTSPServerPrivate *priv; + GSocket *socket, *old; + GSource *source; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL); + + priv = server->priv; + + socket = gst_rtsp_server_create_socket (server, NULL, error); + if (socket == NULL) + goto no_socket; + + GST_RTSP_SERVER_LOCK (server); + old = priv->socket; + priv->socket = g_object_ref (socket); + GST_RTSP_SERVER_UNLOCK (server); + + if (old) + g_object_unref (old); + + /* create a watch for reads (new connections) and possible errors */ + source = g_socket_create_source (socket, G_IO_IN | + G_IO_ERR | G_IO_HUP | G_IO_NVAL, cancellable); + g_object_unref (socket); + + /* configure the callback */ + g_source_set_callback (source, + (GSourceFunc) gst_rtsp_server_io_func, g_object_ref (server), + (GDestroyNotify) watch_destroyed); + + return source; + +no_socket: + { + GST_ERROR_OBJECT (server, "failed to create socket"); + return NULL; + } +} + +/** + * gst_rtsp_server_attach: + * @server: a #GstRTSPServer + * @context: (allow-none): a #GMainContext + * + * Attaches @server to @context. When the mainloop for @context is run, the + * server will be dispatched. When @context is %NULL, the default context will be + * used). + * + * This function should be called when the server properties and urls are fully + * configured and the server is ready to start. + * + * Returns: the ID (greater than 0) for the source within the GMainContext. + */ +guint +gst_rtsp_server_attach (GstRTSPServer * server, GMainContext * context) +{ + guint res; + GSource *source; + GError *error = NULL; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), 0); + + source = gst_rtsp_server_create_source (server, NULL, &error); + if (source == NULL) + goto no_source; + + res = g_source_attach (source, context); + g_source_unref (source); + + return res; + + /* ERRORS */ +no_source: + { + GST_ERROR_OBJECT (server, "failed to create watch: %s", error->message); + g_error_free (error); + return 0; + } +} + +/** + * gst_rtsp_server_client_filter: + * @server: a #GstRTSPServer + * @func: (scope call) (allow-none): a callback + * @user_data: user data passed to @func + * + * Call @func for each client managed by @server. The result value of @func + * determines what happens to the client. @func will be called with @server + * locked so no further actions on @server can be performed from @func. + * + * If @func returns #GST_RTSP_FILTER_REMOVE, the client will be removed from + * @server. + * + * If @func returns #GST_RTSP_FILTER_KEEP, the client will remain in @server. + * + * If @func returns #GST_RTSP_FILTER_REF, the client will remain in @server but + * will also be added with an additional ref to the result #GList of this + * function.. + * + * When @func is %NULL, #GST_RTSP_FILTER_REF will be assumed for each client. + * + * Returns: (element-type GstRTSPClient) (transfer full): a #GList with all + * clients for which @func returned #GST_RTSP_FILTER_REF. After usage, each + * element in the #GList should be unreffed before the list is freed. + */ +GList * +gst_rtsp_server_client_filter (GstRTSPServer * server, + GstRTSPServerClientFilterFunc func, gpointer user_data) +{ + GstRTSPServerPrivate *priv; + GList *result, *walk, *next; + GHashTable *visited; + guint cookie; + + g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL); + + priv = server->priv; + + result = NULL; + if (func) + visited = g_hash_table_new_full (NULL, NULL, g_object_unref, NULL); + + GST_RTSP_SERVER_LOCK (server); +restart: + cookie = priv->clients_cookie; + for (walk = priv->clients; walk; walk = next) { + ClientContext *cctx = walk->data; + GstRTSPClient *client = cctx->client; + GstRTSPFilterResult res; + gboolean changed; + + next = g_list_next (walk); + + if (func) { + /* only visit each media once */ + if (g_hash_table_contains (visited, client)) + continue; + + g_hash_table_add (visited, g_object_ref (client)); + GST_RTSP_SERVER_UNLOCK (server); + + res = func (server, client, user_data); + + GST_RTSP_SERVER_LOCK (server); + } else + res = GST_RTSP_FILTER_REF; + + changed = (cookie != priv->clients_cookie); + + switch (res) { + case GST_RTSP_FILTER_REMOVE: + GST_RTSP_SERVER_UNLOCK (server); + + gst_rtsp_client_close (client); + + GST_RTSP_SERVER_LOCK (server); + changed |= (cookie != priv->clients_cookie); + break; + case GST_RTSP_FILTER_REF: + result = g_list_prepend (result, g_object_ref (client)); + break; + case GST_RTSP_FILTER_KEEP: + default: + break; + } + if (changed) + goto restart; + } + GST_RTSP_SERVER_UNLOCK (server); + + if (func) + g_hash_table_unref (visited); + + return result; +} diff --git a/gst/rtsp-server/rtsp-server.h b/gst/rtsp-server/rtsp-server.h new file mode 100644 index 0000000..9a6f9d4 --- /dev/null +++ b/gst/rtsp-server/rtsp-server.h @@ -0,0 +1,169 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_RTSP_SERVER_H__ +#define __GST_RTSP_SERVER_H__ + +#include + +G_BEGIN_DECLS + +typedef struct _GstRTSPServer GstRTSPServer; +typedef struct _GstRTSPServerClass GstRTSPServerClass; +typedef struct _GstRTSPServerPrivate GstRTSPServerPrivate; + +#include "rtsp-session-pool.h" +#include "rtsp-session.h" +#include "rtsp-media.h" +#include "rtsp-stream.h" +#include "rtsp-stream-transport.h" +#include "rtsp-address-pool.h" +#include "rtsp-thread-pool.h" +#include "rtsp-client.h" +#include "rtsp-context.h" +#include "rtsp-server.h" +#include "rtsp-mount-points.h" +#include "rtsp-media-factory.h" +#include "rtsp-permissions.h" +#include "rtsp-auth.h" +#include "rtsp-token.h" +#include "rtsp-session-media.h" +#include "rtsp-sdp.h" +#include "rtsp-media-factory-uri.h" +#include "rtsp-params.h" + +#define GST_TYPE_RTSP_SERVER (gst_rtsp_server_get_type ()) +#define GST_IS_RTSP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_SERVER)) +#define GST_IS_RTSP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_SERVER)) +#define GST_RTSP_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_SERVER, GstRTSPServerClass)) +#define GST_RTSP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_SERVER, GstRTSPServer)) +#define GST_RTSP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_SERVER, GstRTSPServerClass)) +#define GST_RTSP_SERVER_CAST(obj) ((GstRTSPServer*)(obj)) +#define GST_RTSP_SERVER_CLASS_CAST(klass) ((GstRTSPServerClass*)(klass)) + +/** + * GstRTSPServer: + * + * This object listens on a port, creates and manages the clients connected to + * it. + */ +struct _GstRTSPServer { + GObject parent; + + /*< private >*/ + GstRTSPServerPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPServerClass: + * @create_client: Create, configure a new GstRTSPClient + * object that handles the new connection on @socket. The default + * implementation will create a GstRTSPClient and will configure the + * mount-points, auth, session-pool and thread-pool on the client. + * @client_connected: emited when a new client connected. + * + * The RTSP server class structure + */ +struct _GstRTSPServerClass { + GObjectClass parent_class; + + GstRTSPClient * (*create_client) (GstRTSPServer *server); + + /* signals */ + void (*client_connected) (GstRTSPServer *server, GstRTSPClient *client); + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING_LARGE]; +}; + +GType gst_rtsp_server_get_type (void); + +GstRTSPServer * gst_rtsp_server_new (void); + +void gst_rtsp_server_set_address (GstRTSPServer *server, const gchar *address); +gchar * gst_rtsp_server_get_address (GstRTSPServer *server); + +void gst_rtsp_server_set_service (GstRTSPServer *server, const gchar *service); +gchar * gst_rtsp_server_get_service (GstRTSPServer *server); + +void gst_rtsp_server_set_backlog (GstRTSPServer *server, gint backlog); +gint gst_rtsp_server_get_backlog (GstRTSPServer *server); + +int gst_rtsp_server_get_bound_port (GstRTSPServer *server); + +void gst_rtsp_server_set_session_pool (GstRTSPServer *server, GstRTSPSessionPool *pool); +GstRTSPSessionPool * gst_rtsp_server_get_session_pool (GstRTSPServer *server); + +void gst_rtsp_server_set_mount_points (GstRTSPServer *server, GstRTSPMountPoints *mounts); +GstRTSPMountPoints * gst_rtsp_server_get_mount_points (GstRTSPServer *server); + +void gst_rtsp_server_set_auth (GstRTSPServer *server, GstRTSPAuth *auth); +GstRTSPAuth * gst_rtsp_server_get_auth (GstRTSPServer *server); + +void gst_rtsp_server_set_thread_pool (GstRTSPServer *server, GstRTSPThreadPool *pool); +GstRTSPThreadPool * gst_rtsp_server_get_thread_pool (GstRTSPServer *server); + +gboolean gst_rtsp_server_transfer_connection (GstRTSPServer * server, GSocket *socket, + const gchar * ip, gint port, + const gchar *initial_buffer); + +gboolean gst_rtsp_server_io_func (GSocket *socket, GIOCondition condition, + GstRTSPServer *server); + +GSocket * gst_rtsp_server_create_socket (GstRTSPServer *server, + GCancellable *cancellable, + GError **error); +GSource * gst_rtsp_server_create_source (GstRTSPServer *server, + GCancellable * cancellable, + GError **error); +guint gst_rtsp_server_attach (GstRTSPServer *server, + GMainContext *context); + +/** + * GstRTSPServerClientFilterFunc: + * @server: a #GstRTSPServer object + * @client: a #GstRTSPClient in @server + * @user_data: user data that has been given to gst_rtsp_server_client_filter() + * + * This function will be called by the gst_rtsp_server_client_filter(). An + * implementation should return a value of #GstRTSPFilterResult. + * + * When this function returns #GST_RTSP_FILTER_REMOVE, @client will be removed + * from @server. + * + * A return value of #GST_RTSP_FILTER_KEEP will leave @client untouched in + * @server. + * + * A value of #GST_RTSP_FILTER_REF will add @client to the result #GList of + * gst_rtsp_server_client_filter(). + * + * Returns: a #GstRTSPFilterResult. + */ +typedef GstRTSPFilterResult (*GstRTSPServerClientFilterFunc) (GstRTSPServer *server, + GstRTSPClient *client, + gpointer user_data); + +GList * gst_rtsp_server_client_filter (GstRTSPServer *server, + GstRTSPServerClientFilterFunc func, + gpointer user_data); + +G_END_DECLS + +#endif /* __GST_RTSP_SERVER_H__ */ diff --git a/gst/rtsp-server/rtsp-session-media.c b/gst/rtsp-server/rtsp-session-media.c new file mode 100644 index 0000000..8eb1f28 --- /dev/null +++ b/gst/rtsp-server/rtsp-session-media.c @@ -0,0 +1,505 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-session-media + * @short_description: Media managed in a session + * @see_also: #GstRTSPMedia, #GstRTSPSession + * + * The #GstRTSPSessionMedia object manages a #GstRTSPMedia with a given path. + * + * With gst_rtsp_session_media_get_transport() and + * gst_rtsp_session_media_set_transport() the transports of a #GstRTSPStream of + * the managed #GstRTSPMedia can be retrieved and configured. + * + * Use gst_rtsp_session_media_set_state() to control the media state and + * transports. + * + * Last reviewed on 2013-07-16 (1.0.0) + */ + +#include + +#include "rtsp-session.h" + +#define GST_RTSP_SESSION_MEDIA_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_SESSION_MEDIA, GstRTSPSessionMediaPrivate)) + +struct _GstRTSPSessionMediaPrivate +{ + GMutex lock; + gchar *path; /* unmutable */ + gint path_len; /* unmutable */ + GstRTSPMedia *media; /* unmutable */ + GstRTSPState state; /* protected by lock */ + guint counter; /* protected by lock */ + + GPtrArray *transports; /* protected by lock */ +}; + +enum +{ + PROP_0, + PROP_LAST +}; + +GST_DEBUG_CATEGORY_STATIC (rtsp_session_media_debug); +#define GST_CAT_DEFAULT rtsp_session_media_debug + +static void gst_rtsp_session_media_finalize (GObject * obj); + +G_DEFINE_TYPE (GstRTSPSessionMedia, gst_rtsp_session_media, G_TYPE_OBJECT); + +static void +gst_rtsp_session_media_class_init (GstRTSPSessionMediaClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPSessionMediaPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = gst_rtsp_session_media_finalize; + + GST_DEBUG_CATEGORY_INIT (rtsp_session_media_debug, "rtspsessionmedia", 0, + "GstRTSPSessionMedia"); +} + +static void +gst_rtsp_session_media_init (GstRTSPSessionMedia * media) +{ + GstRTSPSessionMediaPrivate *priv = GST_RTSP_SESSION_MEDIA_GET_PRIVATE (media); + + media->priv = priv; + + g_mutex_init (&priv->lock); + priv->state = GST_RTSP_STATE_INIT; +} + +static void +gst_rtsp_session_media_finalize (GObject * obj) +{ + GstRTSPSessionMedia *media; + GstRTSPSessionMediaPrivate *priv; + + media = GST_RTSP_SESSION_MEDIA (obj); + priv = media->priv; + + GST_INFO ("free session media %p", media); + + gst_rtsp_session_media_set_state (media, GST_STATE_NULL); + + g_ptr_array_unref (priv->transports); + + g_free (priv->path); + g_object_unref (priv->media); + g_mutex_clear (&priv->lock); + + G_OBJECT_CLASS (gst_rtsp_session_media_parent_class)->finalize (obj); +} + +static void +free_session_media (gpointer data) +{ + if (data) + g_object_unref (data); +} + +/** + * gst_rtsp_session_media_new: + * @path: the path + * @media: (transfer full): the #GstRTSPMedia + * + * Create a new #GstRTSPSessionMedia that manages the streams + * in @media for @path. @media should be prepared. + * + * Ownership is taken of @media. + * + * Returns: (transfer full): a new #GstRTSPSessionMedia. + */ +GstRTSPSessionMedia * +gst_rtsp_session_media_new (const gchar * path, GstRTSPMedia * media) +{ + GstRTSPSessionMediaPrivate *priv; + GstRTSPSessionMedia *result; + guint n_streams; + GstRTSPMediaStatus status; + + g_return_val_if_fail (path != NULL, NULL); + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL); + status = gst_rtsp_media_get_status (media); + g_return_val_if_fail (status == GST_RTSP_MEDIA_STATUS_PREPARED || status == + GST_RTSP_MEDIA_STATUS_SUSPENDED, NULL); + + result = g_object_new (GST_TYPE_RTSP_SESSION_MEDIA, NULL); + priv = result->priv; + + priv->path = g_strdup (path); + priv->path_len = strlen (path); + priv->media = media; + + /* prealloc the streams now, filled with NULL */ + n_streams = gst_rtsp_media_n_streams (media); + priv->transports = g_ptr_array_new_full (n_streams, free_session_media); + g_ptr_array_set_size (priv->transports, n_streams); + + return result; +} + +/** + * gst_rtsp_session_media_matches: + * @media: a #GstRTSPSessionMedia + * @path: a path + * @matched: (out): the amount of matched characters of @path + * + * Check if the path of @media matches @path. It @path matches, the amount of + * matched characters is returned in @matched. + * + * Returns: %TRUE when @path matches the path of @media. + */ +gboolean +gst_rtsp_session_media_matches (GstRTSPSessionMedia * media, + const gchar * path, gint * matched) +{ + GstRTSPSessionMediaPrivate *priv; + gint len; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), FALSE); + g_return_val_if_fail (path != NULL, FALSE); + g_return_val_if_fail (matched != NULL, FALSE); + + priv = media->priv; + len = strlen (path); + + /* path needs to be smaller than the media path */ + if (len < priv->path_len) + return FALSE; + + /* if media path is larger, it there should be a / following the path */ + if (len > priv->path_len && path[priv->path_len] != '/') + return FALSE; + + *matched = priv->path_len; + + return strncmp (path, priv->path, priv->path_len) == 0; +} + +/** + * gst_rtsp_session_media_get_media: + * @media: a #GstRTSPSessionMedia + * + * Get the #GstRTSPMedia that was used when constructing @media + * + * Returns: (transfer none): the #GstRTSPMedia of @media. Remains valid as long + * as @media is valid. + */ +GstRTSPMedia * +gst_rtsp_session_media_get_media (GstRTSPSessionMedia * media) +{ + g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), NULL); + + return media->priv->media; +} + +/** + * gst_rtsp_session_media_get_base_time: + * @media: a #GstRTSPSessionMedia + * + * Get the base_time of the #GstRTSPMedia in @media + * + * Returns: the base_time of the media. + */ +GstClockTime +gst_rtsp_session_media_get_base_time (GstRTSPSessionMedia * media) +{ + g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), GST_CLOCK_TIME_NONE); + + return gst_rtsp_media_get_base_time (media->priv->media); +} + +/** + * gst_rtsp_session_media_get_rtpinfo: + * @media: a #GstRTSPSessionMedia + * + * Retrieve the RTP-Info header string for all streams in @media + * with configured transports. + * + * Returns: (transfer full) (nullable): The RTP-Info as a string or + * %NULL when no RTP-Info could be generated, g_free() after usage. + */ +gchar * +gst_rtsp_session_media_get_rtpinfo (GstRTSPSessionMedia * media) +{ + GstRTSPSessionMediaPrivate *priv; + GString *rtpinfo = NULL; + GstRTSPStreamTransport *transport; + GstRTSPStream *stream; + guint i, n_streams; + GstClockTime earliest = GST_CLOCK_TIME_NONE; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), NULL); + + priv = media->priv; + g_mutex_lock (&priv->lock); + + if (gst_rtsp_media_get_status (priv->media) != GST_RTSP_MEDIA_STATUS_PREPARED) + goto not_prepared; + + n_streams = priv->transports->len; + + /* first step, take lowest running-time from all streams */ + GST_LOG_OBJECT (media, "determining start time among %d transports", + n_streams); + + for (i = 0; i < n_streams; i++) { + GstClockTime running_time; + + transport = g_ptr_array_index (priv->transports, i); + if (transport == NULL) { + GST_DEBUG_OBJECT (media, "ignoring unconfigured transport %d", i); + continue; + } + + stream = gst_rtsp_stream_transport_get_stream (transport); + if (!gst_rtsp_stream_get_rtpinfo (stream, NULL, NULL, NULL, &running_time)) + continue; + + GST_LOG_OBJECT (media, "running time of %d stream: %" GST_TIME_FORMAT, i, + GST_TIME_ARGS (running_time)); + + if (!GST_CLOCK_TIME_IS_VALID (earliest)) { + earliest = running_time; + } else { + earliest = MIN (earliest, running_time); + } + } + + GST_LOG_OBJECT (media, "media start time: %" GST_TIME_FORMAT, + GST_TIME_ARGS (earliest)); + + /* next step, scale all rtptime of all streams to lowest running-time */ + GST_LOG_OBJECT (media, "collecting RTP info for %d transports", n_streams); + + for (i = 0; i < n_streams; i++) { + gchar *stream_rtpinfo; + + transport = g_ptr_array_index (priv->transports, i); + if (transport == NULL) { + GST_DEBUG_OBJECT (media, "ignoring unconfigured transport %d", i); + continue; + } + + stream_rtpinfo = + gst_rtsp_stream_transport_get_rtpinfo (transport, earliest); + if (stream_rtpinfo == NULL) { + GST_DEBUG_OBJECT (media, "ignoring unknown RTPInfo %d", i); + continue; + } + + if (rtpinfo == NULL) + rtpinfo = g_string_new (""); + else + g_string_append (rtpinfo, ", "); + + g_string_append (rtpinfo, stream_rtpinfo); + g_free (stream_rtpinfo); + } + g_mutex_unlock (&priv->lock); + + if (rtpinfo == NULL) { + GST_WARNING_OBJECT (media, "RTP info is empty"); + return NULL; + } + return g_string_free (rtpinfo, FALSE); + + /* ERRORS */ +not_prepared: + { + g_mutex_unlock (&priv->lock); + GST_ERROR_OBJECT (media, "media was not prepared"); + return NULL; + } +} + +/** + * gst_rtsp_session_media_set_transport: + * @media: a #GstRTSPSessionMedia + * @stream: a #GstRTSPStream + * @tr: (transfer full): a #GstRTSPTransport + * + * Configure the transport for @stream to @tr in @media. + * + * Returns: (transfer none): the new or updated #GstRTSPStreamTransport for @stream. + */ +GstRTSPStreamTransport * +gst_rtsp_session_media_set_transport (GstRTSPSessionMedia * media, + GstRTSPStream * stream, GstRTSPTransport * tr) +{ + GstRTSPSessionMediaPrivate *priv; + GstRTSPStreamTransport *result; + guint idx; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), NULL); + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + g_return_val_if_fail (tr != NULL, NULL); + priv = media->priv; + idx = gst_rtsp_stream_get_index (stream); + g_return_val_if_fail (idx < priv->transports->len, NULL); + + g_mutex_lock (&priv->lock); + result = g_ptr_array_index (priv->transports, idx); + if (result == NULL) { + result = gst_rtsp_stream_transport_new (stream, tr); + g_ptr_array_index (priv->transports, idx) = result; + g_mutex_unlock (&priv->lock); + } else { + gst_rtsp_stream_transport_set_transport (result, tr); + g_mutex_unlock (&priv->lock); + } + + return result; +} + +/** + * gst_rtsp_session_media_get_transport: + * @media: a #GstRTSPSessionMedia + * @idx: the stream index + * + * Get a previously created #GstRTSPStreamTransport for the stream at @idx. + * + * Returns: (transfer none): a #GstRTSPStreamTransport that is valid until the + * session of @media is unreffed. + */ +GstRTSPStreamTransport * +gst_rtsp_session_media_get_transport (GstRTSPSessionMedia * media, guint idx) +{ + GstRTSPSessionMediaPrivate *priv; + GstRTSPStreamTransport *result; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), NULL); + priv = media->priv; + g_return_val_if_fail (idx < priv->transports->len, NULL); + + g_mutex_lock (&priv->lock); + result = g_ptr_array_index (priv->transports, idx); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_session_media_alloc_channels: + * @media: a #GstRTSPSessionMedia + * @range: (out): a #GstRTSPRange + * + * Fill @range with the next available min and max channels for + * interleaved transport. + * + * Returns: %TRUE on success. + */ +gboolean +gst_rtsp_session_media_alloc_channels (GstRTSPSessionMedia * media, + GstRTSPRange * range) +{ + GstRTSPSessionMediaPrivate *priv; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), FALSE); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + range->min = priv->counter++; + range->max = priv->counter++; + g_mutex_unlock (&priv->lock); + + return TRUE; +} + +/** + * gst_rtsp_session_media_set_state: + * @media: a #GstRTSPSessionMedia + * @state: the new state + * + * Tell the media object @media to change to @state. + * + * Returns: %TRUE on success. + */ +gboolean +gst_rtsp_session_media_set_state (GstRTSPSessionMedia * media, GstState state) +{ + GstRTSPSessionMediaPrivate *priv; + gboolean ret; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), FALSE); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + ret = gst_rtsp_media_set_state (priv->media, state, priv->transports); + g_mutex_unlock (&priv->lock); + + return ret; +} + +/** + * gst_rtsp_session_media_set_rtsp_state: + * @media: a #GstRTSPSessionMedia + * @state: a #GstRTSPState + * + * Set the RTSP state of @media to @state. + */ +void +gst_rtsp_session_media_set_rtsp_state (GstRTSPSessionMedia * media, + GstRTSPState state) +{ + GstRTSPSessionMediaPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_SESSION_MEDIA (media)); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + priv->state = state; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_session_media_get_rtsp_state: + * @media: a #GstRTSPSessionMedia + * + * Get the current RTSP state of @media. + * + * Returns: the current RTSP state of @media. + */ +GstRTSPState +gst_rtsp_session_media_get_rtsp_state (GstRTSPSessionMedia * media) +{ + GstRTSPSessionMediaPrivate *priv; + GstRTSPState ret; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), + GST_RTSP_STATE_INVALID); + + priv = media->priv; + + g_mutex_lock (&priv->lock); + ret = priv->state; + g_mutex_unlock (&priv->lock); + + return ret; +} diff --git a/gst/rtsp-server/rtsp-session-media.h b/gst/rtsp-server/rtsp-session-media.h new file mode 100644 index 0000000..e2af5ad --- /dev/null +++ b/gst/rtsp-server/rtsp-session-media.h @@ -0,0 +1,97 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +#ifndef __GST_RTSP_SESSION_MEDIA_H__ +#define __GST_RTSP_SESSION_MEDIA_H__ + +G_BEGIN_DECLS + +#define GST_TYPE_RTSP_SESSION_MEDIA (gst_rtsp_session_media_get_type ()) +#define GST_IS_RTSP_SESSION_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_SESSION_MEDIA)) +#define GST_IS_RTSP_SESSION_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_SESSION_MEDIA)) +#define GST_RTSP_SESSION_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_SESSION_MEDIA, GstRTSPSessionMediaClass)) +#define GST_RTSP_SESSION_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_SESSION_MEDIA, GstRTSPSessionMedia)) +#define GST_RTSP_SESSION_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_SESSION_MEDIA, GstRTSPSessionMediaClass)) +#define GST_RTSP_SESSION_MEDIA_CAST(obj) ((GstRTSPSessionMedia*)(obj)) +#define GST_RTSP_SESSION_MEDIA_CLASS_CAST(klass) ((GstRTSPSessionMediaClass*)(klass)) + +typedef struct _GstRTSPSessionMedia GstRTSPSessionMedia; +typedef struct _GstRTSPSessionMediaClass GstRTSPSessionMediaClass; +typedef struct _GstRTSPSessionMediaPrivate GstRTSPSessionMediaPrivate; + +/** + * GstRTSPSessionMedia: + * + * State of a client session regarding a specific media identified by path. + */ +struct _GstRTSPSessionMedia +{ + GObject parent; + + /*< private >*/ + GstRTSPSessionMediaPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +struct _GstRTSPSessionMediaClass +{ + GObjectClass parent_class; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +GType gst_rtsp_session_media_get_type (void); + +GstRTSPSessionMedia * gst_rtsp_session_media_new (const gchar *path, + GstRTSPMedia *media); + +gboolean gst_rtsp_session_media_matches (GstRTSPSessionMedia *media, + const gchar *path, + gint * matched); +GstRTSPMedia * gst_rtsp_session_media_get_media (GstRTSPSessionMedia *media); + +GstClockTime gst_rtsp_session_media_get_base_time (GstRTSPSessionMedia *media); +/* control media */ +gboolean gst_rtsp_session_media_set_state (GstRTSPSessionMedia *media, + GstState state); + +void gst_rtsp_session_media_set_rtsp_state (GstRTSPSessionMedia *media, + GstRTSPState state); +GstRTSPState gst_rtsp_session_media_get_rtsp_state (GstRTSPSessionMedia *media); + +/* get stream transport config */ +GstRTSPStreamTransport * gst_rtsp_session_media_set_transport (GstRTSPSessionMedia *media, + GstRTSPStream *stream, + GstRTSPTransport *tr); +GstRTSPStreamTransport * gst_rtsp_session_media_get_transport (GstRTSPSessionMedia *media, + guint idx); + +gboolean gst_rtsp_session_media_alloc_channels (GstRTSPSessionMedia *media, + GstRTSPRange *range); + +gchar * gst_rtsp_session_media_get_rtpinfo (GstRTSPSessionMedia * media); + +G_END_DECLS + +#endif /* __GST_RTSP_SESSION_MEDIA_H__ */ diff --git a/gst/rtsp-server/rtsp-session-pool.c b/gst/rtsp-server/rtsp-session-pool.c new file mode 100644 index 0000000..fad5288 --- /dev/null +++ b/gst/rtsp-server/rtsp-session-pool.c @@ -0,0 +1,765 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-session-pool + * @short_description: An object for managing sessions + * @see_also: #GstRTSPSession + * + * The #GstRTSPSessionPool object manages a list of #GstRTSPSession objects. + * + * The maximum number of sessions can be configured with + * gst_rtsp_session_pool_set_max_sessions(). The current number of sessions can + * be retrieved with gst_rtsp_session_pool_get_n_sessions(). + * + * Use gst_rtsp_session_pool_create() to create a new #GstRTSPSession object. + * The session object can be found again with its id and + * gst_rtsp_session_pool_find(). + * + * All sessions can be iterated with gst_rtsp_session_pool_filter(). + * + * Run gst_rtsp_session_pool_cleanup() periodically to remove timed out sessions + * or use gst_rtsp_session_pool_create_watch() to be notified when session + * cleanup should be performed. + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include "rtsp-session-pool.h" + +#define GST_RTSP_SESSION_POOL_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_SESSION_POOL, GstRTSPSessionPoolPrivate)) + +struct _GstRTSPSessionPoolPrivate +{ + GMutex lock; /* protects everything in this struct */ + guint max_sessions; + GHashTable *sessions; + guint sessions_cookie; +}; + +#define DEFAULT_MAX_SESSIONS 0 + +enum +{ + PROP_0, + PROP_MAX_SESSIONS, + PROP_LAST +}; + +static const gchar session_id_charset[] = + { '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', '$', '-', '_', '.', '+' +}; + +enum +{ + SIGNAL_SESSION_REMOVED, + SIGNAL_LAST +}; + +static guint gst_rtsp_session_pool_signals[SIGNAL_LAST] = { 0 }; + +GST_DEBUG_CATEGORY_STATIC (rtsp_session_debug); +#define GST_CAT_DEFAULT rtsp_session_debug + +static void gst_rtsp_session_pool_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec); +static void gst_rtsp_session_pool_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec); +static void gst_rtsp_session_pool_finalize (GObject * object); + +static gchar *create_session_id (GstRTSPSessionPool * pool); +static GstRTSPSession *create_session (GstRTSPSessionPool * pool, + const gchar * id); + +G_DEFINE_TYPE (GstRTSPSessionPool, gst_rtsp_session_pool, G_TYPE_OBJECT); + +static void +gst_rtsp_session_pool_class_init (GstRTSPSessionPoolClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPSessionPoolPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->get_property = gst_rtsp_session_pool_get_property; + gobject_class->set_property = gst_rtsp_session_pool_set_property; + gobject_class->finalize = gst_rtsp_session_pool_finalize; + + g_object_class_install_property (gobject_class, PROP_MAX_SESSIONS, + g_param_spec_uint ("max-sessions", "Max Sessions", + "the maximum amount of sessions (0 = unlimited)", + 0, G_MAXUINT, DEFAULT_MAX_SESSIONS, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_rtsp_session_pool_signals[SIGNAL_SESSION_REMOVED] = + g_signal_new ("session-removed", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPSessionPoolClass, + session_removed), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, + 1, GST_TYPE_RTSP_SESSION); + + klass->create_session_id = create_session_id; + klass->create_session = create_session; + + GST_DEBUG_CATEGORY_INIT (rtsp_session_debug, "rtspsessionpool", 0, + "GstRTSPSessionPool"); +} + +static void +gst_rtsp_session_pool_init (GstRTSPSessionPool * pool) +{ + GstRTSPSessionPoolPrivate *priv = GST_RTSP_SESSION_POOL_GET_PRIVATE (pool); + + pool->priv = priv; + + g_mutex_init (&priv->lock); + priv->sessions = g_hash_table_new_full (g_str_hash, g_str_equal, + NULL, g_object_unref); + priv->max_sessions = DEFAULT_MAX_SESSIONS; +} + +static GstRTSPFilterResult +remove_sessions_func (GstRTSPSessionPool * pool, GstRTSPSession * session, + gpointer user_data) +{ + return GST_RTSP_FILTER_REMOVE; +} + +static void +gst_rtsp_session_pool_finalize (GObject * object) +{ + GstRTSPSessionPool *pool = GST_RTSP_SESSION_POOL (object); + GstRTSPSessionPoolPrivate *priv = pool->priv; + + gst_rtsp_session_pool_filter (pool, remove_sessions_func, NULL); + g_hash_table_unref (priv->sessions); + g_mutex_clear (&priv->lock); + + G_OBJECT_CLASS (gst_rtsp_session_pool_parent_class)->finalize (object); +} + +static void +gst_rtsp_session_pool_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + GstRTSPSessionPool *pool = GST_RTSP_SESSION_POOL (object); + + switch (propid) { + case PROP_MAX_SESSIONS: + g_value_set_uint (value, gst_rtsp_session_pool_get_max_sessions (pool)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + break; + } +} + +static void +gst_rtsp_session_pool_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + GstRTSPSessionPool *pool = GST_RTSP_SESSION_POOL (object); + + switch (propid) { + case PROP_MAX_SESSIONS: + gst_rtsp_session_pool_set_max_sessions (pool, g_value_get_uint (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + break; + } +} + +/** + * gst_rtsp_session_pool_new: + * + * Create a new #GstRTSPSessionPool instance. + * + * Returns: (transfer full): A new #GstRTSPSessionPool. g_object_unref() after + * usage. + */ +GstRTSPSessionPool * +gst_rtsp_session_pool_new (void) +{ + GstRTSPSessionPool *result; + + result = g_object_new (GST_TYPE_RTSP_SESSION_POOL, NULL); + + return result; +} + +/** + * gst_rtsp_session_pool_set_max_sessions: + * @pool: a #GstRTSPSessionPool + * @max: the maximum number of sessions + * + * Configure the maximum allowed number of sessions in @pool to @max. + * A value of 0 means an unlimited amount of sessions. + */ +void +gst_rtsp_session_pool_set_max_sessions (GstRTSPSessionPool * pool, guint max) +{ + GstRTSPSessionPoolPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_SESSION_POOL (pool)); + + priv = pool->priv; + + g_mutex_lock (&priv->lock); + priv->max_sessions = max; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_session_pool_get_max_sessions: + * @pool: a #GstRTSPSessionPool + * + * Get the maximum allowed number of sessions in @pool. 0 means an unlimited + * amount of sessions. + * + * Returns: the maximum allowed number of sessions. + */ +guint +gst_rtsp_session_pool_get_max_sessions (GstRTSPSessionPool * pool) +{ + GstRTSPSessionPoolPrivate *priv; + guint result; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_POOL (pool), 0); + + priv = pool->priv; + + g_mutex_lock (&priv->lock); + result = priv->max_sessions; + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_session_pool_get_n_sessions: + * @pool: a #GstRTSPSessionPool + * + * Get the amount of active sessions in @pool. + * + * Returns: the amount of active sessions in @pool. + */ +guint +gst_rtsp_session_pool_get_n_sessions (GstRTSPSessionPool * pool) +{ + GstRTSPSessionPoolPrivate *priv; + guint result; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_POOL (pool), 0); + + priv = pool->priv; + + g_mutex_lock (&priv->lock); + result = g_hash_table_size (priv->sessions); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_session_pool_find: + * @pool: the pool to search + * @sessionid: the session id + * + * Find the session with @sessionid in @pool. The access time of the session + * will be updated with gst_rtsp_session_touch(). + * + * Returns: (transfer full) (nullable): the #GstRTSPSession with @sessionid + * or %NULL when the session did not exist. g_object_unref() after usage. + */ +GstRTSPSession * +gst_rtsp_session_pool_find (GstRTSPSessionPool * pool, const gchar * sessionid) +{ + GstRTSPSessionPoolPrivate *priv; + GstRTSPSession *result; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_POOL (pool), NULL); + g_return_val_if_fail (sessionid != NULL, NULL); + + priv = pool->priv; + + g_mutex_lock (&priv->lock); + result = g_hash_table_lookup (priv->sessions, sessionid); + if (result) { + g_object_ref (result); + gst_rtsp_session_touch (result); + } + g_mutex_unlock (&priv->lock); + + return result; +} + +static gchar * +create_session_id (GstRTSPSessionPool * pool) +{ + gchar id[17]; + gint i; + + for (i = 0; i < 16; i++) { + id[i] = + session_id_charset[g_random_int_range (0, + G_N_ELEMENTS (session_id_charset))]; + } + id[16] = 0; + + return g_uri_escape_string (id, NULL, FALSE); +} + +static GstRTSPSession * +create_session (GstRTSPSessionPool * pool, const gchar * id) +{ + return gst_rtsp_session_new (id); +} + +/** + * gst_rtsp_session_pool_create: + * @pool: a #GstRTSPSessionPool + * + * Create a new #GstRTSPSession object in @pool. + * + * Returns: (transfer full): a new #GstRTSPSession. + */ +GstRTSPSession * +gst_rtsp_session_pool_create (GstRTSPSessionPool * pool) +{ + GstRTSPSessionPoolPrivate *priv; + GstRTSPSession *result = NULL; + GstRTSPSessionPoolClass *klass; + gchar *id = NULL; + guint retry; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_POOL (pool), NULL); + + priv = pool->priv; + + klass = GST_RTSP_SESSION_POOL_GET_CLASS (pool); + + retry = 0; + do { + /* start by creating a new random session id, we assume that this is random + * enough to not cause a collision, which we will check later */ + if (klass->create_session_id) + id = klass->create_session_id (pool); + else + goto no_function; + + if (id == NULL) + goto no_session; + + g_mutex_lock (&priv->lock); + /* check session limit */ + if (priv->max_sessions > 0) { + if (g_hash_table_size (priv->sessions) >= priv->max_sessions) + goto too_many_sessions; + } + /* check if the sessionid existed */ + result = g_hash_table_lookup (priv->sessions, id); + if (result) { + /* found, retry with a different session id */ + result = NULL; + retry++; + if (retry > 100) + goto collision; + } else { + /* not found, create session and insert it in the pool */ + if (klass->create_session) + result = create_session (pool, id); + if (result == NULL) + goto too_many_sessions; + /* take additional ref for the pool */ + g_object_ref (result); + g_hash_table_insert (priv->sessions, + (gchar *) gst_rtsp_session_get_sessionid (result), result); + priv->sessions_cookie++; + } + g_mutex_unlock (&priv->lock); + + g_free (id); + } while (result == NULL); + + return result; + + /* ERRORS */ +no_function: + { + GST_WARNING ("no create_session_id vmethod in GstRTSPSessionPool %p", pool); + return NULL; + } +no_session: + { + GST_WARNING ("can't create session id with GstRTSPSessionPool %p", pool); + return NULL; + } +collision: + { + GST_WARNING ("can't find unique sessionid for GstRTSPSessionPool %p", pool); + g_mutex_unlock (&priv->lock); + g_free (id); + return NULL; + } +too_many_sessions: + { + GST_WARNING ("session pool reached max sessions of %d", priv->max_sessions); + g_mutex_unlock (&priv->lock); + g_free (id); + return NULL; + } +} + +/** + * gst_rtsp_session_pool_remove: + * @pool: a #GstRTSPSessionPool + * @sess: (transfer none): a #GstRTSPSession + * + * Remove @sess from @pool, releasing the ref that the pool has on @sess. + * + * Returns: %TRUE if the session was found and removed. + */ +gboolean +gst_rtsp_session_pool_remove (GstRTSPSessionPool * pool, GstRTSPSession * sess) +{ + GstRTSPSessionPoolPrivate *priv; + gboolean found; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_POOL (pool), FALSE); + g_return_val_if_fail (GST_IS_RTSP_SESSION (sess), FALSE); + + priv = pool->priv; + + g_mutex_lock (&priv->lock); + g_object_ref (sess); + found = + g_hash_table_remove (priv->sessions, + gst_rtsp_session_get_sessionid (sess)); + if (found) + priv->sessions_cookie++; + g_mutex_unlock (&priv->lock); + + if (found) + g_signal_emit (pool, gst_rtsp_session_pool_signals[SIGNAL_SESSION_REMOVED], + 0, sess); + + g_object_unref (sess); + + return found; +} + +typedef struct +{ + GTimeVal now; + GstRTSPSessionPool *pool; + GList *removed; +} CleanupData; + +static gboolean +cleanup_func (gchar * sessionid, GstRTSPSession * sess, CleanupData * data) +{ + gboolean expired; + + expired = gst_rtsp_session_is_expired (sess, &data->now); + if (expired) { + GST_DEBUG ("session expired"); + data->removed = g_list_prepend (data->removed, g_object_ref (sess)); + } + return expired; +} + +/** + * gst_rtsp_session_pool_cleanup: + * @pool: a #GstRTSPSessionPool + * + * Inspect all the sessions in @pool and remove the sessions that are inactive + * for more than their timeout. + * + * Returns: the amount of sessions that got removed. + */ +guint +gst_rtsp_session_pool_cleanup (GstRTSPSessionPool * pool) +{ + GstRTSPSessionPoolPrivate *priv; + guint result; + CleanupData data; + GList *walk; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_POOL (pool), 0); + + priv = pool->priv; + + g_get_current_time (&data.now); + data.pool = pool; + data.removed = NULL; + + g_mutex_lock (&priv->lock); + result = + g_hash_table_foreach_remove (priv->sessions, (GHRFunc) cleanup_func, + &data); + if (result > 0) + priv->sessions_cookie++; + g_mutex_unlock (&priv->lock); + + for (walk = data.removed; walk; walk = walk->next) { + GstRTSPSession *sess = walk->data; + + g_signal_emit (pool, + gst_rtsp_session_pool_signals[SIGNAL_SESSION_REMOVED], 0, sess); + + g_object_unref (sess); + } + g_list_free (data.removed); + + return result; +} + +/** + * gst_rtsp_session_pool_filter: + * @pool: a #GstRTSPSessionPool + * @func: (scope call) (allow-none): a callback + * @user_data: (closure): user data passed to @func + * + * Call @func for each session in @pool. The result value of @func determines + * what happens to the session. @func will be called with the session pool + * locked so no further actions on @pool can be performed from @func. + * + * If @func returns #GST_RTSP_FILTER_REMOVE, the session will be set to the + * expired state with gst_rtsp_session_set_expired() and removed from + * @pool. + * + * If @func returns #GST_RTSP_FILTER_KEEP, the session will remain in @pool. + * + * If @func returns #GST_RTSP_FILTER_REF, the session will remain in @pool but + * will also be added with an additional ref to the result GList of this + * function.. + * + * When @func is %NULL, #GST_RTSP_FILTER_REF will be assumed for all sessions. + * + * Returns: (element-type GstRTSPSession) (transfer full): a GList with all + * sessions for which @func returned #GST_RTSP_FILTER_REF. After usage, each + * element in the GList should be unreffed before the list is freed. + */ +GList * +gst_rtsp_session_pool_filter (GstRTSPSessionPool * pool, + GstRTSPSessionPoolFilterFunc func, gpointer user_data) +{ + GstRTSPSessionPoolPrivate *priv; + GHashTableIter iter; + gpointer key, value; + GList *result; + GHashTable *visited; + guint cookie; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_POOL (pool), NULL); + + priv = pool->priv; + + result = NULL; + if (func) + visited = g_hash_table_new_full (NULL, NULL, g_object_unref, NULL); + + g_mutex_lock (&priv->lock); +restart: + g_hash_table_iter_init (&iter, priv->sessions); + cookie = priv->sessions_cookie; + while (g_hash_table_iter_next (&iter, &key, &value)) { + GstRTSPSession *session = value; + GstRTSPFilterResult res; + gboolean changed; + + if (func) { + /* only visit each session once */ + if (g_hash_table_contains (visited, session)) + continue; + + g_hash_table_add (visited, g_object_ref (session)); + g_mutex_unlock (&priv->lock); + + res = func (pool, session, user_data); + + g_mutex_lock (&priv->lock); + } else + res = GST_RTSP_FILTER_REF; + + changed = (cookie != priv->sessions_cookie); + + switch (res) { + case GST_RTSP_FILTER_REMOVE: + { + gboolean removed = TRUE; + + if (changed) + /* something changed, check if we still have the session */ + removed = g_hash_table_remove (priv->sessions, key); + else + g_hash_table_iter_remove (&iter); + + if (removed) { + /* if we managed to remove the session, update the cookie and + * signal */ + cookie = ++priv->sessions_cookie; + g_mutex_unlock (&priv->lock); + + g_signal_emit (pool, + gst_rtsp_session_pool_signals[SIGNAL_SESSION_REMOVED], 0, + session); + + g_mutex_lock (&priv->lock); + /* cookie could have changed again, make sure we restart */ + changed |= (cookie != priv->sessions_cookie); + } + break; + } + case GST_RTSP_FILTER_REF: + /* keep ref */ + result = g_list_prepend (result, g_object_ref (session)); + break; + case GST_RTSP_FILTER_KEEP: + default: + break; + } + if (changed) + goto restart; + } + g_mutex_unlock (&priv->lock); + + if (func) + g_hash_table_unref (visited); + + return result; +} + +typedef struct +{ + GSource source; + GstRTSPSessionPool *pool; + gint timeout; +} GstPoolSource; + +static void +collect_timeout (gchar * sessionid, GstRTSPSession * sess, GstPoolSource * psrc) +{ + gint timeout; + GTimeVal now; + + g_get_current_time (&now); + + timeout = gst_rtsp_session_next_timeout (sess, &now); + GST_INFO ("%p: next timeout: %d", sess, timeout); + if (psrc->timeout == -1 || timeout < psrc->timeout) + psrc->timeout = timeout; +} + +static gboolean +gst_pool_source_prepare (GSource * source, gint * timeout) +{ + GstRTSPSessionPoolPrivate *priv; + GstPoolSource *psrc; + gboolean result; + + psrc = (GstPoolSource *) source; + psrc->timeout = -1; + priv = psrc->pool->priv; + + g_mutex_lock (&priv->lock); + g_hash_table_foreach (priv->sessions, (GHFunc) collect_timeout, psrc); + g_mutex_unlock (&priv->lock); + + if (timeout) + *timeout = psrc->timeout; + + result = psrc->timeout == 0; + + GST_INFO ("prepare %d, %d", psrc->timeout, result); + + return result; +} + +static gboolean +gst_pool_source_check (GSource * source) +{ + GST_INFO ("check"); + + return gst_pool_source_prepare (source, NULL); +} + +static gboolean +gst_pool_source_dispatch (GSource * source, GSourceFunc callback, + gpointer user_data) +{ + gboolean res; + GstPoolSource *psrc = (GstPoolSource *) source; + GstRTSPSessionPoolFunc func = (GstRTSPSessionPoolFunc) callback; + + GST_INFO ("dispatch"); + + if (func) + res = func (psrc->pool, user_data); + else + res = FALSE; + + return res; +} + +static void +gst_pool_source_finalize (GSource * source) +{ + GstPoolSource *psrc = (GstPoolSource *) source; + + GST_INFO ("finalize %p", psrc); + + g_object_unref (psrc->pool); + psrc->pool = NULL; +} + +static GSourceFuncs gst_pool_source_funcs = { + gst_pool_source_prepare, + gst_pool_source_check, + gst_pool_source_dispatch, + gst_pool_source_finalize +}; + +/** + * gst_rtsp_session_pool_create_watch: + * @pool: a #GstRTSPSessionPool + * + * Create a #GSource that will be dispatched when the session should be cleaned + * up. + * + * Returns: (transfer full): a #GSource + */ +GSource * +gst_rtsp_session_pool_create_watch (GstRTSPSessionPool * pool) +{ + GstPoolSource *source; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_POOL (pool), NULL); + + source = (GstPoolSource *) g_source_new (&gst_pool_source_funcs, + sizeof (GstPoolSource)); + source->pool = g_object_ref (pool); + + return (GSource *) source; +} diff --git a/gst/rtsp-server/rtsp-session-pool.h b/gst/rtsp-server/rtsp-session-pool.h new file mode 100644 index 0000000..e2ba951 --- /dev/null +++ b/gst/rtsp-server/rtsp-session-pool.h @@ -0,0 +1,143 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#ifndef __GST_RTSP_SESSION_POOL_H__ +#define __GST_RTSP_SESSION_POOL_H__ + +G_BEGIN_DECLS + +typedef struct _GstRTSPSessionPool GstRTSPSessionPool; +typedef struct _GstRTSPSessionPoolClass GstRTSPSessionPoolClass; +typedef struct _GstRTSPSessionPoolPrivate GstRTSPSessionPoolPrivate; + +#include "rtsp-session.h" + +#define GST_TYPE_RTSP_SESSION_POOL (gst_rtsp_session_pool_get_type ()) +#define GST_IS_RTSP_SESSION_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_SESSION_POOL)) +#define GST_IS_RTSP_SESSION_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_SESSION_POOL)) +#define GST_RTSP_SESSION_POOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_SESSION_POOL, GstRTSPSessionPoolClass)) +#define GST_RTSP_SESSION_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_SESSION_POOL, GstRTSPSessionPool)) +#define GST_RTSP_SESSION_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_SESSION_POOL, GstRTSPSessionPoolClass)) +#define GST_RTSP_SESSION_POOL_CAST(obj) ((GstRTSPSessionPool*)(obj)) +#define GST_RTSP_SESSION_POOL_CLASS_CAST(klass) ((GstRTSPSessionPoolClass*)(klass)) + +/** + * GstRTSPSessionPool: + * + * An object that keeps track of the active sessions. This object is usually + * attached to a #GstRTSPServer object to manage the sessions in that server. + */ +struct _GstRTSPSessionPool { + GObject parent; + + /*< private >*/ + GstRTSPSessionPoolPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPSessionPoolClass: + * @create_session_id: create a new random session id. Subclasses can create + * custom session ids and should not check if the session exists. + * @create_session: make a new session object. + * @session_removed: a session was removed from the pool + */ +struct _GstRTSPSessionPoolClass { + GObjectClass parent_class; + + gchar * (*create_session_id) (GstRTSPSessionPool *pool); + GstRTSPSession * (*create_session) (GstRTSPSessionPool *pool, const gchar *id); + + /* signals */ + void (*session_removed) (GstRTSPSessionPool *pool, + GstRTSPSession *session); + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING_LARGE - 1]; +}; + +/** + * GstRTSPSessionPoolFunc: + * @pool: a #GstRTSPSessionPool object + * @user_data: user data that has been given when registering the handler + * + * The function that will be called from the GSource watch on the session pool. + * + * The function will be called when the pool must be cleaned up because one or + * more sessions timed out. + * + * Returns: %FALSE if the source should be removed. + */ +typedef gboolean (*GstRTSPSessionPoolFunc) (GstRTSPSessionPool *pool, gpointer user_data); + +/** + * GstRTSPSessionPoolFilterFunc: + * @pool: a #GstRTSPSessionPool object + * @session: a #GstRTSPSession in @pool + * @user_data: user data that has been given to gst_rtsp_session_pool_filter() + * + * This function will be called by the gst_rtsp_session_pool_filter(). An + * implementation should return a value of #GstRTSPFilterResult. + * + * When this function returns #GST_RTSP_FILTER_REMOVE, @session will be removed + * from @pool. + * + * A return value of #GST_RTSP_FILTER_KEEP will leave @session untouched in + * @pool. + * + * A value of GST_RTSP_FILTER_REF will add @session to the result #GList of + * gst_rtsp_session_pool_filter(). + * + * Returns: a #GstRTSPFilterResult. + */ +typedef GstRTSPFilterResult (*GstRTSPSessionPoolFilterFunc) (GstRTSPSessionPool *pool, + GstRTSPSession *session, + gpointer user_data); + + +GType gst_rtsp_session_pool_get_type (void); + +/* creating a session pool */ +GstRTSPSessionPool * gst_rtsp_session_pool_new (void); + +/* counting sessions */ +void gst_rtsp_session_pool_set_max_sessions (GstRTSPSessionPool *pool, guint max); +guint gst_rtsp_session_pool_get_max_sessions (GstRTSPSessionPool *pool); + +guint gst_rtsp_session_pool_get_n_sessions (GstRTSPSessionPool *pool); + +/* managing sessions */ +GstRTSPSession * gst_rtsp_session_pool_create (GstRTSPSessionPool *pool); +GstRTSPSession * gst_rtsp_session_pool_find (GstRTSPSessionPool *pool, + const gchar *sessionid); +gboolean gst_rtsp_session_pool_remove (GstRTSPSessionPool *pool, + GstRTSPSession *sess); + +/* perform session maintenance */ +GList * gst_rtsp_session_pool_filter (GstRTSPSessionPool *pool, + GstRTSPSessionPoolFilterFunc func, + gpointer user_data); +guint gst_rtsp_session_pool_cleanup (GstRTSPSessionPool *pool); +GSource * gst_rtsp_session_pool_create_watch (GstRTSPSessionPool *pool); + +G_END_DECLS + +#endif /* __GST_RTSP_SESSION_POOL_H__ */ diff --git a/gst/rtsp-server/rtsp-session.c b/gst/rtsp-server/rtsp-session.c new file mode 100644 index 0000000..372746a --- /dev/null +++ b/gst/rtsp-server/rtsp-session.c @@ -0,0 +1,649 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-session + * @short_description: An object to manage media + * @see_also: #GstRTSPSessionPool, #GstRTSPSessionMedia, #GstRTSPMedia + * + * The #GstRTSPSession is identified by an id, unique in the + * #GstRTSPSessionPool that created the session and manages media and its + * configuration. + * + * A #GstRTSPSession has a timeout that can be retrieved with + * gst_rtsp_session_get_timeout(). You can check if the sessions is expired with + * gst_rtsp_session_is_expired(). gst_rtsp_session_touch() will reset the + * expiration counter of the session. + * + * When a client configures a media with SETUP, a session will be created to + * keep track of the configuration of that media. With + * gst_rtsp_session_manage_media(), the media is added to the managed media + * in the session. With gst_rtsp_session_release_media() the media can be + * released again from the session. Managed media is identified in the sessions + * with a url. Use gst_rtsp_session_get_media() to get the media that matches + * (part of) the given url. + * + * The media in a session can be iterated with gst_rtsp_session_filter(). + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include + +#include "rtsp-session.h" + +#define GST_RTSP_SESSION_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_SESSION, GstRTSPSessionPrivate)) + +struct _GstRTSPSessionPrivate +{ + GMutex lock; /* protects everything but sessionid and create_time */ + gchar *sessionid; + + guint timeout; + gboolean timeout_always_visible; + GTimeVal create_time; /* immutable */ + GTimeVal last_access; + gint expire_count; + + GList *medias; + guint medias_cookie; +}; + +#undef DEBUG + +#define DEFAULT_TIMEOUT 60 +#define DEFAULT_ALWAYS_VISIBLE FALSE + +enum +{ + PROP_0, + PROP_SESSIONID, + PROP_TIMEOUT, + PROP_TIMEOUT_ALWAYS_VISIBLE, + PROP_LAST +}; + +GST_DEBUG_CATEGORY_STATIC (rtsp_session_debug); +#define GST_CAT_DEFAULT rtsp_session_debug + +static void gst_rtsp_session_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec); +static void gst_rtsp_session_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec); +static void gst_rtsp_session_finalize (GObject * obj); + +G_DEFINE_TYPE (GstRTSPSession, gst_rtsp_session, G_TYPE_OBJECT); + +static void +gst_rtsp_session_class_init (GstRTSPSessionClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPSessionPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->get_property = gst_rtsp_session_get_property; + gobject_class->set_property = gst_rtsp_session_set_property; + gobject_class->finalize = gst_rtsp_session_finalize; + + g_object_class_install_property (gobject_class, PROP_SESSIONID, + g_param_spec_string ("sessionid", "Sessionid", "the session id", + NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_TIMEOUT, + g_param_spec_uint ("timeout", "timeout", + "the timeout of the session (0 = never)", 0, G_MAXUINT, + DEFAULT_TIMEOUT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_TIMEOUT_ALWAYS_VISIBLE, + g_param_spec_boolean ("timeout-always-visible", "Timeout Always Visible ", + "timeout always visible in header", + DEFAULT_ALWAYS_VISIBLE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + GST_DEBUG_CATEGORY_INIT (rtsp_session_debug, "rtspsession", 0, + "GstRTSPSession"); +} + +static void +gst_rtsp_session_init (GstRTSPSession * session) +{ + GstRTSPSessionPrivate *priv = GST_RTSP_SESSION_GET_PRIVATE (session); + + session->priv = priv; + + GST_INFO ("init session %p", session); + + g_mutex_init (&priv->lock); + priv->timeout = DEFAULT_TIMEOUT; + g_get_current_time (&priv->create_time); + gst_rtsp_session_touch (session); +} + +static void +gst_rtsp_session_finalize (GObject * obj) +{ + GstRTSPSession *session; + GstRTSPSessionPrivate *priv; + + session = GST_RTSP_SESSION (obj); + priv = session->priv; + + GST_INFO ("finalize session %p", session); + + /* free all media */ + g_list_free_full (priv->medias, g_object_unref); + + /* free session id */ + g_free (priv->sessionid); + g_mutex_clear (&priv->lock); + + G_OBJECT_CLASS (gst_rtsp_session_parent_class)->finalize (obj); +} + +static void +gst_rtsp_session_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + GstRTSPSession *session = GST_RTSP_SESSION (object); + GstRTSPSessionPrivate *priv = session->priv; + + switch (propid) { + case PROP_SESSIONID: + g_value_set_string (value, priv->sessionid); + break; + case PROP_TIMEOUT: + g_value_set_uint (value, gst_rtsp_session_get_timeout (session)); + break; + case PROP_TIMEOUT_ALWAYS_VISIBLE: + g_value_set_boolean (value, priv->timeout_always_visible); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_session_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + GstRTSPSession *session = GST_RTSP_SESSION (object); + GstRTSPSessionPrivate *priv = session->priv; + + switch (propid) { + case PROP_SESSIONID: + g_free (priv->sessionid); + priv->sessionid = g_value_dup_string (value); + break; + case PROP_TIMEOUT: + gst_rtsp_session_set_timeout (session, g_value_get_uint (value)); + break; + case PROP_TIMEOUT_ALWAYS_VISIBLE: + g_mutex_lock (&priv->lock); + priv->timeout_always_visible = g_value_get_boolean (value); + g_mutex_unlock (&priv->lock); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +/** + * gst_rtsp_session_manage_media: + * @sess: a #GstRTSPSession + * @path: the path for the media + * @media: (transfer full): a #GstRTSPMedia + * + * Manage the media object @obj in @sess. @path will be used to retrieve this + * media from the session with gst_rtsp_session_get_media(). + * + * Ownership is taken from @media. + * + * Returns: (transfer none): a new @GstRTSPSessionMedia object. + */ +GstRTSPSessionMedia * +gst_rtsp_session_manage_media (GstRTSPSession * sess, const gchar * path, + GstRTSPMedia * media) +{ + GstRTSPSessionPrivate *priv; + GstRTSPSessionMedia *result; + GstRTSPMediaStatus status; + + g_return_val_if_fail (GST_IS_RTSP_SESSION (sess), NULL); + g_return_val_if_fail (path != NULL, NULL); + g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL); + status = gst_rtsp_media_get_status (media); + g_return_val_if_fail (status == GST_RTSP_MEDIA_STATUS_PREPARED || status == + GST_RTSP_MEDIA_STATUS_SUSPENDED, NULL); + + priv = sess->priv; + + result = gst_rtsp_session_media_new (path, media); + + g_mutex_lock (&priv->lock); + priv->medias = g_list_prepend (priv->medias, result); + priv->medias_cookie++; + g_mutex_unlock (&priv->lock); + + GST_INFO ("manage new media %p in session %p", media, result); + + return result; +} + +/** + * gst_rtsp_session_release_media: + * @sess: a #GstRTSPSession + * @media: (transfer none): a #GstRTSPMedia + * + * Release the managed @media in @sess, freeing the memory allocated by it. + * + * Returns: %TRUE if there are more media session left in @sess. + */ +gboolean +gst_rtsp_session_release_media (GstRTSPSession * sess, + GstRTSPSessionMedia * media) +{ + GstRTSPSessionPrivate *priv; + GList *find; + gboolean more; + + g_return_val_if_fail (GST_IS_RTSP_SESSION (sess), FALSE); + g_return_val_if_fail (media != NULL, FALSE); + + priv = sess->priv; + + g_mutex_lock (&priv->lock); + find = g_list_find (priv->medias, media); + if (find) { + priv->medias = g_list_delete_link (priv->medias, find); + priv->medias_cookie++; + } + more = (priv->medias != NULL); + g_mutex_unlock (&priv->lock); + + if (find) + g_object_unref (media); + + return more; +} + +/** + * gst_rtsp_session_get_media: + * @sess: a #GstRTSPSession + * @path: the path for the media + * @matched: (out): the amount of matched characters + * + * Get the session media for @path. @matched will contain the number of matched + * characters of @path. + * + * Returns: (transfer none): the configuration for @path in @sess. + */ +GstRTSPSessionMedia * +gst_rtsp_session_get_media (GstRTSPSession * sess, const gchar * path, + gint * matched) +{ + GstRTSPSessionPrivate *priv; + GstRTSPSessionMedia *result; + GList *walk; + gint best; + + g_return_val_if_fail (GST_IS_RTSP_SESSION (sess), NULL); + g_return_val_if_fail (path != NULL, NULL); + + priv = sess->priv; + result = NULL; + best = 0; + + g_mutex_lock (&priv->lock); + for (walk = priv->medias; walk; walk = g_list_next (walk)) { + GstRTSPSessionMedia *test; + + test = (GstRTSPSessionMedia *) walk->data; + + /* find largest match */ + if (gst_rtsp_session_media_matches (test, path, matched)) { + if (best < *matched) { + result = test; + best = *matched; + } + } + } + g_mutex_unlock (&priv->lock); + + *matched = best; + + return result; +} + +/** + * gst_rtsp_session_filter: + * @sess: a #GstRTSPSession + * @func: (scope call) (allow-none): a callback + * @user_data: (closure): user data passed to @func + * + * Call @func for each media in @sess. The result value of @func determines + * what happens to the media. @func will be called with @sess + * locked so no further actions on @sess can be performed from @func. + * + * If @func returns #GST_RTSP_FILTER_REMOVE, the media will be removed from + * @sess. + * + * If @func returns #GST_RTSP_FILTER_KEEP, the media will remain in @sess. + * + * If @func returns #GST_RTSP_FILTER_REF, the media will remain in @sess but + * will also be added with an additional ref to the result #GList of this + * function.. + * + * When @func is %NULL, #GST_RTSP_FILTER_REF will be assumed for all media. + * + * Returns: (element-type GstRTSPSessionMedia) (transfer full): a GList with all + * media for which @func returned #GST_RTSP_FILTER_REF. After usage, each + * element in the #GList should be unreffed before the list is freed. + */ +GList * +gst_rtsp_session_filter (GstRTSPSession * sess, + GstRTSPSessionFilterFunc func, gpointer user_data) +{ + GstRTSPSessionPrivate *priv; + GList *result, *walk, *next; + GHashTable *visited; + guint cookie; + + g_return_val_if_fail (GST_IS_RTSP_SESSION (sess), NULL); + + priv = sess->priv; + + result = NULL; + if (func) + visited = g_hash_table_new_full (NULL, NULL, g_object_unref, NULL); + + g_mutex_lock (&priv->lock); +restart: + cookie = priv->medias_cookie; + for (walk = priv->medias; walk; walk = next) { + GstRTSPSessionMedia *media = walk->data; + GstRTSPFilterResult res; + gboolean changed; + + next = g_list_next (walk); + + if (func) { + /* only visit each media once */ + if (g_hash_table_contains (visited, media)) + continue; + + g_hash_table_add (visited, g_object_ref (media)); + g_mutex_unlock (&priv->lock); + + res = func (sess, media, user_data); + + g_mutex_lock (&priv->lock); + } else + res = GST_RTSP_FILTER_REF; + + changed = (cookie != priv->medias_cookie); + + switch (res) { + case GST_RTSP_FILTER_REMOVE: + if (changed) + priv->medias = g_list_remove (priv->medias, media); + else + priv->medias = g_list_delete_link (priv->medias, walk); + cookie = ++priv->medias_cookie; + g_object_unref (media); + break; + case GST_RTSP_FILTER_REF: + result = g_list_prepend (result, g_object_ref (media)); + break; + case GST_RTSP_FILTER_KEEP: + default: + break; + } + if (changed) + goto restart; + } + g_mutex_unlock (&priv->lock); + + if (func) + g_hash_table_unref (visited); + + return result; +} + +/** + * gst_rtsp_session_new: + * @sessionid: a session id + * + * Create a new #GstRTSPSession instance with @sessionid. + * + * Returns: (transfer full): a new #GstRTSPSession + */ +GstRTSPSession * +gst_rtsp_session_new (const gchar * sessionid) +{ + GstRTSPSession *result; + + g_return_val_if_fail (sessionid != NULL, NULL); + + result = g_object_new (GST_TYPE_RTSP_SESSION, "sessionid", sessionid, NULL); + + return result; +} + +/** + * gst_rtsp_session_get_sessionid: + * @session: a #GstRTSPSession + * + * Get the sessionid of @session. + * + * Returns: (transfer none): the sessionid of @session. The value remains valid + * as long as @session is alive. + */ +const gchar * +gst_rtsp_session_get_sessionid (GstRTSPSession * session) +{ + g_return_val_if_fail (GST_IS_RTSP_SESSION (session), NULL); + + return session->priv->sessionid; +} + +/** + * gst_rtsp_session_get_header: + * @session: a #GstRTSPSession + * + * Get the string that can be placed in the Session header field. + * + * Returns: (transfer full): the Session header of @session. g_free() after usage. + */ +gchar * +gst_rtsp_session_get_header (GstRTSPSession * session) +{ + GstRTSPSessionPrivate *priv; + gchar *result; + + g_return_val_if_fail (GST_IS_RTSP_SESSION (session), NULL); + + priv = session->priv; + + + g_mutex_lock (&priv->lock); + if (priv->timeout_always_visible || priv->timeout != 60) + result = g_strdup_printf ("%s; timeout=%d", priv->sessionid, priv->timeout); + else + result = g_strdup (priv->sessionid); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_session_set_timeout: + * @session: a #GstRTSPSession + * @timeout: the new timeout + * + * Configure @session for a timeout of @timeout seconds. The session will be + * cleaned up when there is no activity for @timeout seconds. + */ +void +gst_rtsp_session_set_timeout (GstRTSPSession * session, guint timeout) +{ + GstRTSPSessionPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_SESSION (session)); + + priv = session->priv; + + g_mutex_lock (&priv->lock); + priv->timeout = timeout; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_session_get_timeout: + * @session: a #GstRTSPSession + * + * Get the timeout value of @session. + * + * Returns: the timeout of @session in seconds. + */ +guint +gst_rtsp_session_get_timeout (GstRTSPSession * session) +{ + GstRTSPSessionPrivate *priv; + guint res; + + g_return_val_if_fail (GST_IS_RTSP_SESSION (session), 0); + + priv = session->priv; + + g_mutex_lock (&priv->lock); + res = priv->timeout; + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_session_touch: + * @session: a #GstRTSPSession + * + * Update the last_access time of the session to the current time. + */ +void +gst_rtsp_session_touch (GstRTSPSession * session) +{ + GstRTSPSessionPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_SESSION (session)); + + priv = session->priv; + + g_mutex_lock (&priv->lock); + g_get_current_time (&priv->last_access); + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_session_prevent_expire: + * @session: a #GstRTSPSession + * + * Prevent @session from expiring. + */ +void +gst_rtsp_session_prevent_expire (GstRTSPSession * session) +{ + g_return_if_fail (GST_IS_RTSP_SESSION (session)); + + g_atomic_int_add (&session->priv->expire_count, 1); +} + +/** + * gst_rtsp_session_allow_expire: + * @session: a #GstRTSPSession + * + * Allow @session to expire. This method must be called an equal + * amount of time as gst_rtsp_session_prevent_expire(). + */ +void +gst_rtsp_session_allow_expire (GstRTSPSession * session) +{ + g_atomic_int_add (&session->priv->expire_count, -1); +} + +/** + * gst_rtsp_session_next_timeout: + * @session: a #GstRTSPSession + * @now: (transfer none): the current system time + * + * Get the amount of milliseconds till the session will expire. + * + * Returns: the amount of milliseconds since the session will time out. + */ +gint +gst_rtsp_session_next_timeout (GstRTSPSession * session, GTimeVal * now) +{ + GstRTSPSessionPrivate *priv; + gint res; + GstClockTime last_access, now_ns; + + g_return_val_if_fail (GST_IS_RTSP_SESSION (session), -1); + g_return_val_if_fail (now != NULL, -1); + + priv = session->priv; + + g_mutex_lock (&priv->lock); + if (g_atomic_int_get (&priv->expire_count) != 0) { + /* touch session when the expire count is not 0 */ + g_get_current_time (&priv->last_access); + } + + last_access = GST_TIMEVAL_TO_TIME (priv->last_access); + /* add timeout allow for 5 seconds of extra time */ + last_access += priv->timeout * GST_SECOND + (5 * GST_SECOND); + g_mutex_unlock (&priv->lock); + + now_ns = GST_TIMEVAL_TO_TIME (*now); + + if (last_access > now_ns) + res = GST_TIME_AS_MSECONDS (last_access - now_ns); + else + res = 0; + + return res; +} + +/** + * gst_rtsp_session_is_expired: + * @session: a #GstRTSPSession + * @now: (transfer none): the current system time + * + * Check if @session timeout out. + * + * Returns: %TRUE if @session timed out + */ +gboolean +gst_rtsp_session_is_expired (GstRTSPSession * session, GTimeVal * now) +{ + gboolean res; + + res = (gst_rtsp_session_next_timeout (session, now) == 0); + + return res; +} diff --git a/gst/rtsp-server/rtsp-session.h b/gst/rtsp-server/rtsp-session.h new file mode 100644 index 0000000..d9c0f18 --- /dev/null +++ b/gst/rtsp-server/rtsp-session.h @@ -0,0 +1,143 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +#ifndef __GST_RTSP_SESSION_H__ +#define __GST_RTSP_SESSION_H__ + +G_BEGIN_DECLS + +#define GST_TYPE_RTSP_SESSION (gst_rtsp_session_get_type ()) +#define GST_IS_RTSP_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_SESSION)) +#define GST_IS_RTSP_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_SESSION)) +#define GST_RTSP_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_SESSION, GstRTSPSessionClass)) +#define GST_RTSP_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_SESSION, GstRTSPSession)) +#define GST_RTSP_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_SESSION, GstRTSPSessionClass)) +#define GST_RTSP_SESSION_CAST(obj) ((GstRTSPSession*)(obj)) +#define GST_RTSP_SESSION_CLASS_CAST(klass) ((GstRTSPSessionClass*)(klass)) + +typedef struct _GstRTSPSession GstRTSPSession; +typedef struct _GstRTSPSessionClass GstRTSPSessionClass; +typedef struct _GstRTSPSessionPrivate GstRTSPSessionPrivate; + +/** + * GstRTSPFilterResult: + * @GST_RTSP_FILTER_REMOVE: Remove session + * @GST_RTSP_FILTER_KEEP: Keep session in the pool + * @GST_RTSP_FILTER_REF: Ref session in the result list + * + * Possible return values for gst_rtsp_session_pool_filter(). + */ +typedef enum +{ + GST_RTSP_FILTER_REMOVE, + GST_RTSP_FILTER_KEEP, + GST_RTSP_FILTER_REF, +} GstRTSPFilterResult; + +#include "rtsp-media.h" +#include "rtsp-session-media.h" + +/** + * GstRTSPSession: + * + * Session information kept by the server for a specific client. + * One client session, identified with a session id, can handle multiple medias + * identified with the url of a media. + */ +struct _GstRTSPSession { + GObject parent; + + /*< private >*/ + GstRTSPSessionPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +struct _GstRTSPSessionClass { + GObjectClass parent_class; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +GType gst_rtsp_session_get_type (void); + +/* create a new session */ +GstRTSPSession * gst_rtsp_session_new (const gchar *sessionid); + +const gchar * gst_rtsp_session_get_sessionid (GstRTSPSession *session); + +gchar * gst_rtsp_session_get_header (GstRTSPSession *session); + +void gst_rtsp_session_set_timeout (GstRTSPSession *session, guint timeout); +guint gst_rtsp_session_get_timeout (GstRTSPSession *session); + +/* session timeout stuff */ +void gst_rtsp_session_touch (GstRTSPSession *session); +void gst_rtsp_session_prevent_expire (GstRTSPSession *session); +void gst_rtsp_session_allow_expire (GstRTSPSession *session); +gint gst_rtsp_session_next_timeout (GstRTSPSession *session, GTimeVal *now); +gboolean gst_rtsp_session_is_expired (GstRTSPSession *session, GTimeVal *now); + +/* handle media in a session */ +GstRTSPSessionMedia * gst_rtsp_session_manage_media (GstRTSPSession *sess, + const gchar *path, + GstRTSPMedia *media); +gboolean gst_rtsp_session_release_media (GstRTSPSession *sess, + GstRTSPSessionMedia *media); +/* get media in a session */ +GstRTSPSessionMedia * gst_rtsp_session_get_media (GstRTSPSession *sess, + const gchar *path, + gint * matched); + +/** + * GstRTSPSessionFilterFunc: + * @sess: a #GstRTSPSession object + * @media: a #GstRTSPSessionMedia in @sess + * @user_data: user data that has been given to gst_rtsp_session_filter() + * + * This function will be called by the gst_rtsp_session_filter(). An + * implementation should return a value of #GstRTSPFilterResult. + * + * When this function returns #GST_RTSP_FILTER_REMOVE, @media will be removed + * from @sess. + * + * A return value of #GST_RTSP_FILTER_KEEP will leave @media untouched in + * @sess. + * + * A value of GST_RTSP_FILTER_REF will add @media to the result #GList of + * gst_rtsp_session_filter(). + * + * Returns: a #GstRTSPFilterResult. + */ +typedef GstRTSPFilterResult (*GstRTSPSessionFilterFunc) (GstRTSPSession *sess, + GstRTSPSessionMedia *media, + gpointer user_data); + +GList * gst_rtsp_session_filter (GstRTSPSession *sess, + GstRTSPSessionFilterFunc func, + gpointer user_data); + + +G_END_DECLS + +#endif /* __GST_RTSP_SESSION_H__ */ diff --git a/gst/rtsp-server/rtsp-stream-transport.c b/gst/rtsp-server/rtsp-stream-transport.c new file mode 100644 index 0000000..a99295b --- /dev/null +++ b/gst/rtsp-server/rtsp-stream-transport.c @@ -0,0 +1,503 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-stream-transport + * @short_description: A media stream transport configuration + * @see_also: #GstRTSPStream, #GstRTSPSessionMedia + * + * The #GstRTSPStreamTransport configures the transport used by a + * #GstRTSPStream. It is usually manages by a #GstRTSPSessionMedia object. + * + * With gst_rtsp_stream_transport_set_callbacks(), callbacks can be configured + * to handle the RTP and RTCP packets from the stream, for example when they + * need to be sent over TCP. + * + * With gst_rtsp_stream_transport_set_active() the transports are added and + * removed from the stream. + * + * A #GstRTSPStream will call gst_rtsp_stream_transport_keep_alive() when RTCP + * is received from the client. It will also call + * gst_rtsp_stream_transport_set_timed_out() when a receiver has timed out. + * + * Last reviewed on 2013-07-16 (1.0.0) + */ + +#include +#include + +#include "rtsp-stream-transport.h" + +#define GST_RTSP_STREAM_TRANSPORT_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_STREAM_TRANSPORT, GstRTSPStreamTransportPrivate)) + +struct _GstRTSPStreamTransportPrivate +{ + GstRTSPStream *stream; + + GstRTSPSendFunc send_rtp; + GstRTSPSendFunc send_rtcp; + gpointer user_data; + GDestroyNotify notify; + + GstRTSPKeepAliveFunc keep_alive; + gpointer ka_user_data; + GDestroyNotify ka_notify; + gboolean active; + gboolean timed_out; + + GstRTSPTransport *transport; + GstRTSPUrl *url; + + GObject *rtpsource; +}; + +enum +{ + PROP_0, + PROP_LAST +}; + +GST_DEBUG_CATEGORY_STATIC (rtsp_stream_transport_debug); +#define GST_CAT_DEFAULT rtsp_stream_transport_debug + +static void gst_rtsp_stream_transport_finalize (GObject * obj); + +G_DEFINE_TYPE (GstRTSPStreamTransport, gst_rtsp_stream_transport, + G_TYPE_OBJECT); + +static void +gst_rtsp_stream_transport_class_init (GstRTSPStreamTransportClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPStreamTransportPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = gst_rtsp_stream_transport_finalize; + + GST_DEBUG_CATEGORY_INIT (rtsp_stream_transport_debug, "rtspmediatransport", + 0, "GstRTSPStreamTransport"); +} + +static void +gst_rtsp_stream_transport_init (GstRTSPStreamTransport * trans) +{ + GstRTSPStreamTransportPrivate *priv = + GST_RTSP_STREAM_TRANSPORT_GET_PRIVATE (trans); + + trans->priv = priv; +} + +static void +gst_rtsp_stream_transport_finalize (GObject * obj) +{ + GstRTSPStreamTransportPrivate *priv; + GstRTSPStreamTransport *trans; + + trans = GST_RTSP_STREAM_TRANSPORT (obj); + priv = trans->priv; + + /* remove callbacks now */ + gst_rtsp_stream_transport_set_callbacks (trans, NULL, NULL, NULL, NULL); + gst_rtsp_stream_transport_set_keepalive (trans, NULL, NULL, NULL); + + if (priv->transport) + gst_rtsp_transport_free (priv->transport); + + if (priv->url) + gst_rtsp_url_free (priv->url); + + G_OBJECT_CLASS (gst_rtsp_stream_transport_parent_class)->finalize (obj); +} + +/** + * gst_rtsp_stream_transport_new: + * @stream: a #GstRTSPStream + * @tr: (transfer full): a GstRTSPTransport + * + * Create a new #GstRTSPStreamTransport that can be used to manage + * @stream with transport @tr. + * + * Returns: (transfer full): a new #GstRTSPStreamTransport + */ +GstRTSPStreamTransport * +gst_rtsp_stream_transport_new (GstRTSPStream * stream, GstRTSPTransport * tr) +{ + GstRTSPStreamTransportPrivate *priv; + GstRTSPStreamTransport *trans; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + g_return_val_if_fail (tr != NULL, NULL); + + trans = g_object_new (GST_TYPE_RTSP_STREAM_TRANSPORT, NULL); + priv = trans->priv; + priv->stream = stream; + priv->transport = tr; + + return trans; +} + +/** + * gst_rtsp_stream_transport_get_stream: + * @trans: a #GstRTSPStreamTransport + * + * Get the #GstRTSPStream used when constructing @trans. + * + * Returns: (transfer none): the stream used when constructing @trans. + */ +GstRTSPStream * +gst_rtsp_stream_transport_get_stream (GstRTSPStreamTransport * trans) +{ + g_return_val_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans), NULL); + + return trans->priv->stream; +} + +/** + * gst_rtsp_stream_transport_set_callbacks: + * @trans: a #GstRTSPStreamTransport + * @send_rtp: (scope notified): a callback called when RTP should be sent + * @send_rtcp: (scope notified): a callback called when RTCP should be sent + * @user_data: (closure): user data passed to callbacks + * @notify: (allow-none): called with the user_data when no longer needed. + * + * Install callbacks that will be called when data for a stream should be sent + * to a client. This is usually used when sending RTP/RTCP over TCP. + */ +void +gst_rtsp_stream_transport_set_callbacks (GstRTSPStreamTransport * trans, + GstRTSPSendFunc send_rtp, GstRTSPSendFunc send_rtcp, + gpointer user_data, GDestroyNotify notify) +{ + GstRTSPStreamTransportPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans)); + + priv = trans->priv; + + priv->send_rtp = send_rtp; + priv->send_rtcp = send_rtcp; + if (priv->notify) + priv->notify (priv->user_data); + priv->user_data = user_data; + priv->notify = notify; +} + +/** + * gst_rtsp_stream_transport_set_keepalive: + * @trans: a #GstRTSPStreamTransport + * @keep_alive: (scope notified): a callback called when the receiver is active + * @user_data: (closure): user data passed to callback + * @notify: (allow-none): called with the user_data when no longer needed. + * + * Install callbacks that will be called when RTCP packets are received from the + * receiver of @trans. + */ +void +gst_rtsp_stream_transport_set_keepalive (GstRTSPStreamTransport * trans, + GstRTSPKeepAliveFunc keep_alive, gpointer user_data, GDestroyNotify notify) +{ + GstRTSPStreamTransportPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans)); + + priv = trans->priv; + + priv->keep_alive = keep_alive; + if (priv->ka_notify) + priv->ka_notify (priv->ka_user_data); + priv->ka_user_data = user_data; + priv->ka_notify = notify; +} + + +/** + * gst_rtsp_stream_transport_set_transport: + * @trans: a #GstRTSPStreamTransport + * @tr: (transfer full): a client #GstRTSPTransport + * + * Set @tr as the client transport. This function takes ownership of the + * passed @tr. + */ +void +gst_rtsp_stream_transport_set_transport (GstRTSPStreamTransport * trans, + GstRTSPTransport * tr) +{ + GstRTSPStreamTransportPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans)); + g_return_if_fail (tr != NULL); + + priv = trans->priv; + + /* keep track of the transports in the stream. */ + if (priv->transport) + gst_rtsp_transport_free (priv->transport); + priv->transport = tr; +} + +/** + * gst_rtsp_stream_transport_get_transport: + * @trans: a #GstRTSPStreamTransport + * + * Get the transport configured in @trans. + * + * Returns: (transfer none): the transport configured in @trans. It remains + * valid for as long as @trans is valid. + */ +const GstRTSPTransport * +gst_rtsp_stream_transport_get_transport (GstRTSPStreamTransport * trans) +{ + g_return_val_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans), NULL); + + return trans->priv->transport; +} + +/** + * gst_rtsp_stream_transport_set_url: + * @trans: a #GstRTSPStreamTransport + * @url: (transfer none): a client #GstRTSPUrl + * + * Set @url as the client url. + */ +void +gst_rtsp_stream_transport_set_url (GstRTSPStreamTransport * trans, + const GstRTSPUrl * url) +{ + GstRTSPStreamTransportPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans)); + + priv = trans->priv; + + /* keep track of the transports in the stream. */ + if (priv->url) + gst_rtsp_url_free (priv->url); + priv->url = (url ? gst_rtsp_url_copy (url) : NULL); +} + +/** + * gst_rtsp_stream_transport_get_url: + * @trans: a #GstRTSPStreamTransport + * + * Get the url configured in @trans. + * + * Returns: (transfer none): the url configured in @trans. It remains + * valid for as long as @trans is valid. + */ +const GstRTSPUrl * +gst_rtsp_stream_transport_get_url (GstRTSPStreamTransport * trans) +{ + g_return_val_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans), NULL); + + return trans->priv->url; +} + + /** + * gst_rtsp_stream_transport_get_rtpinfo: + * @trans: a #GstRTSPStreamTransport + * @start_time: a star time + * + * Get the RTP-Info string for @trans and @start_time. + * + * Returns: (transfer full) (nullable): the RTPInfo string for @trans + * and @start_time or %NULL when the RTP-Info could not be + * determined. g_free() after usage. + */ +gchar * +gst_rtsp_stream_transport_get_rtpinfo (GstRTSPStreamTransport * trans, + GstClockTime start_time) +{ + GstRTSPStreamTransportPrivate *priv; + gchar *url_str; + GString *rtpinfo; + guint rtptime, seq, clock_rate; + GstClockTime running_time = GST_CLOCK_TIME_NONE; + + g_return_val_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans), NULL); + + priv = trans->priv; + + if (!gst_rtsp_stream_get_rtpinfo (priv->stream, &rtptime, &seq, &clock_rate, + &running_time)) + return NULL; + + GST_DEBUG ("RTP time %u, seq %u, rate %u, running-time %" GST_TIME_FORMAT, + rtptime, seq, clock_rate, GST_TIME_ARGS (running_time)); + + if (GST_CLOCK_TIME_IS_VALID (running_time) + && GST_CLOCK_TIME_IS_VALID (start_time)) { + if (running_time > start_time) { + rtptime -= + gst_util_uint64_scale_int (running_time - start_time, clock_rate, + GST_SECOND); + } else { + rtptime += + gst_util_uint64_scale_int (start_time - running_time, clock_rate, + GST_SECOND); + } + } + GST_DEBUG ("RTP time %u, for start-time %" GST_TIME_FORMAT, + rtptime, GST_TIME_ARGS (start_time)); + + rtpinfo = g_string_new (""); + + url_str = gst_rtsp_url_get_request_uri (trans->priv->url); + g_string_append_printf (rtpinfo, "url=%s;seq=%u;rtptime=%u", + url_str, seq, rtptime); + g_free (url_str); + + return g_string_free (rtpinfo, FALSE); +} + +/** + * gst_rtsp_stream_transport_set_active: + * @trans: a #GstRTSPStreamTransport + * @active: new state of @trans + * + * Activate or deactivate datatransfer configured in @trans. + * + * Returns: %TRUE when the state was changed. + */ +gboolean +gst_rtsp_stream_transport_set_active (GstRTSPStreamTransport * trans, + gboolean active) +{ + GstRTSPStreamTransportPrivate *priv; + gboolean res; + + g_return_val_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans), FALSE); + + priv = trans->priv; + + if (priv->active == active) + return FALSE; + + if (active) + res = gst_rtsp_stream_add_transport (priv->stream, trans); + else + res = gst_rtsp_stream_remove_transport (priv->stream, trans); + + if (res) + priv->active = active; + + return res; +} + +/** + * gst_rtsp_stream_transport_set_timed_out: + * @trans: a #GstRTSPStreamTransport + * @timedout: timed out value + * + * Set the timed out state of @trans to @timedout + */ +void +gst_rtsp_stream_transport_set_timed_out (GstRTSPStreamTransport * trans, + gboolean timedout) +{ + g_return_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans)); + + trans->priv->timed_out = timedout; +} + +/** + * gst_rtsp_stream_transport_is_timed_out: + * @trans: a #GstRTSPStreamTransport + * + * Check if @trans is timed out. + * + * Returns: %TRUE if @trans timed out. + */ +gboolean +gst_rtsp_stream_transport_is_timed_out (GstRTSPStreamTransport * trans) +{ + g_return_val_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans), FALSE); + + return trans->priv->timed_out; +} + +/** + * gst_rtsp_stream_transport_send_rtp: + * @trans: a #GstRTSPStreamTransport + * @buffer: (transfer none): a #GstBuffer + * + * Send @buffer to the installed RTP callback for @trans. + * + * Returns: %TRUE on success + */ +gboolean +gst_rtsp_stream_transport_send_rtp (GstRTSPStreamTransport * trans, + GstBuffer * buffer) +{ + GstRTSPStreamTransportPrivate *priv; + gboolean res = FALSE; + + priv = trans->priv; + + if (priv->send_rtp) + res = + priv->send_rtp (buffer, priv->transport->interleaved.min, + priv->user_data); + + return res; +} + +/** + * gst_rtsp_stream_transport_send_rtcp: + * @trans: a #GstRTSPStreamTransport + * @buffer: (transfer none): a #GstBuffer + * + * Send @buffer to the installed RTCP callback for @trans. + * + * Returns: %TRUE on success + */ +gboolean +gst_rtsp_stream_transport_send_rtcp (GstRTSPStreamTransport * trans, + GstBuffer * buffer) +{ + GstRTSPStreamTransportPrivate *priv; + gboolean res = FALSE; + + priv = trans->priv; + + if (priv->send_rtcp) + res = + priv->send_rtcp (buffer, priv->transport->interleaved.max, + priv->user_data); + + return res; +} + +/** + * gst_rtsp_stream_transport_keep_alive: + * @trans: a #GstRTSPStreamTransport + * + * Signal the installed keep_alive callback for @trans. + */ +void +gst_rtsp_stream_transport_keep_alive (GstRTSPStreamTransport * trans) +{ + GstRTSPStreamTransportPrivate *priv; + + priv = trans->priv; + + if (priv->keep_alive) + priv->keep_alive (priv->ka_user_data); +} diff --git a/gst/rtsp-server/rtsp-stream-transport.h b/gst/rtsp-server/rtsp-stream-transport.h new file mode 100644 index 0000000..7735ee7 --- /dev/null +++ b/gst/rtsp-server/rtsp-stream-transport.h @@ -0,0 +1,133 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include +#include + +#ifndef __GST_RTSP_STREAM_TRANSPORT_H__ +#define __GST_RTSP_STREAM_TRANSPORT_H__ + +G_BEGIN_DECLS + +/* types for the media */ +#define GST_TYPE_RTSP_STREAM_TRANSPORT (gst_rtsp_stream_transport_get_type ()) +#define GST_IS_RTSP_STREAM_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_STREAM_TRANSPORT)) +#define GST_IS_RTSP_STREAM_TRANSPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_STREAM_TRANSPORT)) +#define GST_RTSP_STREAM_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_STREAM_TRANSPORT, GstRTSPStreamTransportClass)) +#define GST_RTSP_STREAM_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_STREAM_TRANSPORT, GstRTSPStreamTransport)) +#define GST_RTSP_STREAM_TRANSPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_STREAM_TRANSPORT, GstRTSPStreamTransportClass)) +#define GST_RTSP_STREAM_TRANSPORT_CAST(obj) ((GstRTSPStreamTransport*)(obj)) +#define GST_RTSP_STREAM_TRANSPORT_CLASS_CAST(klass) ((GstRTSPStreamTransportClass*)(klass)) + +typedef struct _GstRTSPStreamTransport GstRTSPStreamTransport; +typedef struct _GstRTSPStreamTransportClass GstRTSPStreamTransportClass; +typedef struct _GstRTSPStreamTransportPrivate GstRTSPStreamTransportPrivate; + +#include "rtsp-stream.h" + +/** + * GstRTSPSendFunc: + * @buffer: a #GstBuffer + * @channel: a channel + * @user_data: user data + * + * Function registered with gst_rtsp_stream_transport_set_callbacks() and + * called when @buffer must be sent on @channel. + * + * Returns: %TRUE on success + */ +typedef gboolean (*GstRTSPSendFunc) (GstBuffer *buffer, guint8 channel, gpointer user_data); +/** + * GstRTSPKeepAliveFunc: + * @user_data: user data + * + * Function registered with gst_rtsp_stream_transport_set_keepalive() and called + * when the stream is active. + */ +typedef void (*GstRTSPKeepAliveFunc) (gpointer user_data); + +/** + * GstRTSPStreamTransport: + * @parent: parent instance + * + * A Transport description for a stream + */ +struct _GstRTSPStreamTransport { + GObject parent; + + /*< private >*/ + GstRTSPStreamTransportPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +struct _GstRTSPStreamTransportClass { + GObjectClass parent_class; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +GType gst_rtsp_stream_transport_get_type (void); + +GstRTSPStreamTransport * gst_rtsp_stream_transport_new (GstRTSPStream *stream, + GstRTSPTransport *tr); + +GstRTSPStream * gst_rtsp_stream_transport_get_stream (GstRTSPStreamTransport *trans); + +void gst_rtsp_stream_transport_set_transport (GstRTSPStreamTransport *trans, + GstRTSPTransport * tr); +const GstRTSPTransport * gst_rtsp_stream_transport_get_transport (GstRTSPStreamTransport *trans); + +void gst_rtsp_stream_transport_set_url (GstRTSPStreamTransport *trans, + const GstRTSPUrl * url); +const GstRTSPUrl * gst_rtsp_stream_transport_get_url (GstRTSPStreamTransport *trans); + + +gchar * gst_rtsp_stream_transport_get_rtpinfo (GstRTSPStreamTransport *trans, + GstClockTime start_time); + +void gst_rtsp_stream_transport_set_callbacks (GstRTSPStreamTransport *trans, + GstRTSPSendFunc send_rtp, + GstRTSPSendFunc send_rtcp, + gpointer user_data, + GDestroyNotify notify); +void gst_rtsp_stream_transport_set_keepalive (GstRTSPStreamTransport *trans, + GstRTSPKeepAliveFunc keep_alive, + gpointer user_data, + GDestroyNotify notify); +void gst_rtsp_stream_transport_keep_alive (GstRTSPStreamTransport *trans); + +gboolean gst_rtsp_stream_transport_set_active (GstRTSPStreamTransport *trans, + gboolean active); + +void gst_rtsp_stream_transport_set_timed_out (GstRTSPStreamTransport *trans, + gboolean timedout); +gboolean gst_rtsp_stream_transport_is_timed_out (GstRTSPStreamTransport *trans); + + + +gboolean gst_rtsp_stream_transport_send_rtp (GstRTSPStreamTransport *trans, + GstBuffer *buffer); +gboolean gst_rtsp_stream_transport_send_rtcp (GstRTSPStreamTransport *trans, + GstBuffer *buffer); + +G_END_DECLS + +#endif /* __GST_RTSP_STREAM_TRANSPORT_H__ */ diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c new file mode 100644 index 0000000..b618f7c --- /dev/null +++ b/gst/rtsp-server/rtsp-stream.c @@ -0,0 +1,2730 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-stream + * @short_description: A media stream + * @see_also: #GstRTSPMedia + * + * The #GstRTSPStream object manages the data transport for one stream. It + * is created from a payloader element and a source pad that produce the RTP + * packets for the stream. + * + * With gst_rtsp_stream_join_bin() the streaming elements are added to the bin + * and rtpbin. gst_rtsp_stream_leave_bin() removes the elements again. + * + * The #GstRTSPStream will use the configured addresspool, as set with + * gst_rtsp_stream_set_address_pool(), to allocate multicast addresses for the + * stream. With gst_rtsp_stream_get_multicast_address() you can get the + * configured address. + * + * With gst_rtsp_stream_get_server_port () you can get the port that the server + * will use to receive RTCP. This is the part that the clients will use to send + * RTCP to. + * + * With gst_rtsp_stream_add_transport() destinations can be added where the + * stream should be sent to. Use gst_rtsp_stream_remove_transport() to remove + * the destination again. + * + * Last reviewed on 2013-07-16 (1.0.0) + */ + +#include +#include +#include + +#include + +#include +#include + +#include "rtsp-stream.h" + +#define GST_RTSP_STREAM_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_STREAM, GstRTSPStreamPrivate)) + +struct _GstRTSPStreamPrivate +{ + GMutex lock; + guint idx; + GstPad *srcpad; + GstElement *payloader; + guint buffer_size; + gboolean is_joined; + gchar *control; + + GstRTSPProfile profiles; + GstRTSPLowerTrans protocols; + + /* pads on the rtpbin */ + GstPad *send_rtp_sink; + GstPad *recv_sink[2]; + GstPad *send_src[2]; + + /* the RTPSession object */ + GObject *session; + + /* SRTP encoder/decoder */ + GstElement *srtpenc; + GstElement *srtpdec; + GHashTable *keys; + + /* sinks used for sending and receiving RTP and RTCP over ipv4, they share + * sockets */ + GstElement *udpsrc_v4[2]; + + /* sinks used for sending and receiving RTP and RTCP over ipv6, they share + * sockets */ + GstElement *udpsrc_v6[2]; + + GstElement *udpsink[2]; + + /* for TCP transport */ + GstElement *appsrc[2]; + GstElement *appqueue[2]; + GstElement *appsink[2]; + + GstElement *tee[2]; + GstElement *funnel[2]; + + /* server ports for sending/receiving over ipv4 */ + GstRTSPRange server_port_v4; + GstRTSPAddress *server_addr_v4; + gboolean have_ipv4; + + /* server ports for sending/receiving over ipv6 */ + GstRTSPRange server_port_v6; + GstRTSPAddress *server_addr_v6; + gboolean have_ipv6; + + /* multicast addresses */ + GstRTSPAddressPool *pool; + GstRTSPAddress *addr_v4; + GstRTSPAddress *addr_v6; + + /* the caps of the stream */ + gulong caps_sig; + GstCaps *caps; + + /* transports we stream to */ + guint n_active; + GList *transports; + guint transports_cookie; + GList *tr_cache; + guint tr_cache_cookie; + + gint dscp_qos; + + /* stream blocking */ + gulong blocked_id; + gboolean blocking; +}; + +#define DEFAULT_CONTROL NULL +#define DEFAULT_PROFILES GST_RTSP_PROFILE_AVP +#define DEFAULT_PROTOCOLS GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_UDP_MCAST | \ + GST_RTSP_LOWER_TRANS_TCP + +enum +{ + PROP_0, + PROP_CONTROL, + PROP_PROFILES, + PROP_PROTOCOLS, + PROP_LAST +}; + +enum +{ + SIGNAL_NEW_RTP_ENCODER, + SIGNAL_NEW_RTCP_ENCODER, + SIGNAL_LAST +}; + +GST_DEBUG_CATEGORY_STATIC (rtsp_stream_debug); +#define GST_CAT_DEFAULT rtsp_stream_debug + +static GQuark ssrc_stream_map_key; + +static void gst_rtsp_stream_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec); +static void gst_rtsp_stream_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec); + +static void gst_rtsp_stream_finalize (GObject * obj); + +static guint gst_rtsp_stream_signals[SIGNAL_LAST] = { 0 }; + +G_DEFINE_TYPE (GstRTSPStream, gst_rtsp_stream, G_TYPE_OBJECT); + +static void +gst_rtsp_stream_class_init (GstRTSPStreamClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPStreamPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->get_property = gst_rtsp_stream_get_property; + gobject_class->set_property = gst_rtsp_stream_set_property; + gobject_class->finalize = gst_rtsp_stream_finalize; + + g_object_class_install_property (gobject_class, PROP_CONTROL, + g_param_spec_string ("control", "Control", + "The control string for this stream", DEFAULT_CONTROL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_PROFILES, + g_param_spec_flags ("profiles", "Profiles", + "Allowed transfer profiles", GST_TYPE_RTSP_PROFILE, + DEFAULT_PROFILES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_PROTOCOLS, + g_param_spec_flags ("protocols", "Protocols", + "Allowed lower transport protocols", GST_TYPE_RTSP_LOWER_TRANS, + DEFAULT_PROTOCOLS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_rtsp_stream_signals[SIGNAL_NEW_RTP_ENCODER] = + g_signal_new ("new-rtp-encoder", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, + G_TYPE_NONE, 1, GST_TYPE_ELEMENT); + + gst_rtsp_stream_signals[SIGNAL_NEW_RTCP_ENCODER] = + g_signal_new ("new-rtcp-encoder", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, + G_TYPE_NONE, 1, GST_TYPE_ELEMENT); + + GST_DEBUG_CATEGORY_INIT (rtsp_stream_debug, "rtspstream", 0, "GstRTSPStream"); + + ssrc_stream_map_key = g_quark_from_static_string ("GstRTSPServer.stream"); +} + +static void +gst_rtsp_stream_init (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream); + + GST_DEBUG ("new stream %p", stream); + + stream->priv = priv; + + priv->dscp_qos = -1; + priv->control = g_strdup (DEFAULT_CONTROL); + priv->profiles = DEFAULT_PROFILES; + priv->protocols = DEFAULT_PROTOCOLS; + + g_mutex_init (&priv->lock); + + priv->keys = g_hash_table_new_full (g_direct_hash, g_direct_equal, + NULL, (GDestroyNotify) gst_caps_unref); +} + +static void +gst_rtsp_stream_finalize (GObject * obj) +{ + GstRTSPStream *stream; + GstRTSPStreamPrivate *priv; + + stream = GST_RTSP_STREAM (obj); + priv = stream->priv; + + GST_DEBUG ("finalize stream %p", stream); + + /* we really need to be unjoined now */ + g_return_if_fail (!priv->is_joined); + + if (priv->addr_v4) + gst_rtsp_address_free (priv->addr_v4); + if (priv->addr_v6) + gst_rtsp_address_free (priv->addr_v6); + if (priv->server_addr_v4) + gst_rtsp_address_free (priv->server_addr_v4); + if (priv->server_addr_v6) + gst_rtsp_address_free (priv->server_addr_v6); + if (priv->pool) + g_object_unref (priv->pool); + gst_object_unref (priv->payloader); + gst_object_unref (priv->srcpad); + g_free (priv->control); + g_mutex_clear (&priv->lock); + + g_hash_table_unref (priv->keys); + + G_OBJECT_CLASS (gst_rtsp_stream_parent_class)->finalize (obj); +} + +static void +gst_rtsp_stream_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + GstRTSPStream *stream = GST_RTSP_STREAM (object); + + switch (propid) { + case PROP_CONTROL: + g_value_take_string (value, gst_rtsp_stream_get_control (stream)); + break; + case PROP_PROFILES: + g_value_set_flags (value, gst_rtsp_stream_get_profiles (stream)); + break; + case PROP_PROTOCOLS: + g_value_set_flags (value, gst_rtsp_stream_get_protocols (stream)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_stream_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + GstRTSPStream *stream = GST_RTSP_STREAM (object); + + switch (propid) { + case PROP_CONTROL: + gst_rtsp_stream_set_control (stream, g_value_get_string (value)); + break; + case PROP_PROFILES: + gst_rtsp_stream_set_profiles (stream, g_value_get_flags (value)); + break; + case PROP_PROTOCOLS: + gst_rtsp_stream_set_protocols (stream, g_value_get_flags (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +/** + * gst_rtsp_stream_new: + * @idx: an index + * @srcpad: a #GstPad + * @payloader: a #GstElement + * + * Create a new media stream with index @idx that handles RTP data on + * @srcpad and has a payloader element @payloader. + * + * Returns: (transfer full): a new #GstRTSPStream + */ +GstRTSPStream * +gst_rtsp_stream_new (guint idx, GstElement * payloader, GstPad * srcpad) +{ + GstRTSPStreamPrivate *priv; + GstRTSPStream *stream; + + g_return_val_if_fail (GST_IS_ELEMENT (payloader), NULL); + g_return_val_if_fail (GST_IS_PAD (srcpad), NULL); + g_return_val_if_fail (GST_PAD_IS_SRC (srcpad), NULL); + + stream = g_object_new (GST_TYPE_RTSP_STREAM, NULL); + priv = stream->priv; + priv->idx = idx; + priv->payloader = gst_object_ref (payloader); + priv->srcpad = gst_object_ref (srcpad); + + return stream; +} + +/** + * gst_rtsp_stream_get_index: + * @stream: a #GstRTSPStream + * + * Get the stream index. + * + * Return: the stream index. + */ +guint +gst_rtsp_stream_get_index (GstRTSPStream * stream) +{ + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), -1); + + return stream->priv->idx; +} + +/** + * gst_rtsp_stream_get_pt: + * @stream: a #GstRTSPStream + * + * Get the stream payload type. + * + * Return: the stream payload type. + */ +guint +gst_rtsp_stream_get_pt (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv; + guint pt; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), -1); + + priv = stream->priv; + + g_object_get (G_OBJECT (priv->payloader), "pt", &pt, NULL); + + return pt; +} + +/** + * gst_rtsp_stream_get_srcpad: + * @stream: a #GstRTSPStream + * + * Get the srcpad associated with @stream. + * + * Returns: (transfer full): the srcpad. Unref after usage. + */ +GstPad * +gst_rtsp_stream_get_srcpad (GstRTSPStream * stream) +{ + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + + return gst_object_ref (stream->priv->srcpad); +} + +/** + * gst_rtsp_stream_get_control: + * @stream: a #GstRTSPStream + * + * Get the control string to identify this stream. + * + * Returns: (transfer full): the control string. g_free() after usage. + */ +gchar * +gst_rtsp_stream_get_control (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv; + gchar *result; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + if ((result = g_strdup (priv->control)) == NULL) + result = g_strdup_printf ("stream=%u", priv->idx); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_stream_set_control: + * @stream: a #GstRTSPStream + * @control: a control string + * + * Set the control string in @stream. + */ +void +gst_rtsp_stream_set_control (GstRTSPStream * stream, const gchar * control) +{ + GstRTSPStreamPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM (stream)); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + g_free (priv->control); + priv->control = g_strdup (control); + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_stream_has_control: + * @stream: a #GstRTSPStream + * @control: a control string + * + * Check if @stream has the control string @control. + * + * Returns: %TRUE is @stream has @control as the control string + */ +gboolean +gst_rtsp_stream_has_control (GstRTSPStream * stream, const gchar * control) +{ + GstRTSPStreamPrivate *priv; + gboolean res; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + if (priv->control) + res = (g_strcmp0 (priv->control, control) == 0); + else { + guint streamid; + + if (sscanf (control, "stream=%u", &streamid) > 0) + res = (streamid == priv->idx); + else + res = FALSE; + } + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_stream_set_mtu: + * @stream: a #GstRTSPStream + * @mtu: a new MTU + * + * Configure the mtu in the payloader of @stream to @mtu. + */ +void +gst_rtsp_stream_set_mtu (GstRTSPStream * stream, guint mtu) +{ + GstRTSPStreamPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM (stream)); + + priv = stream->priv; + + GST_LOG_OBJECT (stream, "set MTU %u", mtu); + + g_object_set (G_OBJECT (priv->payloader), "mtu", mtu, NULL); +} + +/** + * gst_rtsp_stream_get_mtu: + * @stream: a #GstRTSPStream + * + * Get the configured MTU in the payloader of @stream. + * + * Returns: the MTU of the payloader. + */ +guint +gst_rtsp_stream_get_mtu (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv; + guint mtu; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), 0); + + priv = stream->priv; + + g_object_get (G_OBJECT (priv->payloader), "mtu", &mtu, NULL); + + return mtu; +} + +/* Update the dscp qos property on the udp sinks */ +static void +update_dscp_qos (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM (stream)); + + priv = stream->priv; + + if (priv->udpsink[0]) { + g_object_set (G_OBJECT (priv->udpsink[0]), "qos-dscp", priv->dscp_qos, + NULL); + } + + if (priv->udpsink[1]) { + g_object_set (G_OBJECT (priv->udpsink[1]), "qos-dscp", priv->dscp_qos, + NULL); + } +} + +/** + * gst_rtsp_stream_set_dscp_qos: + * @stream: a #GstRTSPStream + * @dscp_qos: a new dscp qos value (0-63, or -1 to disable) + * + * Configure the dscp qos of the outgoing sockets to @dscp_qos. + */ +void +gst_rtsp_stream_set_dscp_qos (GstRTSPStream * stream, gint dscp_qos) +{ + GstRTSPStreamPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM (stream)); + + priv = stream->priv; + + GST_LOG_OBJECT (stream, "set DSCP QoS %d", dscp_qos); + + if (dscp_qos < -1 || dscp_qos > 63) { + GST_WARNING_OBJECT (stream, "trying to set illegal dscp qos %d", dscp_qos); + return; + } + + priv->dscp_qos = dscp_qos; + + update_dscp_qos (stream); +} + +/** + * gst_rtsp_stream_get_dscp_qos: + * @stream: a #GstRTSPStream + * + * Get the configured DSCP QoS in of the outgoing sockets. + * + * Returns: the DSCP QoS value of the outgoing sockets, or -1 if disbled. + */ +gint +gst_rtsp_stream_get_dscp_qos (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), -1); + + priv = stream->priv; + + return priv->dscp_qos; +} + +/** + * gst_rtsp_stream_is_transport_supported: + * @stream: a #GstRTSPStream + * @transport: (transfer none): a #GstRTSPTransport + * + * Check if @transport can be handled by stream + * + * Returns: %TRUE if @transport can be handled by @stream. + */ +gboolean +gst_rtsp_stream_is_transport_supported (GstRTSPStream * stream, + GstRTSPTransport * transport) +{ + GstRTSPStreamPrivate *priv; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + if (transport->trans != GST_RTSP_TRANS_RTP) + goto unsupported_transmode; + + if (!(transport->profile & priv->profiles)) + goto unsupported_profile; + + if (!(transport->lower_transport & priv->protocols)) + goto unsupported_ltrans; + + g_mutex_unlock (&priv->lock); + + return TRUE; + + /* ERRORS */ +unsupported_transmode: + { + GST_DEBUG ("unsupported transport mode %d", transport->trans); + g_mutex_unlock (&priv->lock); + return FALSE; + } +unsupported_profile: + { + GST_DEBUG ("unsupported profile %d", transport->profile); + g_mutex_unlock (&priv->lock); + return FALSE; + } +unsupported_ltrans: + { + GST_DEBUG ("unsupported lower transport %d", transport->lower_transport); + g_mutex_unlock (&priv->lock); + return FALSE; + } +} + +/** + * gst_rtsp_stream_set_profiles: + * @stream: a #GstRTSPStream + * @profiles: the new profiles + * + * Configure the allowed profiles for @stream. + */ +void +gst_rtsp_stream_set_profiles (GstRTSPStream * stream, GstRTSPProfile profiles) +{ + GstRTSPStreamPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM (stream)); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + priv->profiles = profiles; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_stream_get_profiles: + * @stream: a #GstRTSPStream + * + * Get the allowed profiles of @stream. + * + * Returns: a #GstRTSPProfile + */ +GstRTSPProfile +gst_rtsp_stream_get_profiles (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv; + GstRTSPProfile res; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), GST_RTSP_PROFILE_UNKNOWN); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + res = priv->profiles; + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_stream_set_protocols: + * @stream: a #GstRTSPStream + * @protocols: the new flags + * + * Configure the allowed lower transport for @stream. + */ +void +gst_rtsp_stream_set_protocols (GstRTSPStream * stream, + GstRTSPLowerTrans protocols) +{ + GstRTSPStreamPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM (stream)); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + priv->protocols = protocols; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_stream_get_protocols: + * @stream: a #GstRTSPStream + * + * Get the allowed protocols of @stream. + * + * Returns: a #GstRTSPLowerTrans + */ +GstRTSPLowerTrans +gst_rtsp_stream_get_protocols (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv; + GstRTSPLowerTrans res; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), + GST_RTSP_LOWER_TRANS_UNKNOWN); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + res = priv->protocols; + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_stream_set_address_pool: + * @stream: a #GstRTSPStream + * @pool: (transfer none): a #GstRTSPAddressPool + * + * configure @pool to be used as the address pool of @stream. + */ +void +gst_rtsp_stream_set_address_pool (GstRTSPStream * stream, + GstRTSPAddressPool * pool) +{ + GstRTSPStreamPrivate *priv; + GstRTSPAddressPool *old; + + g_return_if_fail (GST_IS_RTSP_STREAM (stream)); + + priv = stream->priv; + + GST_LOG_OBJECT (stream, "set address pool %p", pool); + + g_mutex_lock (&priv->lock); + if ((old = priv->pool) != pool) + priv->pool = pool ? g_object_ref (pool) : NULL; + else + old = NULL; + g_mutex_unlock (&priv->lock); + + if (old) + g_object_unref (old); +} + +/** + * gst_rtsp_stream_get_address_pool: + * @stream: a #GstRTSPStream + * + * Get the #GstRTSPAddressPool used as the address pool of @stream. + * + * Returns: (transfer full): the #GstRTSPAddressPool of @stream. g_object_unref() after + * usage. + */ +GstRTSPAddressPool * +gst_rtsp_stream_get_address_pool (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv; + GstRTSPAddressPool *result; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + if ((result = priv->pool)) + g_object_ref (result); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_stream_get_multicast_address: + * @stream: a #GstRTSPStream + * @family: the #GSocketFamily + * + * Get the multicast address of @stream for @family. + * + * Returns: (transfer full) (nullable): the #GstRTSPAddress of @stream + * or %NULL when no address could be allocated. gst_rtsp_address_free() + * after usage. + */ +GstRTSPAddress * +gst_rtsp_stream_get_multicast_address (GstRTSPStream * stream, + GSocketFamily family) +{ + GstRTSPStreamPrivate *priv; + GstRTSPAddress *result; + GstRTSPAddress **addrp; + GstRTSPAddressFlags flags; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + + priv = stream->priv; + + if (family == G_SOCKET_FAMILY_IPV6) { + flags = GST_RTSP_ADDRESS_FLAG_IPV6; + addrp = &priv->addr_v6; + } else { + flags = GST_RTSP_ADDRESS_FLAG_IPV4; + addrp = &priv->addr_v4; + } + + g_mutex_lock (&priv->lock); + if (*addrp == NULL) { + if (priv->pool == NULL) + goto no_pool; + + flags |= GST_RTSP_ADDRESS_FLAG_EVEN_PORT | GST_RTSP_ADDRESS_FLAG_MULTICAST; + + *addrp = gst_rtsp_address_pool_acquire_address (priv->pool, flags, 2); + if (*addrp == NULL) + goto no_address; + } + result = gst_rtsp_address_copy (*addrp); + g_mutex_unlock (&priv->lock); + + return result; + + /* ERRORS */ +no_pool: + { + GST_ERROR_OBJECT (stream, "no address pool specified"); + g_mutex_unlock (&priv->lock); + return NULL; + } +no_address: + { + GST_ERROR_OBJECT (stream, "failed to acquire address from pool"); + g_mutex_unlock (&priv->lock); + return NULL; + } +} + +/** + * gst_rtsp_stream_reserve_address: + * @stream: a #GstRTSPStream + * @address: an address + * @port: a port + * @n_ports: n_ports + * @ttl: a TTL + * + * Reserve @address and @port as the address and port of @stream. + * + * Returns: (nullable): the #GstRTSPAddress of @stream or %NULL when + * the address could be reserved. gst_rtsp_address_free() after usage. + */ +GstRTSPAddress * +gst_rtsp_stream_reserve_address (GstRTSPStream * stream, + const gchar * address, guint port, guint n_ports, guint ttl) +{ + GstRTSPStreamPrivate *priv; + GstRTSPAddress *result; + GInetAddress *addr; + GSocketFamily family; + GstRTSPAddress **addrp; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + g_return_val_if_fail (address != NULL, NULL); + g_return_val_if_fail (port > 0, NULL); + g_return_val_if_fail (n_ports > 0, NULL); + g_return_val_if_fail (ttl > 0, NULL); + + priv = stream->priv; + + addr = g_inet_address_new_from_string (address); + if (!addr) { + GST_ERROR ("failed to get inet addr from %s", address); + family = G_SOCKET_FAMILY_IPV4; + } else { + family = g_inet_address_get_family (addr); + g_object_unref (addr); + } + + if (family == G_SOCKET_FAMILY_IPV6) + addrp = &priv->addr_v6; + else + addrp = &priv->addr_v4; + + g_mutex_lock (&priv->lock); + if (*addrp == NULL) { + GstRTSPAddressPoolResult res; + + if (priv->pool == NULL) + goto no_pool; + + res = gst_rtsp_address_pool_reserve_address (priv->pool, address, + port, n_ports, ttl, addrp); + if (res != GST_RTSP_ADDRESS_POOL_OK) + goto no_address; + } else { + if (strcmp ((*addrp)->address, address) || + (*addrp)->port != port || (*addrp)->n_ports != n_ports || + (*addrp)->ttl != ttl) + goto different_address; + } + result = gst_rtsp_address_copy (*addrp); + g_mutex_unlock (&priv->lock); + + return result; + + /* ERRORS */ +no_pool: + { + GST_ERROR_OBJECT (stream, "no address pool specified"); + g_mutex_unlock (&priv->lock); + return NULL; + } +no_address: + { + GST_ERROR_OBJECT (stream, "failed to acquire address %s from pool", + address); + g_mutex_unlock (&priv->lock); + return NULL; + } +different_address: + { + GST_ERROR_OBJECT (stream, "address %s is not the same that was already" + " reserved", address); + g_mutex_unlock (&priv->lock); + return NULL; + } +} + +static gboolean +alloc_ports_one_family (GstRTSPAddressPool * pool, gint buffer_size, + GSocketFamily family, GstElement * udpsrc_out[2], + GstElement * udpsink_out[2], GstRTSPRange * server_port_out, + GstRTSPAddress ** server_addr_out) +{ + GstStateChangeReturn ret; + GstElement *udpsrc0, *udpsrc1; + GstElement *udpsink0, *udpsink1; + GSocket *rtp_socket = NULL; + GSocket *rtcp_socket; + gint tmp_rtp, tmp_rtcp; + guint count; + gint rtpport, rtcpport; + GList *rejected_addresses = NULL; + GstRTSPAddress *addr = NULL; + GInetAddress *inetaddr = NULL; + GSocketAddress *rtp_sockaddr = NULL; + GSocketAddress *rtcp_sockaddr = NULL; + const gchar *multisink_socket; + + if (family == G_SOCKET_FAMILY_IPV6) + multisink_socket = "socket-v6"; + else + multisink_socket = "socket"; + + udpsrc0 = NULL; + udpsrc1 = NULL; + udpsink0 = NULL; + udpsink1 = NULL; + count = 0; + + /* Start with random port */ + tmp_rtp = 0; + + rtcp_socket = g_socket_new (family, G_SOCKET_TYPE_DATAGRAM, + G_SOCKET_PROTOCOL_UDP, NULL); + if (!rtcp_socket) + goto no_udp_protocol; + + if (*server_addr_out) + gst_rtsp_address_free (*server_addr_out); + + /* try to allocate 2 UDP ports, the RTP port should be an even + * number and the RTCP port should be the next (uneven) port */ +again: + + if (rtp_socket == NULL) { + rtp_socket = g_socket_new (family, G_SOCKET_TYPE_DATAGRAM, + G_SOCKET_PROTOCOL_UDP, NULL); + if (!rtp_socket) + goto no_udp_protocol; + } + + if (pool && gst_rtsp_address_pool_has_unicast_addresses (pool)) { + GstRTSPAddressFlags flags; + + if (addr) + rejected_addresses = g_list_prepend (rejected_addresses, addr); + + flags = GST_RTSP_ADDRESS_FLAG_EVEN_PORT | GST_RTSP_ADDRESS_FLAG_UNICAST; + if (family == G_SOCKET_FAMILY_IPV6) + flags |= GST_RTSP_ADDRESS_FLAG_IPV6; + else + flags |= GST_RTSP_ADDRESS_FLAG_IPV4; + + addr = gst_rtsp_address_pool_acquire_address (pool, flags, 2); + + if (addr == NULL) + goto no_ports; + + tmp_rtp = addr->port; + + g_clear_object (&inetaddr); + inetaddr = g_inet_address_new_from_string (addr->address); + } else { + if (tmp_rtp != 0) { + tmp_rtp += 2; + if (++count > 20) + goto no_ports; + } + + if (inetaddr == NULL) + inetaddr = g_inet_address_new_any (family); + } + + /* FIXME-WFD : Force to set 19000 as port number */ + tmp_rtp = 19000; + + rtp_sockaddr = g_inet_socket_address_new (inetaddr, tmp_rtp); + if (!g_socket_bind (rtp_socket, rtp_sockaddr, FALSE, NULL)) { + g_object_unref (rtp_sockaddr); + goto again; + } + g_object_unref (rtp_sockaddr); + + rtp_sockaddr = g_socket_get_local_address (rtp_socket, NULL); + if (rtp_sockaddr == NULL || !G_IS_INET_SOCKET_ADDRESS (rtp_sockaddr)) { + g_clear_object (&rtp_sockaddr); + goto socket_error; + } + + tmp_rtp = + g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (rtp_sockaddr)); + g_object_unref (rtp_sockaddr); + + /* check if port is even */ + if ((tmp_rtp & 1) != 0) { + /* port not even, close and allocate another */ + tmp_rtp++; + g_clear_object (&rtp_socket); + goto again; + } + + /* set port */ + tmp_rtcp = tmp_rtp + 1; + + rtcp_sockaddr = g_inet_socket_address_new (inetaddr, tmp_rtcp); + if (!g_socket_bind (rtcp_socket, rtcp_sockaddr, FALSE, NULL)) { + g_object_unref (rtcp_sockaddr); + g_clear_object (&rtp_socket); + goto again; + } + g_object_unref (rtcp_sockaddr); + + g_clear_object (&inetaddr); + + udpsrc0 = gst_element_factory_make ("udpsrc", NULL); + udpsrc1 = gst_element_factory_make ("udpsrc", NULL); + + if (udpsrc0 == NULL || udpsrc1 == NULL) + goto no_udp_protocol; + + g_object_set (G_OBJECT (udpsrc0), "socket", rtp_socket, NULL); + g_object_set (G_OBJECT (udpsrc1), "socket", rtcp_socket, NULL); + + ret = gst_element_set_state (udpsrc0, GST_STATE_READY); + if (ret == GST_STATE_CHANGE_FAILURE) + goto element_error; + ret = gst_element_set_state (udpsrc1, GST_STATE_READY); + if (ret == GST_STATE_CHANGE_FAILURE) + goto element_error; + + /* all fine, do port check */ + g_object_get (G_OBJECT (udpsrc0), "port", &rtpport, NULL); + g_object_get (G_OBJECT (udpsrc1), "port", &rtcpport, NULL); + + /* this should not happen... */ + if (rtpport != tmp_rtp || rtcpport != tmp_rtcp) + goto port_error; + + if (udpsink_out[0]) + udpsink0 = udpsink_out[0]; + else + udpsink0 = gst_element_factory_make ("multiudpsink", NULL); + + if (!udpsink0) + goto no_udp_protocol; + + g_object_set (G_OBJECT (udpsink0), "close-socket", FALSE, NULL); + g_object_set (G_OBJECT (udpsink0), multisink_socket, rtp_socket, NULL); + + if (udpsink_out[1]) + udpsink1 = udpsink_out[1]; + else + udpsink1 = gst_element_factory_make ("multiudpsink", NULL); + + if (!udpsink1) + goto no_udp_protocol; + + g_object_set (G_OBJECT (udpsink0), "send-duplicates", FALSE, NULL); + g_object_set (G_OBJECT (udpsink1), "send-duplicates", FALSE, NULL); + g_object_set (G_OBJECT (udpsink0), "buffer-size", buffer_size, NULL); + + g_object_set (G_OBJECT (udpsink1), "close-socket", FALSE, NULL); + g_object_set (G_OBJECT (udpsink1), multisink_socket, rtcp_socket, NULL); + g_object_set (G_OBJECT (udpsink1), "sync", FALSE, NULL); + g_object_set (G_OBJECT (udpsink1), "async", FALSE, NULL); + g_object_set (G_OBJECT (udpsink0), "auto-multicast", FALSE, NULL); + g_object_set (G_OBJECT (udpsink0), "loop", FALSE, NULL); + g_object_set (G_OBJECT (udpsink1), "auto-multicast", FALSE, NULL); + g_object_set (G_OBJECT (udpsink1), "loop", FALSE, NULL); + + /* we keep these elements, we will further configure them when the + * client told us to really use the UDP ports. */ + udpsrc_out[0] = udpsrc0; + udpsrc_out[1] = udpsrc1; + udpsink_out[0] = udpsink0; + udpsink_out[1] = udpsink1; + server_port_out->min = rtpport; + server_port_out->max = rtcpport; + + *server_addr_out = addr; + g_list_free_full (rejected_addresses, (GDestroyNotify) gst_rtsp_address_free); + + g_object_unref (rtp_socket); + g_object_unref (rtcp_socket); + + return TRUE; + + /* ERRORS */ +no_udp_protocol: + { + goto cleanup; + } +no_ports: + { + goto cleanup; + } +port_error: + { + goto cleanup; + } +socket_error: + { + goto cleanup; + } +element_error: + { + goto cleanup; + } +cleanup: + { + if (udpsrc0) { + gst_element_set_state (udpsrc0, GST_STATE_NULL); + gst_object_unref (udpsrc0); + } + if (udpsrc1) { + gst_element_set_state (udpsrc1, GST_STATE_NULL); + gst_object_unref (udpsrc1); + } + if (udpsink0) { + gst_element_set_state (udpsink0, GST_STATE_NULL); + gst_object_unref (udpsink0); + } + if (inetaddr) + g_object_unref (inetaddr); + g_list_free_full (rejected_addresses, + (GDestroyNotify) gst_rtsp_address_free); + if (addr) + gst_rtsp_address_free (addr); + if (rtp_socket) + g_object_unref (rtp_socket); + if (rtcp_socket) + g_object_unref (rtcp_socket); + return FALSE; + } +} + +/* must be called with lock */ +static gboolean +alloc_ports (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv = stream->priv; + + priv->have_ipv4 = alloc_ports_one_family (priv->pool, priv->buffer_size, + G_SOCKET_FAMILY_IPV4, priv->udpsrc_v4, priv->udpsink, + &priv->server_port_v4, &priv->server_addr_v4); + + /* FIXME-WFD : force to disable ipv6 mode in WFD mode */ +#if 0 + priv->have_ipv6 = alloc_ports_one_family (priv->pool, priv->buffer_size, + G_SOCKET_FAMILY_IPV6, priv->udpsrc_v6, priv->udpsink, + &priv->server_port_v6, &priv->server_addr_v6); +#else + priv->have_ipv6 = FALSE; +#endif + + return priv->have_ipv4 || priv->have_ipv6; +} + +/** + * gst_rtsp_stream_get_server_port: + * @stream: a #GstRTSPStream + * @server_port: (out): result server port + * @family: the port family to get + * + * Fill @server_port with the port pair used by the server. This function can + * only be called when @stream has been joined. + */ +void +gst_rtsp_stream_get_server_port (GstRTSPStream * stream, + GstRTSPRange * server_port, GSocketFamily family) +{ + GstRTSPStreamPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM (stream)); + priv = stream->priv; + g_return_if_fail (priv->is_joined); + + g_mutex_lock (&priv->lock); + if (family == G_SOCKET_FAMILY_IPV4) { + if (server_port) + *server_port = priv->server_port_v4; + } else { + if (server_port) + *server_port = priv->server_port_v6; + } + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_stream_get_rtpsession: + * @stream: a #GstRTSPStream + * + * Get the RTP session of this stream. + * + * Returns: (transfer full): The RTP session of this stream. Unref after usage. + */ +GObject * +gst_rtsp_stream_get_rtpsession (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv; + GObject *session; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + if ((session = priv->session)) + g_object_ref (session); + g_mutex_unlock (&priv->lock); + + return session; +} + +/** + * gst_rtsp_stream_get_ssrc: + * @stream: a #GstRTSPStream + * @ssrc: (out): result ssrc + * + * Get the SSRC used by the RTP session of this stream. This function can only + * be called when @stream has been joined. + */ +void +gst_rtsp_stream_get_ssrc (GstRTSPStream * stream, guint * ssrc) +{ + GstRTSPStreamPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_STREAM (stream)); + priv = stream->priv; + g_return_if_fail (priv->is_joined); + + g_mutex_lock (&priv->lock); + if (ssrc && priv->session) + g_object_get (priv->session, "internal-ssrc", ssrc, NULL); + g_mutex_unlock (&priv->lock); +} + +/* executed from streaming thread */ +static void +caps_notify (GstPad * pad, GParamSpec * unused, GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv = stream->priv; + GstCaps *newcaps, *oldcaps; + + newcaps = gst_pad_get_current_caps (pad); + + GST_INFO ("stream %p received caps %p, %" GST_PTR_FORMAT, stream, newcaps, + newcaps); + + g_mutex_lock (&priv->lock); + oldcaps = priv->caps; + priv->caps = newcaps; + g_mutex_unlock (&priv->lock); + + if (oldcaps) + gst_caps_unref (oldcaps); +} + +static void +dump_structure (const GstStructure * s) +{ + gchar *sstr; + + sstr = gst_structure_to_string (s); + GST_INFO ("structure: %s", sstr); + g_free (sstr); +} + +static GstRTSPStreamTransport * +find_transport (GstRTSPStream * stream, const gchar * rtcp_from) +{ + GstRTSPStreamPrivate *priv = stream->priv; + GList *walk; + GstRTSPStreamTransport *result = NULL; + const gchar *tmp; + gchar *dest; + guint port; + + if (rtcp_from == NULL) + return NULL; + + tmp = g_strrstr (rtcp_from, ":"); + if (tmp == NULL) + return NULL; + + port = atoi (tmp + 1); + dest = g_strndup (rtcp_from, tmp - rtcp_from); + + g_mutex_lock (&priv->lock); + GST_INFO ("finding %s:%d in %d transports", dest, port, + g_list_length (priv->transports)); + + for (walk = priv->transports; walk; walk = g_list_next (walk)) { + GstRTSPStreamTransport *trans = walk->data; + const GstRTSPTransport *tr; + gint min, max; + + tr = gst_rtsp_stream_transport_get_transport (trans); + + min = tr->client_port.min; + max = tr->client_port.max; + + if ((strcmp (tr->destination, dest) == 0) && (min == port || max == port)) { + result = trans; + break; + } + } + if (result) + g_object_ref (result); + g_mutex_unlock (&priv->lock); + + g_free (dest); + + return result; +} + +static GstRTSPStreamTransport * +check_transport (GObject * source, GstRTSPStream * stream) +{ + GstStructure *stats; + GstRTSPStreamTransport *trans; + + /* see if we have a stream to match with the origin of the RTCP packet */ + trans = g_object_get_qdata (source, ssrc_stream_map_key); + if (trans == NULL) { + g_object_get (source, "stats", &stats, NULL); + if (stats) { + const gchar *rtcp_from; + + dump_structure (stats); + + rtcp_from = gst_structure_get_string (stats, "rtcp-from"); + if ((trans = find_transport (stream, rtcp_from))) { + GST_INFO ("%p: found transport %p for source %p", stream, trans, + source); + g_object_set_qdata_full (source, ssrc_stream_map_key, trans, + g_object_unref); + } + gst_structure_free (stats); + } + } + return trans; +} + + +static void +on_new_ssrc (GObject * session, GObject * source, GstRTSPStream * stream) +{ + GstRTSPStreamTransport *trans; + + GST_INFO ("%p: new source %p", stream, source); + + trans = check_transport (source, stream); + + if (trans) + GST_INFO ("%p: source %p for transport %p", stream, source, trans); +} + +static void +on_ssrc_sdes (GObject * session, GObject * source, GstRTSPStream * stream) +{ + GST_INFO ("%p: new SDES %p", stream, source); +} + +static void +on_ssrc_active (GObject * session, GObject * source, GstRTSPStream * stream) +{ + GstRTSPStreamTransport *trans; + + trans = check_transport (source, stream); + + if (trans) { + GST_INFO ("%p: source %p in transport %p is active", stream, source, trans); + gst_rtsp_stream_transport_keep_alive (trans); + } +#ifdef DUMP_STATS + { + GstStructure *stats; + g_object_get (source, "stats", &stats, NULL); + if (stats) { + dump_structure (stats); + gst_structure_free (stats); + } + } +#endif +} + +static void +on_bye_ssrc (GObject * session, GObject * source, GstRTSPStream * stream) +{ + GST_INFO ("%p: source %p bye", stream, source); +} + +static void +on_bye_timeout (GObject * session, GObject * source, GstRTSPStream * stream) +{ + GstRTSPStreamTransport *trans; + + GST_INFO ("%p: source %p bye timeout", stream, source); + + if ((trans = g_object_get_qdata (source, ssrc_stream_map_key))) { + gst_rtsp_stream_transport_set_timed_out (trans, TRUE); + g_object_set_qdata (source, ssrc_stream_map_key, NULL); + } +} + +static void +on_timeout (GObject * session, GObject * source, GstRTSPStream * stream) +{ + GstRTSPStreamTransport *trans; + + GST_INFO ("%p: source %p timeout", stream, source); + + if ((trans = g_object_get_qdata (source, ssrc_stream_map_key))) { + gst_rtsp_stream_transport_set_timed_out (trans, TRUE); + g_object_set_qdata (source, ssrc_stream_map_key, NULL); + } +} + +static void +clear_tr_cache (GstRTSPStreamPrivate * priv) +{ + g_list_foreach (priv->tr_cache, (GFunc) g_object_unref, NULL); + g_list_free (priv->tr_cache); + priv->tr_cache = NULL; +} + +static GstFlowReturn +handle_new_sample (GstAppSink * sink, gpointer user_data) +{ + GstRTSPStreamPrivate *priv; + GList *walk; + GstSample *sample; + GstBuffer *buffer; + GstRTSPStream *stream; + gboolean is_rtp; + + sample = gst_app_sink_pull_sample (sink); + if (!sample) + return GST_FLOW_OK; + + stream = (GstRTSPStream *) user_data; + priv = stream->priv; + buffer = gst_sample_get_buffer (sample); + + is_rtp = GST_ELEMENT_CAST (sink) == priv->appsink[0]; + + g_mutex_lock (&priv->lock); + if (priv->tr_cache_cookie != priv->transports_cookie) { + clear_tr_cache (priv); + for (walk = priv->transports; walk; walk = g_list_next (walk)) { + GstRTSPStreamTransport *tr = (GstRTSPStreamTransport *) walk->data; + priv->tr_cache = g_list_prepend (priv->tr_cache, g_object_ref (tr)); + } + priv->tr_cache_cookie = priv->transports_cookie; + } + g_mutex_unlock (&priv->lock); + + for (walk = priv->tr_cache; walk; walk = g_list_next (walk)) { + GstRTSPStreamTransport *tr = (GstRTSPStreamTransport *) walk->data; + + if (is_rtp) { + gst_rtsp_stream_transport_send_rtp (tr, buffer); + } else { + gst_rtsp_stream_transport_send_rtcp (tr, buffer); + } + } + gst_sample_unref (sample); + + return GST_FLOW_OK; +} + +static GstAppSinkCallbacks sink_cb = { + NULL, /* not interested in EOS */ + NULL, /* not interested in preroll samples */ + handle_new_sample, +}; + +static GstElement * +get_rtp_encoder (GstRTSPStream * stream, guint session) +{ + GstRTSPStreamPrivate *priv = stream->priv; + + if (priv->srtpenc == NULL) { + gchar *name; + + name = g_strdup_printf ("srtpenc_%u", session); + priv->srtpenc = gst_element_factory_make ("srtpenc", name); + g_free (name); + + g_object_set (priv->srtpenc, "random-key", TRUE, NULL); + } + return gst_object_ref (priv->srtpenc); +} + +static GstElement * +request_rtp_encoder (GstElement * rtpbin, guint session, GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv = stream->priv; + GstElement *oldenc, *enc; + GstPad *pad; + gchar *name; + + if (priv->idx != session) + return NULL; + + GST_DEBUG_OBJECT (stream, "make RTP encoder for session %u", session); + + oldenc = priv->srtpenc; + enc = get_rtp_encoder (stream, session); + name = g_strdup_printf ("rtp_sink_%d", session); + pad = gst_element_get_request_pad (enc, name); + g_free (name); + gst_object_unref (pad); + + if (oldenc == NULL) + g_signal_emit (stream, gst_rtsp_stream_signals[SIGNAL_NEW_RTP_ENCODER], 0, + enc); + + return enc; +} + +static GstElement * +request_rtcp_encoder (GstElement * rtpbin, guint session, + GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv = stream->priv; + GstElement *oldenc, *enc; + GstPad *pad; + gchar *name; + + if (priv->idx != session) + return NULL; + + GST_DEBUG_OBJECT (stream, "make RTCP encoder for session %u", session); + + oldenc = priv->srtpenc; + enc = get_rtp_encoder (stream, session); + name = g_strdup_printf ("rtcp_sink_%d", session); + pad = gst_element_get_request_pad (enc, name); + g_free (name); + gst_object_unref (pad); + + if (oldenc == NULL) + g_signal_emit (stream, gst_rtsp_stream_signals[SIGNAL_NEW_RTCP_ENCODER], 0, + enc); + + return enc; +} + +static GstCaps * +request_key (GstElement * srtpdec, guint ssrc, GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv = stream->priv; + GstCaps *caps; + + GST_DEBUG ("request key %08x", ssrc); + + g_mutex_lock (&priv->lock); + if ((caps = g_hash_table_lookup (priv->keys, GINT_TO_POINTER (ssrc)))) + gst_caps_ref (caps); + g_mutex_unlock (&priv->lock); + + return caps; +} + +static GstElement * +request_rtcp_decoder (GstElement * rtpbin, guint session, + GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv = stream->priv; + + if (priv->idx != session) + return NULL; + + if (priv->srtpdec == NULL) { + gchar *name; + + name = g_strdup_printf ("srtpdec_%u", session); + priv->srtpdec = gst_element_factory_make ("srtpdec", name); + g_free (name); + + g_signal_connect (priv->srtpdec, "request-key", + (GCallback) request_key, stream); + } + return gst_object_ref (priv->srtpdec); +} + +/** + * gst_rtsp_stream_join_bin: + * @stream: a #GstRTSPStream + * @bin: (transfer none): a #GstBin to join + * @rtpbin: (transfer none): a rtpbin element in @bin + * @state: the target state of the new elements + * + * Join the #GstBin @bin that contains the element @rtpbin. + * + * @stream will link to @rtpbin, which must be inside @bin. The elements + * added to @bin will be set to the state given in @state. + * + * Returns: %TRUE on success. + */ +gboolean +gst_rtsp_stream_join_bin (GstRTSPStream * stream, GstBin * bin, + GstElement * rtpbin, GstState state) +{ + GstRTSPStreamPrivate *priv; + gint i; + guint idx; + gchar *name; + GstPad *pad, *sinkpad, *selpad; + GstPadLinkReturn ret; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + g_return_val_if_fail (GST_IS_BIN (bin), FALSE); + g_return_val_if_fail (GST_IS_ELEMENT (rtpbin), FALSE); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + if (priv->is_joined) + goto was_joined; + + /* create a session with the same index as the stream */ + idx = priv->idx; + + GST_INFO ("stream %p joining bin as session %u", stream, idx); + + if (!alloc_ports (stream)) + goto no_ports; + + /* update the dscp qos field in the sinks */ + update_dscp_qos (stream); + + if (priv->profiles & GST_RTSP_PROFILE_SAVP + || priv->profiles & GST_RTSP_PROFILE_SAVPF) { + /* For SRTP */ + g_signal_connect (rtpbin, "request-rtp-encoder", + (GCallback) request_rtp_encoder, stream); + g_signal_connect (rtpbin, "request-rtcp-encoder", + (GCallback) request_rtcp_encoder, stream); + g_signal_connect (rtpbin, "request-rtcp-decoder", + (GCallback) request_rtcp_decoder, stream); + } + + /* get a pad for sending RTP */ + name = g_strdup_printf ("send_rtp_sink_%u", idx); + priv->send_rtp_sink = gst_element_get_request_pad (rtpbin, name); + g_free (name); + /* link the RTP pad to the session manager, it should not really fail unless + * this is not really an RTP pad */ + ret = gst_pad_link (priv->srcpad, priv->send_rtp_sink); + if (ret != GST_PAD_LINK_OK) + goto link_failed; + + /* get pads from the RTP session element for sending and receiving + * RTP/RTCP*/ + name = g_strdup_printf ("send_rtp_src_%u", idx); + priv->send_src[0] = gst_element_get_static_pad (rtpbin, name); + g_free (name); + name = g_strdup_printf ("send_rtcp_src_%u", idx); + priv->send_src[1] = gst_element_get_request_pad (rtpbin, name); + g_free (name); + name = g_strdup_printf ("recv_rtp_sink_%u", idx); + priv->recv_sink[0] = gst_element_get_request_pad (rtpbin, name); + g_free (name); + name = g_strdup_printf ("recv_rtcp_sink_%u", idx); + priv->recv_sink[1] = gst_element_get_request_pad (rtpbin, name); + g_free (name); + + /* get the session, TODO-WFD: This session needs to be decrease ref count? */ + g_signal_emit_by_name (rtpbin, "get-internal-session", idx, &priv->session); + + g_signal_connect (priv->session, "on-new-ssrc", (GCallback) on_new_ssrc, + stream); + g_signal_connect (priv->session, "on-ssrc-sdes", (GCallback) on_ssrc_sdes, + stream); + g_signal_connect (priv->session, "on-ssrc-active", + (GCallback) on_ssrc_active, stream); + g_signal_connect (priv->session, "on-bye-ssrc", (GCallback) on_bye_ssrc, + stream); + g_signal_connect (priv->session, "on-bye-timeout", + (GCallback) on_bye_timeout, stream); + g_signal_connect (priv->session, "on-timeout", (GCallback) on_timeout, + stream); + + for (i = 0; i < 2; i++) { + GstPad *teepad, *queuepad; + /* For the sender we create this bit of pipeline for both + * RTP and RTCP. Sync and preroll are enabled on udpsink so + * we need to add a queue before appsink to make the pipeline + * not block. For the TCP case, we want to pump data to the + * client as fast as possible anyway. + * + * .--------. .-----. .---------. + * | rtpbin | | tee | | udpsink | + * | send->sink src->sink | + * '--------' | | '---------' + * | | .---------. .---------. + * | | | queue | | appsink | + * | src->sink src->sink | + * '-----' '---------' '---------' + * + * When only UDP is allowed, we skip the tee, queue and appsink and link the + * udpsink directly to the session. + */ + /* add udpsink */ + gst_bin_add (bin, priv->udpsink[i]); + sinkpad = gst_element_get_static_pad (priv->udpsink[i], "sink"); + + if (priv->protocols & GST_RTSP_LOWER_TRANS_TCP) { + /* make tee for RTP/RTCP */ + priv->tee[i] = gst_element_factory_make ("tee", NULL); + gst_bin_add (bin, priv->tee[i]); + + /* and link to rtpbin send pad */ + pad = gst_element_get_static_pad (priv->tee[i], "sink"); + gst_pad_link (priv->send_src[i], pad); + gst_object_unref (pad); + + /* link tee to udpsink */ + teepad = gst_element_get_request_pad (priv->tee[i], "src_%u"); + gst_pad_link (teepad, sinkpad); + gst_object_unref (teepad); + + /* make queue */ + priv->appqueue[i] = gst_element_factory_make ("queue", NULL); + gst_bin_add (bin, priv->appqueue[i]); + /* and link to tee */ + teepad = gst_element_get_request_pad (priv->tee[i], "src_%u"); + pad = gst_element_get_static_pad (priv->appqueue[i], "sink"); + gst_pad_link (teepad, pad); + gst_object_unref (pad); + gst_object_unref (teepad); + + /* make appsink */ + priv->appsink[i] = gst_element_factory_make ("appsink", NULL); + g_object_set (priv->appsink[i], "async", FALSE, "sync", FALSE, NULL); + g_object_set (priv->appsink[i], "emit-signals", FALSE, NULL); + gst_bin_add (bin, priv->appsink[i]); + gst_app_sink_set_callbacks (GST_APP_SINK_CAST (priv->appsink[i]), + &sink_cb, stream, NULL); + /* and link to queue */ + queuepad = gst_element_get_static_pad (priv->appqueue[i], "src"); + pad = gst_element_get_static_pad (priv->appsink[i], "sink"); + gst_pad_link (queuepad, pad); + gst_object_unref (pad); + gst_object_unref (queuepad); + } else { + /* else only udpsink needed, link it to the session */ + gst_pad_link (priv->send_src[i], sinkpad); + } + gst_object_unref (sinkpad); + + /* For the receiver we create this bit of pipeline for both + * RTP and RTCP. We receive RTP/RTCP on appsrc and udpsrc + * and it is all funneled into the rtpbin receive pad. + * + * .--------. .--------. .--------. + * | udpsrc | | funnel | | rtpbin | + * | src->sink src->sink | + * '--------' | | '--------' + * .--------. | | + * | appsrc | | | + * | src->sink | + * '--------' '--------' + */ + /* make funnel for the RTP/RTCP receivers */ + priv->funnel[i] = gst_element_factory_make ("funnel", NULL); + gst_bin_add (bin, priv->funnel[i]); + + pad = gst_element_get_static_pad (priv->funnel[i], "src"); + gst_pad_link (pad, priv->recv_sink[i]); + gst_object_unref (pad); + + if (priv->udpsrc_v4[i]) { + /* we set and keep these to playing so that they don't cause NO_PREROLL return + * values */ + gst_element_set_state (priv->udpsrc_v4[i], GST_STATE_PLAYING); + gst_element_set_locked_state (priv->udpsrc_v4[i], TRUE); + /* add udpsrc */ + gst_bin_add (bin, priv->udpsrc_v4[i]); + + /* and link to the funnel v4 */ + selpad = gst_element_get_request_pad (priv->funnel[i], "sink_%u"); + pad = gst_element_get_static_pad (priv->udpsrc_v4[i], "src"); + gst_pad_link (pad, selpad); + gst_object_unref (pad); + gst_object_unref (selpad); + } + + if (priv->udpsrc_v6[i]) { + gst_element_set_state (priv->udpsrc_v6[i], GST_STATE_PLAYING); + gst_element_set_locked_state (priv->udpsrc_v6[i], TRUE); + gst_bin_add (bin, priv->udpsrc_v6[i]); + + /* and link to the funnel v6 */ + selpad = gst_element_get_request_pad (priv->funnel[i], "sink_%u"); + pad = gst_element_get_static_pad (priv->udpsrc_v6[i], "src"); + gst_pad_link (pad, selpad); + gst_object_unref (pad); + gst_object_unref (selpad); + } + + if (priv->protocols & GST_RTSP_LOWER_TRANS_TCP) { + /* make and add appsrc */ + priv->appsrc[i] = gst_element_factory_make ("appsrc", NULL); + gst_bin_add (bin, priv->appsrc[i]); + /* and link to the funnel */ + selpad = gst_element_get_request_pad (priv->funnel[i], "sink_%u"); + pad = gst_element_get_static_pad (priv->appsrc[i], "src"); + gst_pad_link (pad, selpad); + gst_object_unref (pad); + gst_object_unref (selpad); + } + + /* check if we need to set to a special state */ + if (state != GST_STATE_NULL) { + if (priv->udpsink[i]) + gst_element_set_state (priv->udpsink[i], state); + if (priv->appsink[i]) + gst_element_set_state (priv->appsink[i], state); + if (priv->appqueue[i]) + gst_element_set_state (priv->appqueue[i], state); + if (priv->tee[i]) + gst_element_set_state (priv->tee[i], state); + if (priv->funnel[i]) + gst_element_set_state (priv->funnel[i], state); + if (priv->appsrc[i]) + gst_element_set_state (priv->appsrc[i], state); + } + } + + /* be notified of caps changes */ + priv->caps_sig = g_signal_connect (priv->send_src[0], "notify::caps", + (GCallback) caps_notify, stream); + + priv->is_joined = TRUE; + g_mutex_unlock (&priv->lock); + + return TRUE; + + /* ERRORS */ +was_joined: + { + g_mutex_unlock (&priv->lock); + return TRUE; + } +no_ports: + { + g_mutex_unlock (&priv->lock); + GST_WARNING ("failed to allocate ports %u", idx); + return FALSE; + } +link_failed: + { + GST_WARNING ("failed to link stream %u", idx); + gst_object_unref (priv->send_rtp_sink); + priv->send_rtp_sink = NULL; + g_mutex_unlock (&priv->lock); + return FALSE; + } +} + +/** + * gst_rtsp_stream_leave_bin: + * @stream: a #GstRTSPStream + * @bin: (transfer none): a #GstBin + * @rtpbin: (transfer none): a rtpbin #GstElement + * + * Remove the elements of @stream from @bin. + * + * Return: %TRUE on success. + */ +gboolean +gst_rtsp_stream_leave_bin (GstRTSPStream * stream, GstBin * bin, + GstElement * rtpbin) +{ + GstRTSPStreamPrivate *priv; + gint i; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + g_return_val_if_fail (GST_IS_BIN (bin), FALSE); + g_return_val_if_fail (GST_IS_ELEMENT (rtpbin), FALSE); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + if (!priv->is_joined) + goto was_not_joined; + + /* all transports must be removed by now */ + g_return_val_if_fail (priv->transports == NULL, FALSE); + + clear_tr_cache (priv); + + GST_INFO ("stream %p leaving bin", stream); + + gst_pad_unlink (priv->srcpad, priv->send_rtp_sink); + g_signal_handler_disconnect (priv->send_src[0], priv->caps_sig); + gst_element_release_request_pad (rtpbin, priv->send_rtp_sink); + gst_object_unref (priv->send_rtp_sink); + priv->send_rtp_sink = NULL; + + for (i = 0; i < 2; i++) { + if (priv->udpsink[i]) + gst_element_set_state (priv->udpsink[i], GST_STATE_NULL); + if (priv->appsink[i]) + gst_element_set_state (priv->appsink[i], GST_STATE_NULL); + if (priv->appqueue[i]) + gst_element_set_state (priv->appqueue[i], GST_STATE_NULL); + if (priv->tee[i]) + gst_element_set_state (priv->tee[i], GST_STATE_NULL); + if (priv->funnel[i]) + gst_element_set_state (priv->funnel[i], GST_STATE_NULL); + if (priv->appsrc[i]) + gst_element_set_state (priv->appsrc[i], GST_STATE_NULL); + if (priv->udpsrc_v4[i]) { + /* and set udpsrc to NULL now before removing */ + gst_element_set_locked_state (priv->udpsrc_v4[i], FALSE); + gst_element_set_state (priv->udpsrc_v4[i], GST_STATE_NULL); + /* removing them should also nicely release the request + * pads when they finalize */ + gst_bin_remove (bin, priv->udpsrc_v4[i]); + } + if (priv->udpsrc_v6[i]) { + gst_element_set_locked_state (priv->udpsrc_v6[i], FALSE); + gst_element_set_state (priv->udpsrc_v6[i], GST_STATE_NULL); + gst_bin_remove (bin, priv->udpsrc_v6[i]); + } + if (priv->udpsink[i]) + gst_bin_remove (bin, priv->udpsink[i]); + if (priv->appsrc[i]) + gst_bin_remove (bin, priv->appsrc[i]); + if (priv->appsink[i]) + gst_bin_remove (bin, priv->appsink[i]); + if (priv->appqueue[i]) + gst_bin_remove (bin, priv->appqueue[i]); + if (priv->tee[i]) + gst_bin_remove (bin, priv->tee[i]); + if (priv->funnel[i]) + gst_bin_remove (bin, priv->funnel[i]); + + gst_element_release_request_pad (rtpbin, priv->recv_sink[i]); + gst_object_unref (priv->recv_sink[i]); + priv->recv_sink[i] = NULL; + + priv->udpsrc_v4[i] = NULL; + priv->udpsrc_v6[i] = NULL; + priv->udpsink[i] = NULL; + priv->appsrc[i] = NULL; + priv->appsink[i] = NULL; + priv->appqueue[i] = NULL; + priv->tee[i] = NULL; + priv->funnel[i] = NULL; + } + gst_object_unref (priv->send_src[0]); + priv->send_src[0] = NULL; + + gst_element_release_request_pad (rtpbin, priv->send_src[1]); + gst_object_unref (priv->send_src[1]); + priv->send_src[1] = NULL; + + g_object_unref (priv->session); + priv->session = NULL; + if (priv->caps) + gst_caps_unref (priv->caps); + priv->caps = NULL; + + if (priv->srtpenc) + gst_object_unref (priv->srtpenc); + + priv->is_joined = FALSE; + g_mutex_unlock (&priv->lock); + + return TRUE; + +was_not_joined: + { + g_mutex_unlock (&priv->lock); + return TRUE; + } +} + +/** + * gst_rtsp_stream_get_rtpinfo: + * @stream: a #GstRTSPStream + * @rtptime: (allow-none): result RTP timestamp + * @seq: (allow-none): result RTP seqnum + * @clock_rate: (allow-none): the clock rate + * @running_time: (allow-none): result running-time + * + * Retrieve the current rtptime, seq and running-time. This is used to + * construct a RTPInfo reply header. + * + * Returns: %TRUE when rtptime, seq and running-time could be determined. + */ +gboolean +gst_rtsp_stream_get_rtpinfo (GstRTSPStream * stream, + guint * rtptime, guint * seq, guint * clock_rate, + GstClockTime * running_time) +{ + GstRTSPStreamPrivate *priv; + GstStructure *stats; + GObjectClass *payobjclass; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + + priv = stream->priv; + + payobjclass = G_OBJECT_GET_CLASS (priv->payloader); + + g_mutex_lock (&priv->lock); + + if (g_object_class_find_property (payobjclass, "stats")) { + g_object_get (priv->payloader, "stats", &stats, NULL); + if (stats == NULL) + goto no_stats; + + if (seq) + gst_structure_get_uint (stats, "seqnum", seq); + + if (rtptime) + gst_structure_get_uint (stats, "timestamp", rtptime); + + if (running_time) + gst_structure_get_clock_time (stats, "running-time", running_time); + + if (clock_rate) { + gst_structure_get_uint (stats, "clock-rate", clock_rate); + if (*clock_rate == 0 && running_time) + *running_time = GST_CLOCK_TIME_NONE; + } + gst_structure_free (stats); + } else { + if (!g_object_class_find_property (payobjclass, "seqnum") || + !g_object_class_find_property (payobjclass, "timestamp")) + goto no_stats; + + if (seq) + g_object_get (priv->payloader, "seqnum", seq, NULL); + + if (rtptime) + g_object_get (priv->payloader, "timestamp", rtptime, NULL); + + if (running_time) + *running_time = GST_CLOCK_TIME_NONE; + } + g_mutex_unlock (&priv->lock); + + return TRUE; + + /* ERRORS */ +no_stats: + { + GST_WARNING ("Could not get payloader stats"); + g_mutex_unlock (&priv->lock); + return FALSE; + } +} + +/** + * gst_rtsp_stream_get_caps: + * @stream: a #GstRTSPStream + * + * Retrieve the current caps of @stream. + * + * Returns: (transfer full): the #GstCaps of @stream. use gst_caps_unref() + * after usage. + */ +GstCaps * +gst_rtsp_stream_get_caps (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv; + GstCaps *result; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + if ((result = priv->caps)) + gst_caps_ref (result); + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_stream_recv_rtp: + * @stream: a #GstRTSPStream + * @buffer: (transfer full): a #GstBuffer + * + * Handle an RTP buffer for the stream. This method is usually called when a + * message has been received from a client using the TCP transport. + * + * This function takes ownership of @buffer. + * + * Returns: a GstFlowReturn. + */ +GstFlowReturn +gst_rtsp_stream_recv_rtp (GstRTSPStream * stream, GstBuffer * buffer) +{ + GstRTSPStreamPrivate *priv; + GstFlowReturn ret; + GstElement *element; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), GST_FLOW_ERROR); + priv = stream->priv; + g_return_val_if_fail (GST_IS_BUFFER (buffer), GST_FLOW_ERROR); + g_return_val_if_fail (priv->is_joined, FALSE); + + g_mutex_lock (&priv->lock); + if (priv->appsrc[0]) + element = gst_object_ref (priv->appsrc[0]); + else + element = NULL; + g_mutex_unlock (&priv->lock); + + if (element) { + ret = gst_app_src_push_buffer (GST_APP_SRC_CAST (element), buffer); + gst_object_unref (element); + } else { + ret = GST_FLOW_OK; + } + return ret; +} + +/** + * gst_rtsp_stream_recv_rtcp: + * @stream: a #GstRTSPStream + * @buffer: (transfer full): a #GstBuffer + * + * Handle an RTCP buffer for the stream. This method is usually called when a + * message has been received from a client using the TCP transport. + * + * This function takes ownership of @buffer. + * + * Returns: a GstFlowReturn. + */ +GstFlowReturn +gst_rtsp_stream_recv_rtcp (GstRTSPStream * stream, GstBuffer * buffer) +{ + GstRTSPStreamPrivate *priv; + GstFlowReturn ret; + GstElement *element; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), GST_FLOW_ERROR); + priv = stream->priv; + g_return_val_if_fail (GST_IS_BUFFER (buffer), GST_FLOW_ERROR); + g_return_val_if_fail (priv->is_joined, FALSE); + + g_mutex_lock (&priv->lock); + if (priv->appsrc[1]) + element = gst_object_ref (priv->appsrc[1]); + else + element = NULL; + g_mutex_unlock (&priv->lock); + + if (element) { + ret = gst_app_src_push_buffer (GST_APP_SRC_CAST (element), buffer); + gst_object_unref (element); + } else { + ret = GST_FLOW_OK; + gst_buffer_unref (buffer); + } + return ret; +} + +/* must be called with lock */ +static gboolean +update_transport (GstRTSPStream * stream, GstRTSPStreamTransport * trans, + gboolean add) +{ + GstRTSPStreamPrivate *priv = stream->priv; + const GstRTSPTransport *tr; + + tr = gst_rtsp_stream_transport_get_transport (trans); + + switch (tr->lower_transport) { + case GST_RTSP_LOWER_TRANS_UDP: + case GST_RTSP_LOWER_TRANS_UDP_MCAST: + { + gchar *dest; + gint min, max; + guint ttl = 0; + + dest = tr->destination; + if (tr->lower_transport == GST_RTSP_LOWER_TRANS_UDP_MCAST) { + min = tr->port.min; + max = tr->port.max; + ttl = tr->ttl; + } else { + min = tr->client_port.min; + max = tr->client_port.max; + } + + if (add) { + if (ttl > 0) { + GST_INFO ("setting ttl-mc %d", ttl); + g_object_set (G_OBJECT (priv->udpsink[0]), "ttl-mc", ttl, NULL); + g_object_set (G_OBJECT (priv->udpsink[1]), "ttl-mc", ttl, NULL); + } + GST_INFO ("adding %s:%d-%d", dest, min, max); + g_signal_emit_by_name (priv->udpsink[0], "add", dest, min, NULL); + g_signal_emit_by_name (priv->udpsink[1], "add", dest, max, NULL); + priv->transports = g_list_prepend (priv->transports, trans); + } else { + GST_INFO ("removing %s:%d-%d", dest, min, max); + g_signal_emit_by_name (priv->udpsink[0], "remove", dest, min, NULL); + g_signal_emit_by_name (priv->udpsink[1], "remove", dest, max, NULL); + priv->transports = g_list_remove (priv->transports, trans); + } + priv->transports_cookie++; + break; + } + case GST_RTSP_LOWER_TRANS_TCP: + if (add) { + GST_INFO ("adding TCP %s", tr->destination); + priv->transports = g_list_prepend (priv->transports, trans); + } else { + GST_INFO ("removing TCP %s", tr->destination); + priv->transports = g_list_remove (priv->transports, trans); + } + priv->transports_cookie++; + break; + default: + goto unknown_transport; + } + return TRUE; + + /* ERRORS */ +unknown_transport: + { + GST_INFO ("Unknown transport %d", tr->lower_transport); + return FALSE; + } +} + + +/** + * gst_rtsp_stream_add_transport: + * @stream: a #GstRTSPStream + * @trans: (transfer none): a #GstRTSPStreamTransport + * + * Add the transport in @trans to @stream. The media of @stream will + * then also be send to the values configured in @trans. + * + * @stream must be joined to a bin. + * + * @trans must contain a valid #GstRTSPTransport. + * + * Returns: %TRUE if @trans was added + */ +gboolean +gst_rtsp_stream_add_transport (GstRTSPStream * stream, + GstRTSPStreamTransport * trans) +{ + GstRTSPStreamPrivate *priv; + gboolean res; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + priv = stream->priv; + g_return_val_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans), FALSE); + g_return_val_if_fail (priv->is_joined, FALSE); + + g_mutex_lock (&priv->lock); + res = update_transport (stream, trans, TRUE); + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_stream_remove_transport: + * @stream: a #GstRTSPStream + * @trans: (transfer none): a #GstRTSPStreamTransport + * + * Remove the transport in @trans from @stream. The media of @stream will + * not be sent to the values configured in @trans. + * + * @stream must be joined to a bin. + * + * @trans must contain a valid #GstRTSPTransport. + * + * Returns: %TRUE if @trans was removed + */ +gboolean +gst_rtsp_stream_remove_transport (GstRTSPStream * stream, + GstRTSPStreamTransport * trans) +{ + GstRTSPStreamPrivate *priv; + gboolean res; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + priv = stream->priv; + g_return_val_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans), FALSE); + g_return_val_if_fail (priv->is_joined, FALSE); + + g_mutex_lock (&priv->lock); + res = update_transport (stream, trans, FALSE); + g_mutex_unlock (&priv->lock); + + return res; +} + +/** + * gst_rtsp_stream_update_crypto: + * @stream: a #GstRTSPStream + * @ssrc: the SSRC + * @crypto: (transfer none) (allow-none): a #GstCaps with crypto info + * + * Update the new crypto information for @ssrc in @stream. If information + * for @ssrc did not exist, it will be added. If information + * for @ssrc existed, it will be replaced. If @crypto is %NULL, it will + * be removed from @stream. + * + * Returns: %TRUE if @crypto could be updated + */ +gboolean +gst_rtsp_stream_update_crypto (GstRTSPStream * stream, + guint ssrc, GstCaps * crypto) +{ + GstRTSPStreamPrivate *priv; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + g_return_val_if_fail (crypto == NULL || GST_IS_CAPS (crypto), FALSE); + + priv = stream->priv; + + GST_DEBUG_OBJECT (stream, "update key for %08x", ssrc); + + g_mutex_lock (&priv->lock); + if (crypto) + g_hash_table_insert (priv->keys, GINT_TO_POINTER (ssrc), + gst_caps_ref (crypto)); + else + g_hash_table_remove (priv->keys, GINT_TO_POINTER (ssrc)); + g_mutex_unlock (&priv->lock); + + return TRUE; +} + +/** + * gst_rtsp_stream_get_rtp_socket: + * @stream: a #GstRTSPStream + * @family: the socket family + * + * Get the RTP socket from @stream for a @family. + * + * @stream must be joined to a bin. + * + * Returns: (transfer full) (nullable): the RTP socket or %NULL if no + * socket could be allocated for @family. Unref after usage + */ +GSocket * +gst_rtsp_stream_get_rtp_socket (GstRTSPStream * stream, GSocketFamily family) +{ + GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream); + GSocket *socket; + const gchar *name; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + g_return_val_if_fail (family == G_SOCKET_FAMILY_IPV4 || + family == G_SOCKET_FAMILY_IPV6, NULL); + g_return_val_if_fail (priv->udpsink[0], NULL); + + if (family == G_SOCKET_FAMILY_IPV6) + name = "socket-v6"; + else + name = "socket"; + + g_object_get (priv->udpsink[0], name, &socket, NULL); + + return socket; +} + +/** + * gst_rtsp_stream_get_rtcp_socket: + * @stream: a #GstRTSPStream + * @family: the socket family + * + * Get the RTCP socket from @stream for a @family. + * + * @stream must be joined to a bin. + * + * Returns: (transfer full) (nullable): the RTCP socket or %NULL if no + * socket could be allocated for @family. Unref after usage + */ +GSocket * +gst_rtsp_stream_get_rtcp_socket (GstRTSPStream * stream, GSocketFamily family) +{ + GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream); + GSocket *socket; + const gchar *name; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + g_return_val_if_fail (family == G_SOCKET_FAMILY_IPV4 || + family == G_SOCKET_FAMILY_IPV6, NULL); + g_return_val_if_fail (priv->udpsink[1], NULL); + + if (family == G_SOCKET_FAMILY_IPV6) + name = "socket-v6"; + else + name = "socket"; + + g_object_get (priv->udpsink[1], name, &socket, NULL); + + return socket; +} + +/** + * gst_rtsp_stream_transport_filter: + * @stream: a #GstRTSPStream + * @func: (scope call) (allow-none): a callback + * @user_data: (closure): user data passed to @func + * + * Call @func for each transport managed by @stream. The result value of @func + * determines what happens to the transport. @func will be called with @stream + * locked so no further actions on @stream can be performed from @func. + * + * If @func returns #GST_RTSP_FILTER_REMOVE, the transport will be removed from + * @stream. + * + * If @func returns #GST_RTSP_FILTER_KEEP, the transport will remain in @stream. + * + * If @func returns #GST_RTSP_FILTER_REF, the transport will remain in @stream but + * will also be added with an additional ref to the result #GList of this + * function.. + * + * When @func is %NULL, #GST_RTSP_FILTER_REF will be assumed for each transport. + * + * Returns: (element-type GstRTSPStreamTransport) (transfer full): a #GList with all + * transports for which @func returned #GST_RTSP_FILTER_REF. After usage, each + * element in the #GList should be unreffed before the list is freed. + */ +GList * +gst_rtsp_stream_transport_filter (GstRTSPStream * stream, + GstRTSPStreamTransportFilterFunc func, gpointer user_data) +{ + GstRTSPStreamPrivate *priv; + GList *result, *walk, *next; + GHashTable *visited; + guint cookie; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL); + + priv = stream->priv; + + result = NULL; + if (func) + visited = g_hash_table_new_full (NULL, NULL, g_object_unref, NULL); + + g_mutex_lock (&priv->lock); +restart: + cookie = priv->transports_cookie; + for (walk = priv->transports; walk; walk = next) { + GstRTSPStreamTransport *trans = walk->data; + GstRTSPFilterResult res; + gboolean changed; + + next = g_list_next (walk); + + if (func) { + /* only visit each transport once */ + if (g_hash_table_contains (visited, trans)) + continue; + + g_hash_table_add (visited, g_object_ref (trans)); + g_mutex_unlock (&priv->lock); + + res = func (stream, trans, user_data); + + g_mutex_lock (&priv->lock); + } else + res = GST_RTSP_FILTER_REF; + + changed = (cookie != priv->transports_cookie); + + switch (res) { + case GST_RTSP_FILTER_REMOVE: + update_transport (stream, trans, FALSE); + break; + case GST_RTSP_FILTER_REF: + result = g_list_prepend (result, g_object_ref (trans)); + break; + case GST_RTSP_FILTER_KEEP: + default: + break; + } + if (changed) + goto restart; + } + g_mutex_unlock (&priv->lock); + + if (func) + g_hash_table_unref (visited); + + return result; +} + +static GstPadProbeReturn +pad_blocking (GstPad * pad, GstPadProbeInfo * info, gpointer user_data) +{ + GstRTSPStreamPrivate *priv; + GstRTSPStream *stream; + + stream = user_data; + priv = stream->priv; + + GST_DEBUG_OBJECT (pad, "now blocking"); + + g_mutex_lock (&priv->lock); + priv->blocking = TRUE; + g_mutex_unlock (&priv->lock); + + gst_element_post_message (priv->payloader, + gst_message_new_element (GST_OBJECT_CAST (priv->payloader), + gst_structure_new_empty ("GstRTSPStreamBlocking"))); + + return GST_PAD_PROBE_OK; +} + +/** + * gst_rtsp_stream_set_blocked: + * @stream: a #GstRTSPStream + * @blocked: boolean indicating we should block or unblock + * + * Blocks or unblocks the dataflow on @stream. + * + * Returns: %TRUE on success + */ +gboolean +gst_rtsp_stream_set_blocked (GstRTSPStream * stream, gboolean blocked) +{ + GstRTSPStreamPrivate *priv; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + if (blocked) { + priv->blocking = FALSE; + if (priv->blocked_id == 0) { + priv->blocked_id = gst_pad_add_probe (priv->srcpad, + GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_BUFFER | + GST_PAD_PROBE_TYPE_BUFFER_LIST, pad_blocking, + g_object_ref (stream), g_object_unref); + } + } else { + if (priv->blocked_id != 0) { + gst_pad_remove_probe (priv->srcpad, priv->blocked_id); + priv->blocked_id = 0; + priv->blocking = FALSE; + } + } + g_mutex_unlock (&priv->lock); + + return TRUE; +} + +/** + * gst_rtsp_stream_is_blocking: + * @stream: a #GstRTSPStream + * + * Check if @stream is blocking on a #GstBuffer. + * + * Returns: %TRUE if @stream is blocking + */ +gboolean +gst_rtsp_stream_is_blocking (GstRTSPStream * stream) +{ + GstRTSPStreamPrivate *priv; + gboolean result; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + result = priv->blocking; + g_mutex_unlock (&priv->lock); + + return result; +} + +/** + * gst_rtsp_stream_query_position: + * @stream: a #GstRTSPStream + * + * Query the position of the stream in %GST_FORMAT_TIME. This only considers + * the RTP parts of the pipeline and not the RTCP parts. + * + * Returns: %TRUE if the position could be queried + */ +gboolean +gst_rtsp_stream_query_position (GstRTSPStream * stream, gint64 * position) +{ + GstRTSPStreamPrivate *priv; + GstElement *sink; + gboolean ret; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + if ((sink = priv->udpsink[0])) + gst_object_ref (sink); + g_mutex_unlock (&priv->lock); + + if (!sink) + return FALSE; + + ret = gst_element_query_position (sink, GST_FORMAT_TIME, position); + gst_object_unref (sink); + + return ret; +} + +/** + * gst_rtsp_stream_query_stop: + * @stream: a #GstRTSPStream + * + * Query the stop of the stream in %GST_FORMAT_TIME. This only considers + * the RTP parts of the pipeline and not the RTCP parts. + * + * Returns: %TRUE if the stop could be queried + */ +gboolean +gst_rtsp_stream_query_stop (GstRTSPStream * stream, gint64 * stop) +{ + GstRTSPStreamPrivate *priv; + GstElement *sink; + GstQuery *query; + gboolean ret; + + g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); + + priv = stream->priv; + + g_mutex_lock (&priv->lock); + if ((sink = priv->udpsink[0])) + gst_object_ref (sink); + g_mutex_unlock (&priv->lock); + + if (!sink) + return FALSE; + + query = gst_query_new_segment (GST_FORMAT_TIME); + if ((ret = gst_element_query (sink, query))) { + GstFormat format; + + gst_query_parse_segment (query, NULL, &format, NULL, stop); + if (format != GST_FORMAT_TIME) + *stop = -1; + } + gst_query_unref (query); + gst_object_unref (sink); + + return ret; + +} diff --git a/gst/rtsp-server/rtsp-stream.h b/gst/rtsp-server/rtsp-stream.h new file mode 100644 index 0000000..1dbfdf3 --- /dev/null +++ b/gst/rtsp-server/rtsp-stream.h @@ -0,0 +1,186 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include +#include +#include + +#ifndef __GST_RTSP_STREAM_H__ +#define __GST_RTSP_STREAM_H__ + +G_BEGIN_DECLS + +/* types for the media stream */ +#define GST_TYPE_RTSP_STREAM (gst_rtsp_stream_get_type ()) +#define GST_IS_RTSP_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_STREAM)) +#define GST_IS_RTSP_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_STREAM)) +#define GST_RTSP_STREAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_STREAM, GstRTSPStreamClass)) +#define GST_RTSP_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_STREAM, GstRTSPStream)) +#define GST_RTSP_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_STREAM, GstRTSPStreamClass)) +#define GST_RTSP_STREAM_CAST(obj) ((GstRTSPStream*)(obj)) +#define GST_RTSP_STREAM_CLASS_CAST(klass) ((GstRTSPStreamClass*)(klass)) + +typedef struct _GstRTSPStream GstRTSPStream; +typedef struct _GstRTSPStreamClass GstRTSPStreamClass; +typedef struct _GstRTSPStreamPrivate GstRTSPStreamPrivate; + +#include "rtsp-stream-transport.h" +#include "rtsp-address-pool.h" +#include "rtsp-session.h" + +/** + * GstRTSPStream: + * + * The definition of a media stream. + */ +struct _GstRTSPStream { + GObject parent; + + /*< private >*/ + GstRTSPStreamPrivate *priv; + gpointer _gst_reserved[GST_PADDING];}; + +struct _GstRTSPStreamClass { + GObjectClass parent_class; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +GType gst_rtsp_stream_get_type (void); + +GstRTSPStream * gst_rtsp_stream_new (guint idx, GstElement *payloader, + GstPad *srcpad); +guint gst_rtsp_stream_get_index (GstRTSPStream *stream); +guint gst_rtsp_stream_get_pt (GstRTSPStream *stream); +GstPad * gst_rtsp_stream_get_srcpad (GstRTSPStream *stream); + +void gst_rtsp_stream_set_control (GstRTSPStream *stream, const gchar *control); +gchar * gst_rtsp_stream_get_control (GstRTSPStream *stream); +gboolean gst_rtsp_stream_has_control (GstRTSPStream *stream, const gchar *control); + +void gst_rtsp_stream_set_mtu (GstRTSPStream *stream, guint mtu); +guint gst_rtsp_stream_get_mtu (GstRTSPStream *stream); + +void gst_rtsp_stream_set_dscp_qos (GstRTSPStream *stream, gint dscp_qos); +gint gst_rtsp_stream_get_dscp_qos (GstRTSPStream *stream); + +gboolean gst_rtsp_stream_is_transport_supported (GstRTSPStream *stream, + GstRTSPTransport *transport); + +void gst_rtsp_stream_set_profiles (GstRTSPStream *stream, GstRTSPProfile profiles); +GstRTSPProfile gst_rtsp_stream_get_profiles (GstRTSPStream *stream); + +void gst_rtsp_stream_set_protocols (GstRTSPStream *stream, GstRTSPLowerTrans protocols); +GstRTSPLowerTrans gst_rtsp_stream_get_protocols (GstRTSPStream *stream); + +void gst_rtsp_stream_set_address_pool (GstRTSPStream *stream, GstRTSPAddressPool *pool); +GstRTSPAddressPool * + gst_rtsp_stream_get_address_pool (GstRTSPStream *stream); + +GstRTSPAddress * gst_rtsp_stream_reserve_address (GstRTSPStream *stream, + const gchar * address, + guint port, + guint n_ports, + guint ttl); + +gboolean gst_rtsp_stream_join_bin (GstRTSPStream *stream, + GstBin *bin, GstElement *rtpbin, + GstState state); +gboolean gst_rtsp_stream_leave_bin (GstRTSPStream *stream, + GstBin *bin, GstElement *rtpbin); + +gboolean gst_rtsp_stream_set_blocked (GstRTSPStream * stream, + gboolean blocked); +gboolean gst_rtsp_stream_is_blocking (GstRTSPStream * stream); + +void gst_rtsp_stream_get_server_port (GstRTSPStream *stream, + GstRTSPRange *server_port, + GSocketFamily family); +GstRTSPAddress * gst_rtsp_stream_get_multicast_address (GstRTSPStream *stream, + GSocketFamily family); + + +GObject * gst_rtsp_stream_get_rtpsession (GstRTSPStream *stream); + +void gst_rtsp_stream_get_ssrc (GstRTSPStream *stream, + guint *ssrc); + +gboolean gst_rtsp_stream_get_rtpinfo (GstRTSPStream *stream, + guint *rtptime, guint *seq, + guint *clock_rate, + GstClockTime *running_time); +GstCaps * gst_rtsp_stream_get_caps (GstRTSPStream *stream); + +GstFlowReturn gst_rtsp_stream_recv_rtp (GstRTSPStream *stream, + GstBuffer *buffer); +GstFlowReturn gst_rtsp_stream_recv_rtcp (GstRTSPStream *stream, + GstBuffer *buffer); + +gboolean gst_rtsp_stream_add_transport (GstRTSPStream *stream, + GstRTSPStreamTransport *trans); +gboolean gst_rtsp_stream_remove_transport (GstRTSPStream *stream, + GstRTSPStreamTransport *trans); + +GSocket * gst_rtsp_stream_get_rtp_socket (GstRTSPStream *stream, + GSocketFamily family); +GSocket * gst_rtsp_stream_get_rtcp_socket (GstRTSPStream *stream, + GSocketFamily family); + +gboolean gst_rtsp_stream_update_crypto (GstRTSPStream * stream, + guint ssrc, GstCaps * crypto); + + +gboolean gst_rtsp_stream_query_position (GstRTSPStream * stream, + gint64 * position); +gboolean gst_rtsp_stream_query_stop (GstRTSPStream * stream, + gint64 * stop); + +/** + * GstRTSPStreamTransportFilterFunc: + * @stream: a #GstRTSPStream object + * @trans: a #GstRTSPStreamTransport in @stream + * @user_data: user data that has been given to gst_rtsp_stream_transport_filter() + * + * This function will be called by the gst_rtsp_stream_transport_filter(). An + * implementation should return a value of #GstRTSPFilterResult. + * + * When this function returns #GST_RTSP_FILTER_REMOVE, @trans will be removed + * from @stream. + * + * A return value of #GST_RTSP_FILTER_KEEP will leave @trans untouched in + * @stream. + * + * A value of #GST_RTSP_FILTER_REF will add @trans to the result #GList of + * gst_rtsp_stream_transport_filter(). + * + * Returns: a #GstRTSPFilterResult. + */ +typedef GstRTSPFilterResult (*GstRTSPStreamTransportFilterFunc) (GstRTSPStream *stream, + GstRTSPStreamTransport *trans, + gpointer user_data); + +GList * gst_rtsp_stream_transport_filter (GstRTSPStream *stream, + GstRTSPStreamTransportFilterFunc func, + gpointer user_data); + +G_END_DECLS + +#endif /* __GST_RTSP_STREAM_H__ */ diff --git a/gst/rtsp-server/rtsp-thread-pool.c b/gst/rtsp-server/rtsp-thread-pool.c new file mode 100644 index 0000000..a8cce78 --- /dev/null +++ b/gst/rtsp-server/rtsp-thread-pool.c @@ -0,0 +1,561 @@ +/* GStreamer + * Copyright (C) 2013 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-thread-pool + * @short_description: A pool of threads + * @see_also: #GstRTSPMedia, #GstRTSPClient + * + * A #GstRTSPThreadPool manages reusable threads for various server tasks. + * Currently the defined thread types can be found in #GstRTSPThreadType. + * + * Threads of type #GST_RTSP_THREAD_TYPE_CLIENT are used to handle requests from + * a connected client. With gst_rtsp_thread_pool_get_max_threads() a maximum + * number of threads can be set after which the pool will start to reuse the + * same thread for multiple clients. + * + * Threads of type #GST_RTSP_THREAD_TYPE_MEDIA will be used to perform the state + * changes of the media pipelines and handle its bus messages. + * + * gst_rtsp_thread_pool_get_thread() can be used to create a #GstRTSPThread + * object of the right type. The thread object contains a mainloop and context + * that run in a seperate thread and can be used to attached sources to. + * + * gst_rtsp_thread_reuse() can be used to reuse a thread for multiple purposes. + * If all gst_rtsp_thread_reuse() calls are matched with a + * gst_rtsp_thread_stop() call, the mainloop will be quit and the thread will + * stop. + * + * To configure the threads, a subclass of this object should be made and the + * virtual methods should be overriden to implement the desired functionality. + * + * Last reviewed on 2013-07-11 (1.0.0) + */ + +#include + +#include "rtsp-thread-pool.h" + +typedef struct _GstRTSPThreadImpl +{ + GstRTSPThread thread; + + gint reused; + GSource *source; +} GstRTSPThreadImpl; + +GST_DEFINE_MINI_OBJECT_TYPE (GstRTSPThread, gst_rtsp_thread); + +static void gst_rtsp_thread_init (GstRTSPThreadImpl * impl); + +static void +_gst_rtsp_thread_free (GstRTSPThreadImpl * impl) +{ + GST_DEBUG ("free thread %p", impl); + + g_source_unref (impl->source); + g_main_loop_unref (impl->thread.loop); + g_main_context_unref (impl->thread.context); + g_slice_free1 (sizeof (GstRTSPThreadImpl), impl); +} + +static GstRTSPThread * +_gst_rtsp_thread_copy (GstRTSPThreadImpl * impl) +{ + GstRTSPThreadImpl *copy; + + GST_DEBUG ("copy thread %p", impl); + + copy = g_slice_new0 (GstRTSPThreadImpl); + gst_rtsp_thread_init (copy); + copy->thread.context = g_main_context_ref (impl->thread.context); + copy->thread.loop = g_main_loop_ref (impl->thread.loop); + + return GST_RTSP_THREAD (copy); +} + +static void +gst_rtsp_thread_init (GstRTSPThreadImpl * impl) +{ + gst_mini_object_init (GST_MINI_OBJECT_CAST (impl), 0, + GST_TYPE_RTSP_THREAD, + (GstMiniObjectCopyFunction) _gst_rtsp_thread_copy, NULL, + (GstMiniObjectFreeFunction) _gst_rtsp_thread_free); + + g_atomic_int_set (&impl->reused, 1); +} + +/** + * gst_rtsp_thread_new: + * @type: the thread type + * + * Create a new thread object that can run a mainloop. + * + * Returns: (transfer full): a #GstRTSPThread. + */ +GstRTSPThread * +gst_rtsp_thread_new (GstRTSPThreadType type) +{ + GstRTSPThreadImpl *impl; + + impl = g_slice_new0 (GstRTSPThreadImpl); + + gst_rtsp_thread_init (impl); + impl->thread.type = type; + impl->thread.context = g_main_context_new (); + impl->thread.loop = g_main_loop_new (impl->thread.context, TRUE); + + return GST_RTSP_THREAD (impl); +} + +/** + * gst_rtsp_thread_reuse: + * @thread: (transfer none): a #GstRTSPThread + * + * Reuse the mainloop of @thread + * + * Returns: %TRUE if the mainloop could be reused + */ +gboolean +gst_rtsp_thread_reuse (GstRTSPThread * thread) +{ + GstRTSPThreadImpl *impl = (GstRTSPThreadImpl *) thread; + gboolean res; + + g_return_val_if_fail (GST_IS_RTSP_THREAD (thread), FALSE); + + GST_DEBUG ("reuse thread %p", thread); + + res = g_atomic_int_add (&impl->reused, 1) > 0; + if (res) + gst_rtsp_thread_ref (thread); + + return res; +} + +static gboolean +do_quit (GstRTSPThread * thread) +{ + GST_DEBUG ("stop mainloop of thread %p", thread); + g_main_loop_quit (thread->loop); + return FALSE; +} + +/** + * gst_rtsp_thread_stop: + * @thread: (transfer full): a #GstRTSPThread + * + * Stop and unref @thread. When no threads are using the mainloop, the thread + * will be stopped and the final ref to @thread will be released. + */ +void +gst_rtsp_thread_stop (GstRTSPThread * thread) +{ + GstRTSPThreadImpl *impl = (GstRTSPThreadImpl *) thread; + + g_return_if_fail (GST_IS_RTSP_THREAD (thread)); + + GST_DEBUG ("stop thread %p", thread); + + if (g_atomic_int_dec_and_test (&impl->reused)) { + GST_DEBUG ("add idle source to quit mainloop of thread %p", thread); + impl->source = g_idle_source_new (); + g_source_set_callback (impl->source, (GSourceFunc) do_quit, + thread, (GDestroyNotify) gst_rtsp_thread_unref); + g_source_attach (impl->source, thread->context); + } else + gst_rtsp_thread_unref (thread); +} + +#define GST_RTSP_THREAD_POOL_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_THREAD_POOL, GstRTSPThreadPoolPrivate)) + +struct _GstRTSPThreadPoolPrivate +{ + GMutex lock; + + gint max_threads; + /* currently used mainloops */ + GQueue threads; +}; + +#define DEFAULT_MAX_THREADS 1 + +enum +{ + PROP_0, + PROP_MAX_THREADS, + PROP_LAST +}; + +GST_DEBUG_CATEGORY_STATIC (rtsp_thread_pool_debug); +#define GST_CAT_DEFAULT rtsp_thread_pool_debug + +static GQuark thread_pool; + +static void gst_rtsp_thread_pool_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec); +static void gst_rtsp_thread_pool_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec); +static void gst_rtsp_thread_pool_finalize (GObject * obj); + +static gpointer do_loop (GstRTSPThread * thread); +static GstRTSPThread *default_get_thread (GstRTSPThreadPool * pool, + GstRTSPThreadType type, GstRTSPContext * ctx); + +G_DEFINE_TYPE (GstRTSPThreadPool, gst_rtsp_thread_pool, G_TYPE_OBJECT); + +static void +gst_rtsp_thread_pool_class_init (GstRTSPThreadPoolClass * klass) +{ + GObjectClass *gobject_class; + + g_type_class_add_private (klass, sizeof (GstRTSPThreadPoolPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->get_property = gst_rtsp_thread_pool_get_property; + gobject_class->set_property = gst_rtsp_thread_pool_set_property; + gobject_class->finalize = gst_rtsp_thread_pool_finalize; + + /** + * GstRTSPThreadPool::max-threads: + * + * The maximum amount of threads to use for client connections. A value of + * 0 means to use only the mainloop, -1 means an unlimited amount of + * threads. + */ + g_object_class_install_property (gobject_class, PROP_MAX_THREADS, + g_param_spec_int ("max-threads", "Max Threads", + "The maximum amount of threads to use for client connections " + "(0 = only mainloop, -1 = unlimited)", -1, G_MAXINT, + DEFAULT_MAX_THREADS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + klass->get_thread = default_get_thread; + + GST_DEBUG_CATEGORY_INIT (rtsp_thread_pool_debug, "rtspthreadpool", 0, + "GstRTSPThreadPool"); + + thread_pool = g_quark_from_string ("gst.rtsp.thread.pool"); +} + +static void +gst_rtsp_thread_pool_init (GstRTSPThreadPool * pool) +{ + GstRTSPThreadPoolPrivate *priv; + + pool->priv = priv = GST_RTSP_THREAD_POOL_GET_PRIVATE (pool); + + g_mutex_init (&priv->lock); + priv->max_threads = DEFAULT_MAX_THREADS; + g_queue_init (&priv->threads); +} + +static void +gst_rtsp_thread_pool_finalize (GObject * obj) +{ + GstRTSPThreadPool *pool = GST_RTSP_THREAD_POOL (obj); + GstRTSPThreadPoolPrivate *priv = pool->priv; + + GST_INFO ("finalize pool %p", pool); + + g_queue_clear (&priv->threads); + g_mutex_clear (&priv->lock); + + G_OBJECT_CLASS (gst_rtsp_thread_pool_parent_class)->finalize (obj); +} + +static void +gst_rtsp_thread_pool_get_property (GObject * object, guint propid, + GValue * value, GParamSpec * pspec) +{ + GstRTSPThreadPool *pool = GST_RTSP_THREAD_POOL (object); + + switch (propid) { + case PROP_MAX_THREADS: + g_value_set_int (value, gst_rtsp_thread_pool_get_max_threads (pool)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static void +gst_rtsp_thread_pool_set_property (GObject * object, guint propid, + const GValue * value, GParamSpec * pspec) +{ + GstRTSPThreadPool *pool = GST_RTSP_THREAD_POOL (object); + + switch (propid) { + case PROP_MAX_THREADS: + gst_rtsp_thread_pool_set_max_threads (pool, g_value_get_int (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); + } +} + +static gpointer +do_loop (GstRTSPThread * thread) +{ + GstRTSPThreadPoolPrivate *priv; + GstRTSPThreadPoolClass *klass; + GstRTSPThreadPool *pool; + + pool = gst_mini_object_get_qdata (GST_MINI_OBJECT (thread), thread_pool); + priv = pool->priv; + + klass = GST_RTSP_THREAD_POOL_GET_CLASS (pool); + + if (klass->thread_enter) + klass->thread_enter (pool, thread); + + GST_INFO ("enter mainloop of thread %p", thread); + g_main_loop_run (thread->loop); + GST_INFO ("exit mainloop of thread %p", thread); + + if (klass->thread_leave) + klass->thread_leave (pool, thread); + + g_mutex_lock (&priv->lock); + g_queue_remove (&priv->threads, thread); + g_mutex_unlock (&priv->lock); + + gst_rtsp_thread_unref (thread); + + return NULL; +} + +/** + * gst_rtsp_thread_pool_new: + * + * Create a new #GstRTSPThreadPool instance. + * + * Returns: (transfer full): a new #GstRTSPThreadPool + */ +GstRTSPThreadPool * +gst_rtsp_thread_pool_new (void) +{ + GstRTSPThreadPool *result; + + result = g_object_new (GST_TYPE_RTSP_THREAD_POOL, NULL); + + return result; +} + +/** + * gst_rtsp_thread_pool_set_max_threads: + * @pool: a #GstRTSPThreadPool + * @max_threads: maximum threads + * + * Set the maximum threads used by the pool to handle client requests. + * A value of 0 will use the pool mainloop, a value of -1 will use an + * unlimited number of threads. + */ +void +gst_rtsp_thread_pool_set_max_threads (GstRTSPThreadPool * pool, + gint max_threads) +{ + GstRTSPThreadPoolPrivate *priv; + + g_return_if_fail (GST_IS_RTSP_THREAD_POOL (pool)); + + priv = pool->priv; + + g_mutex_lock (&priv->lock); + priv->max_threads = max_threads; + g_mutex_unlock (&priv->lock); +} + +/** + * gst_rtsp_thread_pool_get_max_threads: + * @pool: a #GstRTSPThreadPool + * + * Get the maximum number of threads used for client connections. + * See gst_rtsp_thread_pool_set_max_threads(). + * + * Returns: the maximum number of threads. + */ +gint +gst_rtsp_thread_pool_get_max_threads (GstRTSPThreadPool * pool) +{ + GstRTSPThreadPoolPrivate *priv; + gint res; + + g_return_val_if_fail (GST_IS_RTSP_THREAD_POOL (pool), -1); + + priv = pool->priv; + + g_mutex_lock (&priv->lock); + res = priv->max_threads; + g_mutex_unlock (&priv->lock); + + return res; +} + +static GstRTSPThread * +make_thread (GstRTSPThreadPool * pool, GstRTSPThreadType type, + GstRTSPContext * ctx) +{ + GstRTSPThreadPoolClass *klass; + GstRTSPThread *thread; + + klass = GST_RTSP_THREAD_POOL_GET_CLASS (pool); + + thread = gst_rtsp_thread_new (type); + gst_mini_object_set_qdata (GST_MINI_OBJECT (thread), thread_pool, + g_object_ref (pool), g_object_unref); + + GST_DEBUG_OBJECT (pool, "new thread %p", thread); + + if (klass->configure_thread) + klass->configure_thread (pool, thread, ctx); + + return thread; +} + +static GstRTSPThread * +default_get_thread (GstRTSPThreadPool * pool, + GstRTSPThreadType type, GstRTSPContext * ctx) +{ + GstRTSPThreadPoolPrivate *priv = pool->priv; + GstRTSPThreadPoolClass *klass; + GstRTSPThread *thread; + GError *error = NULL; + + klass = GST_RTSP_THREAD_POOL_GET_CLASS (pool); + + switch (type) { + case GST_RTSP_THREAD_TYPE_CLIENT: + if (priv->max_threads == 0) { + /* no threads allowed */ + GST_DEBUG_OBJECT (pool, "no client threads allowed"); + thread = NULL; + } else { + g_mutex_lock (&priv->lock); + retry: + if (priv->max_threads > 0 && + g_queue_get_length (&priv->threads) >= priv->max_threads) { + /* max threads reached, recycle from queue */ + thread = g_queue_pop_head (&priv->threads); + GST_DEBUG_OBJECT (pool, "recycle client thread %p", thread); + if (!gst_rtsp_thread_reuse (thread)) { + GST_DEBUG_OBJECT (pool, "thread %p stopping, retry", thread); + /* this can happen if we just decremented the reuse counter of the + * thread and signaled the mainloop that it should stop. We leave + * the thread out of the queue now, there is no point to add it + * again, it will be removed from the mainloop otherwise after it + * stops. */ + goto retry; + } + } else { + /* make more threads */ + GST_DEBUG_OBJECT (pool, "make new client thread"); + thread = make_thread (pool, type, ctx); + + if (!g_thread_pool_push (klass->pool, gst_rtsp_thread_ref (thread), + &error)) + goto thread_error; + } + g_queue_push_tail (&priv->threads, thread); + g_mutex_unlock (&priv->lock); + } + break; + case GST_RTSP_THREAD_TYPE_MEDIA: + GST_DEBUG_OBJECT (pool, "make new media thread"); + thread = make_thread (pool, type, ctx); + + if (!g_thread_pool_push (klass->pool, gst_rtsp_thread_ref (thread), + &error)) + goto thread_error; + break; + default: + thread = NULL; + break; + } + return thread; + + /* ERRORS */ +thread_error: + { + GST_ERROR_OBJECT (pool, "failed to push thread %s", error->message); + gst_rtsp_thread_unref (thread); + /* drop also the ref dedicated for the pool */ + gst_rtsp_thread_unref (thread); + g_clear_error (&error); + return NULL; + } +} + +/** + * gst_rtsp_thread_pool_get_thread: + * @pool: a #GstRTSPThreadPool + * @type: the #GstRTSPThreadType + * @ctx: (transfer none): a #GstRTSPContext + * + * Get a new #GstRTSPThread for @type and @ctx. + * + * Returns: (transfer full): a new #GstRTSPThread, gst_rtsp_thread_stop() after usage + */ +GstRTSPThread * +gst_rtsp_thread_pool_get_thread (GstRTSPThreadPool * pool, + GstRTSPThreadType type, GstRTSPContext * ctx) +{ + GstRTSPThreadPoolClass *klass; + GstRTSPThread *result = NULL; + + g_return_val_if_fail (GST_IS_RTSP_THREAD_POOL (pool), NULL); + + klass = GST_RTSP_THREAD_POOL_GET_CLASS (pool); + + /* We want to be thread safe as there might be 2 threads wanting to get new + * #GstRTSPThread at the same time + */ + if (G_UNLIKELY (!g_atomic_pointer_get (&klass->pool))) { + GThreadPool *t_pool; + t_pool = g_thread_pool_new ((GFunc) do_loop, klass, -1, FALSE, NULL); + if (!g_atomic_pointer_compare_and_exchange (&klass->pool, NULL, t_pool)) + g_thread_pool_free (t_pool, FALSE, TRUE); + } + + if (klass->get_thread) + result = klass->get_thread (pool, type, ctx); + + return result; +} + +/** + * gst_rtsp_thread_pool_cleanup: + * + * Wait for all tasks to be stopped and free all allocated resources. This is + * mainly used in test suites to ensure proper cleanup of internal data + * structures. + */ +void +gst_rtsp_thread_pool_cleanup (void) +{ + GstRTSPThreadPoolClass *klass; + + klass = + GST_RTSP_THREAD_POOL_CLASS (g_type_class_peek + (gst_rtsp_thread_pool_get_type ())); + if (klass->pool != NULL) { + g_thread_pool_free (klass->pool, FALSE, TRUE); + klass->pool = NULL; + } +} diff --git a/gst/rtsp-server/rtsp-thread-pool.h b/gst/rtsp-server/rtsp-thread-pool.h new file mode 100644 index 0000000..e360034 --- /dev/null +++ b/gst/rtsp-server/rtsp-thread-pool.h @@ -0,0 +1,179 @@ +/* GStreamer + * Copyright (C) 2010 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#ifndef __GST_RTSP_THREAD_POOL_H__ +#define __GST_RTSP_THREAD_POOL_H__ + +typedef struct _GstRTSPThread GstRTSPThread; +typedef struct _GstRTSPThreadPool GstRTSPThreadPool; +typedef struct _GstRTSPThreadPoolClass GstRTSPThreadPoolClass; +typedef struct _GstRTSPThreadPoolPrivate GstRTSPThreadPoolPrivate; + +#include "rtsp-client.h" + +G_BEGIN_DECLS + +#define GST_TYPE_RTSP_THREAD_POOL (gst_rtsp_thread_pool_get_type ()) +#define GST_IS_RTSP_THREAD_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_THREAD_POOL)) +#define GST_IS_RTSP_THREAD_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_THREAD_POOL)) +#define GST_RTSP_THREAD_POOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_THREAD_POOL, GstRTSPThreadPoolClass)) +#define GST_RTSP_THREAD_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_THREAD_POOL, GstRTSPThreadPool)) +#define GST_RTSP_THREAD_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_THREAD_POOL, GstRTSPThreadPoolClass)) +#define GST_RTSP_THREAD_POOL_CAST(obj) ((GstRTSPThreadPool*)(obj)) +#define GST_RTSP_THREAD_POOL_CLASS_CAST(klass) ((GstRTSPThreadPoolClass*)(klass)) + +GType gst_rtsp_thread_get_type (void); + +#define GST_TYPE_RTSP_THREAD (gst_rtsp_thread_get_type ()) +#define GST_IS_RTSP_THREAD(obj) (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_RTSP_THREAD)) +#define GST_RTSP_THREAD_CAST(obj) ((GstRTSPThread*)(obj)) +#define GST_RTSP_THREAD(obj) (GST_RTSP_THREAD_CAST(obj)) + +/** + * GstRTSPThreadType: + * @GST_RTSP_THREAD_TYPE_CLIENT: a thread to handle the client communication + * @GST_RTSP_THREAD_TYPE_MEDIA: a thread to handle media + * + * Different thread types + */ +typedef enum +{ + GST_RTSP_THREAD_TYPE_CLIENT, + GST_RTSP_THREAD_TYPE_MEDIA +} GstRTSPThreadType; + +/** + * GstRTSPThread: + * @mini_object: parent #GstMiniObject + * @type: the thread type + * @context: a #GMainContext + * @loop: a #GMainLoop + * + * Structure holding info about a mainloop running in a thread + */ +struct _GstRTSPThread { + GstMiniObject mini_object; + + GstRTSPThreadType type; + GMainContext *context; + GMainLoop *loop; +}; + +GstRTSPThread * gst_rtsp_thread_new (GstRTSPThreadType type); + +gboolean gst_rtsp_thread_reuse (GstRTSPThread * thread); +void gst_rtsp_thread_stop (GstRTSPThread * thread); + +/** + * gst_rtsp_thread_ref: + * @thread: The thread to refcount + * + * Increase the refcount of this thread. + * + * Returns: (transfer full): @thread (for convenience when doing assignments) + */ +#ifdef _FOOL_GTK_DOC_ +G_INLINE_FUNC GstRTSPThread * gst_rtsp_thread_ref (GstRTSPThread * thread); +#endif + +static inline GstRTSPThread * +gst_rtsp_thread_ref (GstRTSPThread * thread) +{ + return (GstRTSPThread *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (thread)); +} + +/** + * gst_rtsp_thread_unref: + * @thread: (transfer full): the thread to refcount + * + * Decrease the refcount of an thread, freeing it if the refcount reaches 0. + */ +#ifdef _FOOL_GTK_DOC_ +G_INLINE_FUNC void gst_rtsp_thread_unref (GstRTSPPermissions * thread); +#endif + + +static inline void +gst_rtsp_thread_unref (GstRTSPThread * thread) +{ + gst_mini_object_unref (GST_MINI_OBJECT_CAST (thread)); +} + +/** + * GstRTSPThreadPool: + * + * The thread pool structure. + */ +struct _GstRTSPThreadPool { + GObject parent; + + /*< private >*/ + GstRTSPThreadPoolPrivate *priv; + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstRTSPThreadPoolClass: + * @pool: a #GThreadPool used internally + * @get_thread: this function should make or reuse an existing thread that runs + * a mainloop. + * @configure_thread: configure a thread object. this vmethod is called when + * a new thread has been created and should be configured. + * @thread_enter: called from the thread when it is entered + * @thread_leave: called from the thread when it is left + * + * Class for managing threads. + */ +struct _GstRTSPThreadPoolClass { + GObjectClass parent_class; + + GThreadPool *pool; + + GstRTSPThread * (*get_thread) (GstRTSPThreadPool *pool, + GstRTSPThreadType type, + GstRTSPContext *ctx); + void (*configure_thread) (GstRTSPThreadPool *pool, + GstRTSPThread * thread, + GstRTSPContext *ctx); + + void (*thread_enter) (GstRTSPThreadPool *pool, + GstRTSPThread *thread); + void (*thread_leave) (GstRTSPThreadPool *pool, + GstRTSPThread *thread); + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +GType gst_rtsp_thread_pool_get_type (void); + +GstRTSPThreadPool * gst_rtsp_thread_pool_new (void); + +void gst_rtsp_thread_pool_set_max_threads (GstRTSPThreadPool * pool, gint max_threads); +gint gst_rtsp_thread_pool_get_max_threads (GstRTSPThreadPool * pool); + +GstRTSPThread * gst_rtsp_thread_pool_get_thread (GstRTSPThreadPool *pool, + GstRTSPThreadType type, + GstRTSPContext *ctx); +void gst_rtsp_thread_pool_cleanup (void); +G_END_DECLS + +#endif /* __GST_RTSP_THREAD_POOL_H__ */ diff --git a/gst/rtsp-server/rtsp-token.c b/gst/rtsp-server/rtsp-token.c new file mode 100644 index 0000000..69250f9 --- /dev/null +++ b/gst/rtsp-server/rtsp-token.c @@ -0,0 +1,251 @@ +/* GStreamer + * Copyright (C) 2010 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:rtsp-token + * @short_description: Roles and permissions for a client + * @see_also: #GstRTSPClient, #GstRTSPPermissions, #GstRTSPAuth + * + * A #GstRTSPToken contains the permissions and roles of the user + * performing the current request. A token is usually created when a user is + * authenticated by the #GstRTSPAuth object and is then placed as the current + * token for the current request. + * + * #GstRTSPAuth can use the token and its contents to check authorization for + * various operations by comparing the token to the #GstRTSPPermissions of the + * object. + * + * The accepted values of the token are entirely defined by the #GstRTSPAuth + * object that implements the security policy. + * + * Last reviewed on 2013-07-15 (1.0.0) + */ + +#include + +#include "rtsp-token.h" + +typedef struct _GstRTSPTokenImpl +{ + GstRTSPToken token; + + GstStructure *structure; +} GstRTSPTokenImpl; + +#define GST_RTSP_TOKEN_STRUCTURE(t) (((GstRTSPTokenImpl *)(t))->structure) + +//GST_DEBUG_CATEGORY_STATIC (rtsp_token_debug); +//#define GST_CAT_DEFAULT rtsp_token_debug + +GST_DEFINE_MINI_OBJECT_TYPE (GstRTSPToken, gst_rtsp_token); + +static void gst_rtsp_token_init (GstRTSPTokenImpl * token, + GstStructure * structure); + +static void +_gst_rtsp_token_free (GstRTSPToken * token) +{ + GstRTSPTokenImpl *impl = (GstRTSPTokenImpl *) token; + + gst_structure_set_parent_refcount (impl->structure, NULL); + gst_structure_free (impl->structure); + + g_slice_free1 (sizeof (GstRTSPTokenImpl), token); +} + +static GstRTSPToken * +_gst_rtsp_token_copy (GstRTSPTokenImpl * token) +{ + GstRTSPTokenImpl *copy; + GstStructure *structure; + + structure = gst_structure_copy (token->structure); + + copy = g_slice_new0 (GstRTSPTokenImpl); + gst_rtsp_token_init (copy, structure); + + return (GstRTSPToken *) copy; +} + +static void +gst_rtsp_token_init (GstRTSPTokenImpl * token, GstStructure * structure) +{ + gst_mini_object_init (GST_MINI_OBJECT_CAST (token), 0, + GST_TYPE_RTSP_TOKEN, + (GstMiniObjectCopyFunction) _gst_rtsp_token_copy, NULL, + (GstMiniObjectFreeFunction) _gst_rtsp_token_free); + + token->structure = structure; + gst_structure_set_parent_refcount (token->structure, + &token->token.mini_object.refcount); +} + +/** + * gst_rtsp_token_new_empty: + * + * Create a new empty Authorization token. + * + * Returns: (transfer full): a new empty authorization token. + */ +GstRTSPToken * +gst_rtsp_token_new_empty (void) +{ + GstRTSPTokenImpl *token; + GstStructure *s; + + s = gst_structure_new_empty ("GstRTSPToken"); + g_return_val_if_fail (s != NULL, NULL); + + token = g_slice_new0 (GstRTSPTokenImpl); + gst_rtsp_token_init (token, s); + + return (GstRTSPToken *) token; +} + +/** + * gst_rtsp_token_new: + * @firstfield: the first fieldname + * @...: additional arguments + * + * Create a new Authorization token with the given fieldnames and values. + * Arguments are given similar to gst_structure_new(). + * + * Returns: (transfer full): a new authorization token. + */ +GstRTSPToken * +gst_rtsp_token_new (const gchar * firstfield, ...) +{ + GstRTSPToken *result; + va_list var_args; + + va_start (var_args, firstfield); + result = gst_rtsp_token_new_valist (firstfield, var_args); + va_end (var_args); + + return result; +} + +/** + * gst_rtsp_token_new_valist: + * @firstfield: the first fieldname + * @var_args: additional arguments + * + * Create a new Authorization token with the given fieldnames and values. + * Arguments are given similar to gst_structure_new_valist(). + * + * Returns: (transfer full): a new authorization token. + */ +GstRTSPToken * +gst_rtsp_token_new_valist (const gchar * firstfield, va_list var_args) +{ + GstRTSPToken *token; + GstStructure *s; + + g_return_val_if_fail (firstfield != NULL, NULL); + + token = gst_rtsp_token_new_empty (); + s = GST_RTSP_TOKEN_STRUCTURE (token); + gst_structure_set_valist (s, firstfield, var_args); + + return token; +} + + +/** + * gst_rtsp_token_get_structure: + * @token: The #GstRTSPToken. + * + * Access the structure of the token. + * + * Returns: (transfer none): The structure of the token. The structure is still + * owned by the token, which means that you should not free it and that the + * pointer becomes invalid when you free the token. + * + * MT safe. + */ +const GstStructure * +gst_rtsp_token_get_structure (GstRTSPToken * token) +{ + g_return_val_if_fail (GST_IS_RTSP_TOKEN (token), NULL); + + return GST_RTSP_TOKEN_STRUCTURE (token); +} + +/** + * gst_rtsp_token_writable_structure: + * @token: The #GstRTSPToken. + * + * Get a writable version of the structure. + * + * Returns: (transfer none): The structure of the token. The structure is still + * owned by the token, which means that you should not free it and that the + * pointer becomes invalid when you free the token. This function checks if + * @token is writable and will never return %NULL. + * + * MT safe. + */ +GstStructure * +gst_rtsp_token_writable_structure (GstRTSPToken * token) +{ + g_return_val_if_fail (GST_IS_RTSP_TOKEN (token), NULL); + g_return_val_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST + (token)), NULL); + + return GST_RTSP_TOKEN_STRUCTURE (token); +} + +/** + * gst_rtsp_token_get_string: + * @token: a #GstRTSPToken + * @field: a field name + * + * Get the string value of @field in @token. + * + * Returns: (transfer none) (nullable): the string value of @field in + * @token or %NULL when @field is not defined in @token. The string + * becomes invalid when you free @token. + */ +const gchar * +gst_rtsp_token_get_string (GstRTSPToken * token, const gchar * field) +{ + return gst_structure_get_string (GST_RTSP_TOKEN_STRUCTURE (token), field); +} + +/** + * gst_rtsp_token_is_allowed: + * @token: a #GstRTSPToken + * @field: a field name + * + * Check if @token has a boolean @field and if it is set to %TRUE. + * + * Returns: %TRUE if @token has a boolean field named @field set to %TRUE. + */ +gboolean +gst_rtsp_token_is_allowed (GstRTSPToken * token, const gchar * field) +{ + gboolean result; + + g_return_val_if_fail (GST_IS_RTSP_TOKEN (token), FALSE); + g_return_val_if_fail (field != NULL, FALSE); + + if (!gst_structure_get_boolean (GST_RTSP_TOKEN_STRUCTURE (token), field, + &result)) + result = FALSE; + + return result; +} diff --git a/gst/rtsp-server/rtsp-token.h b/gst/rtsp-server/rtsp-token.h new file mode 100644 index 0000000..265d8d3 --- /dev/null +++ b/gst/rtsp-server/rtsp-token.h @@ -0,0 +1,97 @@ +/* GStreamer + * Copyright (C) 2010 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#ifndef __GST_RTSP_TOKEN_H__ +#define __GST_RTSP_TOKEN_H__ + +typedef struct _GstRTSPToken GstRTSPToken; + +#include "rtsp-auth.h" + +G_BEGIN_DECLS + +GType gst_rtsp_token_get_type(void); + +#define GST_TYPE_RTSP_TOKEN (gst_rtsp_token_get_type()) +#define GST_IS_RTSP_TOKEN(obj) (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_RTSP_TOKEN)) +#define GST_RTSP_TOKEN_CAST(obj) ((GstRTSPToken*)(obj)) +#define GST_RTSP_TOKEN(obj) (GST_RTSP_TOKEN_CAST(obj)) + +/** + * GstRTSPToken: + * + * An opaque object used for checking authorisations. + * It is generated after successful authentication. + */ +struct _GstRTSPToken { + GstMiniObject mini_object; +}; + +/* refcounting */ +/** + * gst_rtsp_token_ref: + * @token: The token to refcount + * + * Increase the refcount of this token. + * + * Returns: (transfer full): @token (for convenience when doing assignments) + */ +#ifdef _FOOL_GTK_DOC_ +G_INLINE_FUNC GstRTSPToken * gst_rtsp_token_ref (GstRTSPToken * token); +#endif + +static inline GstRTSPToken * +gst_rtsp_token_ref (GstRTSPToken * token) +{ + return (GstRTSPToken *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (token)); +} + +/** + * gst_rtsp_token_unref: + * @token: (transfer full): the token to refcount + * + * Decrease the refcount of an token, freeing it if the refcount reaches 0. + */ +#ifdef _FOOL_GTK_DOC_ +G_INLINE_FUNC void gst_rtsp_token_unref (GstRTSPToken * token); +#endif + +static inline void +gst_rtsp_token_unref (GstRTSPToken * token) +{ + gst_mini_object_unref (GST_MINI_OBJECT_CAST (token)); +} + + +GstRTSPToken * gst_rtsp_token_new_empty (void); +GstRTSPToken * gst_rtsp_token_new (const gchar * firstfield, ...); +GstRTSPToken * gst_rtsp_token_new_valist (const gchar * firstfield, va_list var_args); + +const GstStructure * gst_rtsp_token_get_structure (GstRTSPToken *token); +GstStructure * gst_rtsp_token_writable_structure (GstRTSPToken *token); + +const gchar * gst_rtsp_token_get_string (GstRTSPToken *token, + const gchar *field); +gboolean gst_rtsp_token_is_allowed (GstRTSPToken *token, + const gchar *field); +G_END_DECLS + +#endif /* __GST_RTSP_TOKEN_H__ */ diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..377bb86 --- /dev/null +++ b/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-11-20.07; # UTC + +# 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. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; 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 + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $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 "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # 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 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$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 $cpprog $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 $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 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. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/ltmain.sh b/ltmain.sh new file mode 100644 index 0000000..3fd54df --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,9661 @@ + +# libtool (GNU libtool) 2.4.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.10 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.2 Debian-2.4.2-1.10" +TIMESTAMP="" +package_revision=1.3337 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/m4/libtool.m4 b/m4/libtool.m4 new file mode 100644 index 0000000..d7c043f --- /dev/null +++ b/m4/libtool.m4 @@ -0,0 +1,7997 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file 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. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([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])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +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|LT_MULTI_MODULE)$])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([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_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([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_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 +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# 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 + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +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' +]) + +# _LT_PROG_LTMAIN +# --------------- +# 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. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# 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. + + +# _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 +])])]) + +# 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_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# 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([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _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], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +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 +]) + + +# 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], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [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 +]) + + +# _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 "$][$1" | $SED "$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 "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_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_defun([_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_defun([_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_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_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_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _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_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($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 +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + 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 + ;; + 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) + + _LT_PROG_REPLACE_SHELLFNS + + 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 + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_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)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +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([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +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_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_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${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed '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${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# 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. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_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 '$LINENO' "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-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + 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_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[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 + ;; +*-*solaris*) + # 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 + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +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_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_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]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $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 other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_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 + ;; + + 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* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # 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 + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$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` + fi + ;; + 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 +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_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 $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_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* | cegcc*) + 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="-ldld"], + [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="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + 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" + wl=$lt_prog_compiler_wl 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_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_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 +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $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:$LINENO: \$? = $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 + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $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 .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_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 +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_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 +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_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_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_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]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_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" + old_striplib="$STRIP -S" + 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]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +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" +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 # correct to gnu/linux during the next big refactor + 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' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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 + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + 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* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + 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 + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # 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 + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # 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}${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`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + 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 glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | 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' + ;; + +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 # correct to gnu/linux during the next big refactor + 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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + 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.3*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + +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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_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 shlibpath 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([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_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]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_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 + +*** 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 + +_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 with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_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 + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_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])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 variants of GNU ld 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 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + 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|DragonFly)/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 + ;; + +haiku*) + 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +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 glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-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=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +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 + +_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"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-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_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_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]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])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]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # 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(void); +void nm_test_func(void){} +#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 +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#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 + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_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_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + 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 -rf 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 + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +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]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_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 + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # 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). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_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_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_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]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # 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 + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_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_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_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_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_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # 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. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[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 + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_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~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** 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. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_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 + + # 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]].*|aix[[5-9]]*) + 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 + + # 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_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-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 + : + else + # We have old collect2 + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + 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 + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # 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. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_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_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=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_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${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_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_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_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_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' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_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} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + 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_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_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]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_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_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$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_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_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([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_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([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_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_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_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_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([], [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]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _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_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +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_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## 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... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # 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 + ;; + + aix[[4-9]]*) + 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]) + + 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]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _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_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + 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 + $as_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 + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + 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_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_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_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_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_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 -v "^Configured with:" | $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_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + 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]].*|aix[[5-9]]*) + 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_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + 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 + : + else + # We have old collect2 + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + 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 + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_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_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_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_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_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_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_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + 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_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_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; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_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_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_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 -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_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::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | 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_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_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 ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_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=`func_echo_all "$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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_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 -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_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} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_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_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -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 -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_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 -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_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... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + 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 +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([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. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +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], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer 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 +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +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. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -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 + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} 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_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_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_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$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 + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_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]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _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_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + 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 + ;; + aix[[4-9]]*) + 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]) + + 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]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_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... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + 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 + ;; + aix[[4-9]]*) + 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]) + + 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]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_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... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _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_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## 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... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## 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... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _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_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +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 +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_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. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +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. # +############################################################ + +m4_defun([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 +IFS=$as_save_IFS +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 && continue + 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 + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 new file mode 100644 index 0000000..5d9acd8 --- /dev/null +++ b/m4/ltoptions.m4 @@ -0,0 +1,384 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file 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. + +# serial 7 ltoptions.m4 + +# 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(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, 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], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [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([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [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_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT 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], + [AS_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) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT 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], + [AS_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 + 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([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT 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], + [AS_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 ;; + *) + 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=]_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([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[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_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [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_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [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_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 new file mode 100644 index 0000000..9000a05 --- /dev/null +++ b/m4/ltsugar.m4 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file 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. + +# serial 6 ltsugar.m4 + +# 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. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# 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. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# 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_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# 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], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 new file mode 100644 index 0000000..07a8602 --- /dev/null +++ b/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file 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. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 new file mode 100644 index 0000000..c573da9 --- /dev/null +++ b/m4/lt~obsolete.m4 @@ -0,0 +1,98 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file 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. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/missing b/missing new file mode 100755 index 0000000..db98974 --- /dev/null +++ b/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2013-10-28.13; # UTC + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 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, 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, see . + +# 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. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/packaging/gst-rtsp-server.spec b/packaging/gst-rtsp-server.spec new file mode 100755 index 0000000..c457923 --- /dev/null +++ b/packaging/gst-rtsp-server.spec @@ -0,0 +1,74 @@ +Name: gst-rtsp-server +Summary: Multimedia Framework Library +Version: 1.4.1 +Release: 0 +Group: System/Libraries +License: LGPLv2+ +Source0: %{name}-%{version}.tar.gz +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig +BuildRequires: pkgconfig(gstreamer-1.0) +BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) + +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description + +%package devel +Summary: Multimedia Framework RTSP server library (DEV) +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel + +%package factory +Summary: Multimedia Framework RTSP server Library (Factory) +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description factory + +%prep +%setup -q + +%build + +./autogen.sh + +CFLAGS+=" -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" "; export CFLAGS +LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--hash-style=both -Wl,--as-needed"; export LDFLAGS + +# always enable sdk build. This option should go away +./configure --enable-sdk --prefix=%{_prefix} --disable-static + +# Call make instruction with smp support +#make %{?jobs:-j%jobs} +make + +%install +rm -rf %{buildroot} +%make_install +mkdir -p %{buildroot}/%{_datadir}/license +cp -rf %{_builddir}/%{name}-%{version}/LICENSE.LGPLv2.1 %{buildroot}%{_datadir}/license/%{name} + +%clean +rm -rf %{buildroot} + +%post +/sbin/ldconfig + +%postun +/sbin/ldconfig + +%files +%manifest gst-rtsp-server.manifest +%defattr(-,root,root,-) +%{_datadir}/license/%{name} +%{_libdir}/*.so.* + +%files devel +%defattr(-,root,root,-) +%{_libdir}/*.so +%{_includedir}/gstreamer-1.0/gst/rtsp-server/rtsp-*.h +%{_includedir}/gstreamer-1.0/gst/rtsp-server/gstwfd*.h +%{_libdir}/pkgconfig/* diff --git a/packaging/orig/gst-rtsp.spec b/packaging/orig/gst-rtsp.spec new file mode 100644 index 0000000..8033373 --- /dev/null +++ b/packaging/orig/gst-rtsp.spec @@ -0,0 +1,54 @@ +%define gst_majorminor 1.0 + +Name: gstreamer-rtsp-server +Version: 1.4.1 +Release: 1%{?dist} +Summary: GStreamer based RTSP server +Vendor: Collabora Multimedia +Group: Applications/Multimedia +License: LGPLv2+ +Source0: gst-rtsp-%{version}.tar.bz2 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: gstreamer-devel >= 0.10.11 + + +%description +This is a RTSP server using the GStreamer framework. + + +%prep +%setup -q -n gst-rtsp-%{version} + + +%build +%configure + +make + +%install +%makeinstall + +# Clean out files that should not be part of the rpm. +rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-%{majorminor}/*.a +rm -f $RPM_BUILD_ROOT%{_libdir}/*.a +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la + +%clean +rm -rf $RPM_BUILD_ROOT + + +%post -p /sbin/ldconfig + + +%postun -p /sbin/ldconfig + + +%files +%defattr(-,root,root,-) +%doc AUTHORS COPYING README INSTALL docs/design/gst-rtp-server-design +%{_bindir}/gst-rtsp-server + +%changelog +* Thu Oct 9 2008 Christian Schaller +- First spec file diff --git a/packaging/orig/gst-rtsp.spec.in b/packaging/orig/gst-rtsp.spec.in new file mode 100644 index 0000000..12224f8 --- /dev/null +++ b/packaging/orig/gst-rtsp.spec.in @@ -0,0 +1,54 @@ +%define gst_majorminor @GST_API_VERSION@ + +Name: gstreamer-rtsp-server +Version: @VERSION@ +Release: 1%{?dist} +Summary: GStreamer based RTSP server +Vendor: Collabora Multimedia +Group: Applications/Multimedia +License: LGPLv2+ +Source0: gst-rtsp-%{version}.tar.bz2 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: gstreamer-devel >= 0.10.11 + + +%description +This is a RTSP server using the GStreamer framework. + + +%prep +%setup -q -n gst-rtsp-%{version} + + +%build +%configure + +make + +%install +%makeinstall + +# Clean out files that should not be part of the rpm. +rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-%{majorminor}/*.a +rm -f $RPM_BUILD_ROOT%{_libdir}/*.a +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la + +%clean +rm -rf $RPM_BUILD_ROOT + + +%post -p /sbin/ldconfig + + +%postun -p /sbin/ldconfig + + +%files +%defattr(-,root,root,-) +%doc AUTHORS COPYING README INSTALL docs/design/gst-rtp-server-design +%{_bindir}/gst-rtsp-server + +%changelog +* Thu Oct 9 2008 Christian Schaller +- First spec file diff --git a/pkgconfig/Makefile.am b/pkgconfig/Makefile.am new file mode 100644 index 0000000..c45755e --- /dev/null +++ b/pkgconfig/Makefile.am @@ -0,0 +1,21 @@ +pcfiles = \ + gstreamer-rtsp-server-@GST_API_VERSION@.pc + +pcfiles_uninstalled = \ + gstreamer-rtsp-server-@GST_API_VERSION@-uninstalled.pc + +all-local: $(pcfiles) $(pcfiles_uninstalled) + +### how to generate pc files +%-@GST_API_VERSION@.pc: %.pc + cp $< $@ +%-@GST_API_VERSION@-uninstalled.pc: %-uninstalled.pc + cp $< $@ + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = $(pcfiles) + +EXTRA_DIST = \ + gstreamer-rtsp-server.pc.in \ + gstreamer-rtsp-server-uninstalled.pc.in +CLEANFILES = $(pcfiles) $(pcfiles_uninstalled) diff --git a/pkgconfig/Makefile.in b/pkgconfig/Makefile.in new file mode 100644 index 0000000..bafc540 --- /dev/null +++ b/pkgconfig/Makefile.in @@ -0,0 +1,637 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = pkgconfig +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/gstreamer-rtsp-server.pc.in \ + $(srcdir)/gstreamer-rtsp-server-uninstalled.pc.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-docbook.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-doc.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/introspection.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = gstreamer-rtsp-server.pc \ + gstreamer-rtsp-server-uninstalled.pc +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +DATA = $(pkgconfig_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAT_ENTRY_END = @CAT_ENTRY_END@ +CAT_ENTRY_START = @CAT_ENTRY_START@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPD_PLUGINS_DIR = @GSTPD_PLUGINS_DIR@ +GSTPG_PLUGINS_DIR = @GSTPG_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALL_CFLAGS = @GST_ALL_CFLAGS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_ALL_LIBS = @GST_ALL_LIBS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OBJ_CFLAGS = @GST_OBJ_CFLAGS@ +GST_OBJ_LIBS = @GST_OBJ_LIBS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PKG_CONFIG_PATH = @GST_PKG_CONFIG_PATH@ +GST_PLUGINS_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@ +GST_PLUGINS_BAD_DIR = @GST_PLUGINS_BAD_DIR@ +GST_PLUGINS_BAD_LIBS = @GST_PLUGINS_BAD_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@ +GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@ +GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ +HAVE_DVIPS = @HAVE_DVIPS@ +HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ +HAVE_JADETEX = @HAVE_JADETEX@ +HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ +HAVE_PNMTOPS = @HAVE_PNMTOPS@ +HAVE_PS2PDF = @HAVE_PS2PDF@ +HAVE_XMLLINT = @HAVE_XMLLINT@ +HAVE_XSLTPROC = @HAVE_XSLTPROC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCGROUP_CFLAGS = @LIBCGROUP_CFLAGS@ +LIBCGROUP_LIBS = @LIBCGROUP_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XML_CATALOG = @XML_CATALOG@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +pcfiles = \ + gstreamer-rtsp-server-@GST_API_VERSION@.pc + +pcfiles_uninstalled = \ + gstreamer-rtsp-server-@GST_API_VERSION@-uninstalled.pc + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = $(pcfiles) +EXTRA_DIST = \ + gstreamer-rtsp-server.pc.in \ + gstreamer-rtsp-server-uninstalled.pc.in + +CLEANFILES = $(pcfiles) $(pcfiles_uninstalled) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pkgconfig/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu pkgconfig/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +gstreamer-rtsp-server.pc: $(top_builddir)/config.status $(srcdir)/gstreamer-rtsp-server.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +gstreamer-rtsp-server-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/gstreamer-rtsp-server-uninstalled.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(DATA) all-local +installdirs: + for dir in "$(DESTDIR)$(pkgconfigdir)"; 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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgconfigDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am all-local check check-am clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-pkgconfigDATA + + +all-local: $(pcfiles) $(pcfiles_uninstalled) + +### how to generate pc files +%-@GST_API_VERSION@.pc: %.pc + cp $< $@ +%-@GST_API_VERSION@-uninstalled.pc: %-uninstalled.pc + cp $< $@ + +# 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: diff --git a/pkgconfig/gstreamer-rtsp-server-uninstalled.pc.in b/pkgconfig/gstreamer-rtsp-server-uninstalled.pc.in new file mode 100644 index 0000000..e453805 --- /dev/null +++ b/pkgconfig/gstreamer-rtsp-server-uninstalled.pc.in @@ -0,0 +1,12 @@ +# the standard variables don't make sense for an uninstalled copy +prefix= +exec_prefix= +libdir=${pcfiledir}/../gst/rtsp-server +includedir=${pcfiledir}/.. + +Name: gst-rtsp-server +Description: GStreamer based RTSP server +Version: @VERSION@ +Requires: gstreamer-@GST_API_VERSION@ gstreamer-plugins-base-@GST_API_VERSION@ +Libs: ${libdir}/libgstrtspserver-@GST_API_VERSION@.la +Cflags: -I${includedir} -I@srcdir@/.. diff --git a/pkgconfig/gstreamer-rtsp-server.pc.in b/pkgconfig/gstreamer-rtsp-server.pc.in new file mode 100644 index 0000000..3a1d820 --- /dev/null +++ b/pkgconfig/gstreamer-rtsp-server.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/gstreamer-@GST_API_VERSION@ + +Name: gst-rtsp-server +Description: GStreamer based RTSP server +Version: @VERSION@ +Requires: gstreamer-@GST_API_VERSION@ gstreamer-base-@GST_API_VERSION@ +Libs: -L${libdir} -lgstrtspserver-@GST_API_VERSION@ +Cflags: -I${includedir} diff --git a/test-driver b/test-driver new file mode 100755 index 0000000..d306056 --- /dev/null +++ b/test-driver @@ -0,0 +1,139 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2013-07-13.22; # UTC + +# Copyright (C) 2011-2013 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, see . + +# 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. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <$log_file 2>&1 +estatus=$? +if test $enable_hard_errors = no && test $estatus -eq 99; then + estatus=1 +fi + +case $estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# 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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..ca2ba66 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,19 @@ +noinst_PROGRAMS = test-cleanup test-reuse + +AM_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) +AM_LDFLAGS = \ + $(GST_LIBS) \ + $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la + +if BUILD_TESTS +SUBDIRS_CHECK = check +else +SUBDIRS_CHECK = +endif + +SUBDIRS = \ + $(SUBDIRS_CHECK) + +DIST_SUBDIRS = \ + check diff --git a/tests/Makefile.in b/tests/Makefile.in new file mode 100644 index 0000000..63678e5 --- /dev/null +++ b/tests/Makefile.in @@ -0,0 +1,840 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +noinst_PROGRAMS = test-cleanup$(EXEEXT) test-reuse$(EXEEXT) +subdir = tests +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-docbook.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-doc.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/introspection.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +test_cleanup_SOURCES = test-cleanup.c +test_cleanup_OBJECTS = test-cleanup.$(OBJEXT) +test_cleanup_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +test_reuse_SOURCES = test-reuse.c +test_reuse_OBJECTS = test-reuse.$(OBJEXT) +test_reuse_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = test-cleanup.c test-reuse.c +DIST_SOURCES = test-cleanup.c test-reuse.c +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAT_ENTRY_END = @CAT_ENTRY_END@ +CAT_ENTRY_START = @CAT_ENTRY_START@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPD_PLUGINS_DIR = @GSTPD_PLUGINS_DIR@ +GSTPG_PLUGINS_DIR = @GSTPG_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALL_CFLAGS = @GST_ALL_CFLAGS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_ALL_LIBS = @GST_ALL_LIBS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OBJ_CFLAGS = @GST_OBJ_CFLAGS@ +GST_OBJ_LIBS = @GST_OBJ_LIBS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PKG_CONFIG_PATH = @GST_PKG_CONFIG_PATH@ +GST_PLUGINS_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@ +GST_PLUGINS_BAD_DIR = @GST_PLUGINS_BAD_DIR@ +GST_PLUGINS_BAD_LIBS = @GST_PLUGINS_BAD_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@ +GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@ +GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ +HAVE_DVIPS = @HAVE_DVIPS@ +HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ +HAVE_JADETEX = @HAVE_JADETEX@ +HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ +HAVE_PNMTOPS = @HAVE_PNMTOPS@ +HAVE_PS2PDF = @HAVE_PS2PDF@ +HAVE_XMLLINT = @HAVE_XMLLINT@ +HAVE_XSLTPROC = @HAVE_XSLTPROC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCGROUP_CFLAGS = @LIBCGROUP_CFLAGS@ +LIBCGROUP_LIBS = @LIBCGROUP_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XML_CATALOG = @XML_CATALOG@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) +AM_LDFLAGS = \ + $(GST_LIBS) \ + $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la + +@BUILD_TESTS_FALSE@SUBDIRS_CHECK = +@BUILD_TESTS_TRUE@SUBDIRS_CHECK = check +SUBDIRS = \ + $(SUBDIRS_CHECK) + +DIST_SUBDIRS = \ + check + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +test-cleanup$(EXEEXT): $(test_cleanup_OBJECTS) $(test_cleanup_DEPENDENCIES) $(EXTRA_test_cleanup_DEPENDENCIES) + @rm -f test-cleanup$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_cleanup_OBJECTS) $(test_cleanup_LDADD) $(LIBS) + +test-reuse$(EXEEXT): $(test_reuse_OBJECTS) $(test_reuse_DEPENDENCIES) $(EXTRA_test_reuse_DEPENDENCIES) + @rm -f test-reuse$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_reuse_OBJECTS) $(test_reuse_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cleanup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-reuse.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + 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 || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(PROGRAMS) +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am 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-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-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: diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am new file mode 100644 index 0000000..82e6d42 --- /dev/null +++ b/tests/check/Makefile.am @@ -0,0 +1,62 @@ +include $(top_srcdir)/common/check.mak + +CHECK_REGISTRY = $(top_builddir)/tests/check/test-registry.reg +TEST_FILES_DIRECTORY = $(top_srcdir)/tests/files + +REGISTRY_ENVIRONMENT = \ + GST_REGISTRY_1_0=$(CHECK_REGISTRY) + +TESTS_ENVIRONMENT = \ + CK_DEFAULT_TIMEOUT=120 \ + GST_STATE_IGNORE_ELEMENTS="$(STATE_IGNORE_ELEMENTS)" \ + $(REGISTRY_ENVIRONMENT) \ + GST_PLUGIN_SYSTEM_PATH_1_0= \ + GST_PLUGIN_PATH_1_0=$(GST_PLUGINS_DIR):$(GSTPB_PLUGINS_DIR):$(GSTPG_PLUGINS_DIR):$(GSTPD_PLUGINS_DIR) \ + GST_PLUGIN_LOADING_WHITELIST="gstreamer:gst-plugins-base:gst-plugins-good:gst-plugins-bad" + + +# ths core dumps of some machines have PIDs appended +CLEANFILES = core.* test-registry.* + +clean-local: clean-local-check + +$(CHECK_REGISTRY): + $(TESTS_ENVIRONMENT) + +TESTS = $(check_PROGRAMS) + +check_PROGRAMS = \ + gst/rtspserver \ + gst/client \ + gst/mountpoints \ + gst/mediafactory \ + gst/media \ + gst/stream \ + gst/addresspool \ + gst/threadpool \ + gst/permissions \ + gst/token \ + gst/sessionmedia \ + gst/sessionpool + +# these tests don't even pass +noinst_PROGRAMS = + +AM_CFLAGS = -I$(top_srcdir)/gst/rtsp-server \ + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) \ + $(GIO_CFLAGS) \ + $(GST_CFLAGS) \ + $(GST_CHECK_CFLAGS) \ + -DGST_TEST_FILES_PATH="\"$(TEST_FILES_DIRECTORY)\"" \ + -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS +AM_CXXFLAGS = $(GST_CXXFLAGS) $(GST_CHECK_CFLAGS) \ + -DGST_TEST_FILES_PATH="\"$(TEST_FILES_DIRECTORY)\"" \ + -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS +LDADD = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(GST_PLUGINS_BASE_LIBS) -lgstrtp-@GST_API_VERSION@ \ + -lgstrtsp-@GST_API_VERSION@ -lgstsdp-@GST_API_VERSION@ \ + $(GST_BASE_LIBS) $(GIO_LIBS) \ + $(GST_LIBS) $(GST_CHECK_LIBS) $(GST_RTSP_SERVER_LIBS) + +SUPPRESSIONS = $(top_srcdir)/common/gst.supp diff --git a/tests/check/Makefile.in b/tests/check/Makefile.in new file mode 100644 index 0000000..a68c6ca --- /dev/null +++ b/tests/check/Makefile.in @@ -0,0 +1,1635 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = $(top_srcdir)/common/check.mak $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver +check_PROGRAMS = gst/rtspserver$(EXEEXT) gst/client$(EXEEXT) \ + gst/mountpoints$(EXEEXT) gst/mediafactory$(EXEEXT) \ + gst/media$(EXEEXT) gst/stream$(EXEEXT) \ + gst/addresspool$(EXEEXT) gst/threadpool$(EXEEXT) \ + gst/permissions$(EXEEXT) gst/token$(EXEEXT) \ + gst/sessionmedia$(EXEEXT) gst/sessionpool$(EXEEXT) +noinst_PROGRAMS = +subdir = tests/check +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-docbook.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-doc.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/introspection.m4 \ + $(top_srcdir)/common/m4/pkg.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +gst_addresspool_SOURCES = gst/addresspool.c +am__dirstamp = $(am__leading_dot)dirstamp +gst_addresspool_OBJECTS = gst/addresspool.$(OBJEXT) +gst_addresspool_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +gst_addresspool_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +gst_client_SOURCES = gst/client.c +gst_client_OBJECTS = gst/client.$(OBJEXT) +gst_client_LDADD = $(LDADD) +gst_client_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +gst_media_SOURCES = gst/media.c +gst_media_OBJECTS = gst/media.$(OBJEXT) +gst_media_LDADD = $(LDADD) +gst_media_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +gst_mediafactory_SOURCES = gst/mediafactory.c +gst_mediafactory_OBJECTS = gst/mediafactory.$(OBJEXT) +gst_mediafactory_LDADD = $(LDADD) +gst_mediafactory_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +gst_mountpoints_SOURCES = gst/mountpoints.c +gst_mountpoints_OBJECTS = gst/mountpoints.$(OBJEXT) +gst_mountpoints_LDADD = $(LDADD) +gst_mountpoints_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +gst_permissions_SOURCES = gst/permissions.c +gst_permissions_OBJECTS = gst/permissions.$(OBJEXT) +gst_permissions_LDADD = $(LDADD) +gst_permissions_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +gst_rtspserver_SOURCES = gst/rtspserver.c +gst_rtspserver_OBJECTS = gst/rtspserver.$(OBJEXT) +gst_rtspserver_LDADD = $(LDADD) +gst_rtspserver_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +gst_sessionmedia_SOURCES = gst/sessionmedia.c +gst_sessionmedia_OBJECTS = gst/sessionmedia.$(OBJEXT) +gst_sessionmedia_LDADD = $(LDADD) +gst_sessionmedia_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +gst_sessionpool_SOURCES = gst/sessionpool.c +gst_sessionpool_OBJECTS = gst/sessionpool.$(OBJEXT) +gst_sessionpool_LDADD = $(LDADD) +gst_sessionpool_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +gst_stream_SOURCES = gst/stream.c +gst_stream_OBJECTS = gst/stream.$(OBJEXT) +gst_stream_LDADD = $(LDADD) +gst_stream_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +gst_threadpool_SOURCES = gst/threadpool.c +gst_threadpool_OBJECTS = gst/threadpool.$(OBJEXT) +gst_threadpool_LDADD = $(LDADD) +gst_threadpool_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +gst_token_SOURCES = gst/token.c +gst_token_OBJECTS = gst/token.$(OBJEXT) +gst_token_LDADD = $(LDADD) +gst_token_DEPENDENCIES = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = gst/addresspool.c gst/client.c gst/media.c \ + gst/mediafactory.c gst/mountpoints.c gst/permissions.c \ + gst/rtspserver.c gst/sessionmedia.c gst/sessionpool.c \ + gst/stream.c gst/threadpool.c gst/token.c +DIST_SOURCES = gst/addresspool.c gst/client.c gst/media.c \ + gst/mediafactory.c gst/mountpoints.c gst/permissions.c \ + gst/rtspserver.c gst/sessionmedia.c gst/sessionpool.c \ + gst/stream.c gst/threadpool.c gst/token.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAT_ENTRY_END = @CAT_ENTRY_END@ +CAT_ENTRY_START = @CAT_ENTRY_START@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQ = @GLIB_REQ@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPD_PLUGINS_DIR = @GSTPD_PLUGINS_DIR@ +GSTPG_PLUGINS_DIR = @GSTPG_PLUGINS_DIR@ +GST_AGE = @GST_AGE@ +GST_ALL_CFLAGS = @GST_ALL_CFLAGS@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_ALL_LIBS = @GST_ALL_LIBS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LIB_LDFLAGS = @GST_LIB_LDFLAGS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_OBJ_CFLAGS = @GST_OBJ_CFLAGS@ +GST_OBJ_LIBS = @GST_OBJ_LIBS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PKG_CONFIG_PATH = @GST_PKG_CONFIG_PATH@ +GST_PLUGINS_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@ +GST_PLUGINS_BAD_DIR = @GST_PLUGINS_BAD_DIR@ +GST_PLUGINS_BAD_LIBS = @GST_PLUGINS_BAD_LIBS@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@ +GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@ +GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ +HAVE_DVIPS = @HAVE_DVIPS@ +HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ +HAVE_JADETEX = @HAVE_JADETEX@ +HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ +HAVE_PNMTOPS = @HAVE_PNMTOPS@ +HAVE_PS2PDF = @HAVE_PS2PDF@ +HAVE_XMLLINT = @HAVE_XMLLINT@ +HAVE_XSLTPROC = @HAVE_XSLTPROC@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCGROUP_CFLAGS = @LIBCGROUP_CFLAGS@ +LIBCGROUP_LIBS = @LIBCGROUP_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XML_CATALOG = @XML_CATALOG@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# inspect every plugin feature +GST_INSPECT = $(GST_TOOLS_DIR)/gst-inspect-$(GST_API_VERSION) +CHECK_REGISTRY = $(top_builddir)/tests/check/test-registry.reg +TEST_FILES_DIRECTORY = $(top_srcdir)/tests/files +REGISTRY_ENVIRONMENT = \ + GST_REGISTRY_1_0=$(CHECK_REGISTRY) + +TESTS_ENVIRONMENT = \ + CK_DEFAULT_TIMEOUT=120 \ + GST_STATE_IGNORE_ELEMENTS="$(STATE_IGNORE_ELEMENTS)" \ + $(REGISTRY_ENVIRONMENT) \ + GST_PLUGIN_SYSTEM_PATH_1_0= \ + GST_PLUGIN_PATH_1_0=$(GST_PLUGINS_DIR):$(GSTPB_PLUGINS_DIR):$(GSTPG_PLUGINS_DIR):$(GSTPD_PLUGINS_DIR) \ + GST_PLUGIN_LOADING_WHITELIST="gstreamer:gst-plugins-base:gst-plugins-good:gst-plugins-bad" + + +# ths core dumps of some machines have PIDs appended +CLEANFILES = core.* test-registry.* +TESTS = $(check_PROGRAMS) +AM_CFLAGS = -I$(top_srcdir)/gst/rtsp-server \ + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) \ + $(GIO_CFLAGS) \ + $(GST_CFLAGS) \ + $(GST_CHECK_CFLAGS) \ + -DGST_TEST_FILES_PATH="\"$(TEST_FILES_DIRECTORY)\"" \ + -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS + +AM_CXXFLAGS = $(GST_CXXFLAGS) $(GST_CHECK_CFLAGS) \ + -DGST_TEST_FILES_PATH="\"$(TEST_FILES_DIRECTORY)\"" \ + -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS + +LDADD = $(top_builddir)/gst/rtsp-server/libgstrtspserver-@GST_API_VERSION@.la \ + $(GST_PLUGINS_BASE_LIBS) -lgstrtp-@GST_API_VERSION@ \ + -lgstrtsp-@GST_API_VERSION@ -lgstsdp-@GST_API_VERSION@ \ + $(GST_BASE_LIBS) $(GIO_LIBS) \ + $(GST_LIBS) $(GST_CHECK_LIBS) $(GST_RTSP_SERVER_LIBS) + +SUPPRESSIONS = $(top_srcdir)/common/gst.supp +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/common/check.mak $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/check/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/check/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_srcdir)/common/check.mak: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +gst/$(am__dirstamp): + @$(MKDIR_P) gst + @: > gst/$(am__dirstamp) +gst/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gst/$(DEPDIR) + @: > gst/$(DEPDIR)/$(am__dirstamp) +gst/addresspool.$(OBJEXT): gst/$(am__dirstamp) \ + gst/$(DEPDIR)/$(am__dirstamp) + +gst/addresspool$(EXEEXT): $(gst_addresspool_OBJECTS) $(gst_addresspool_DEPENDENCIES) $(EXTRA_gst_addresspool_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/addresspool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_addresspool_OBJECTS) $(gst_addresspool_LDADD) $(LIBS) +gst/client.$(OBJEXT): gst/$(am__dirstamp) \ + gst/$(DEPDIR)/$(am__dirstamp) + +gst/client$(EXEEXT): $(gst_client_OBJECTS) $(gst_client_DEPENDENCIES) $(EXTRA_gst_client_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/client$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_client_OBJECTS) $(gst_client_LDADD) $(LIBS) +gst/media.$(OBJEXT): gst/$(am__dirstamp) gst/$(DEPDIR)/$(am__dirstamp) + +gst/media$(EXEEXT): $(gst_media_OBJECTS) $(gst_media_DEPENDENCIES) $(EXTRA_gst_media_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/media$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_media_OBJECTS) $(gst_media_LDADD) $(LIBS) +gst/mediafactory.$(OBJEXT): gst/$(am__dirstamp) \ + gst/$(DEPDIR)/$(am__dirstamp) + +gst/mediafactory$(EXEEXT): $(gst_mediafactory_OBJECTS) $(gst_mediafactory_DEPENDENCIES) $(EXTRA_gst_mediafactory_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/mediafactory$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_mediafactory_OBJECTS) $(gst_mediafactory_LDADD) $(LIBS) +gst/mountpoints.$(OBJEXT): gst/$(am__dirstamp) \ + gst/$(DEPDIR)/$(am__dirstamp) + +gst/mountpoints$(EXEEXT): $(gst_mountpoints_OBJECTS) $(gst_mountpoints_DEPENDENCIES) $(EXTRA_gst_mountpoints_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/mountpoints$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_mountpoints_OBJECTS) $(gst_mountpoints_LDADD) $(LIBS) +gst/permissions.$(OBJEXT): gst/$(am__dirstamp) \ + gst/$(DEPDIR)/$(am__dirstamp) + +gst/permissions$(EXEEXT): $(gst_permissions_OBJECTS) $(gst_permissions_DEPENDENCIES) $(EXTRA_gst_permissions_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/permissions$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_permissions_OBJECTS) $(gst_permissions_LDADD) $(LIBS) +gst/rtspserver.$(OBJEXT): gst/$(am__dirstamp) \ + gst/$(DEPDIR)/$(am__dirstamp) + +gst/rtspserver$(EXEEXT): $(gst_rtspserver_OBJECTS) $(gst_rtspserver_DEPENDENCIES) $(EXTRA_gst_rtspserver_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/rtspserver$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_rtspserver_OBJECTS) $(gst_rtspserver_LDADD) $(LIBS) +gst/sessionmedia.$(OBJEXT): gst/$(am__dirstamp) \ + gst/$(DEPDIR)/$(am__dirstamp) + +gst/sessionmedia$(EXEEXT): $(gst_sessionmedia_OBJECTS) $(gst_sessionmedia_DEPENDENCIES) $(EXTRA_gst_sessionmedia_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/sessionmedia$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_sessionmedia_OBJECTS) $(gst_sessionmedia_LDADD) $(LIBS) +gst/sessionpool.$(OBJEXT): gst/$(am__dirstamp) \ + gst/$(DEPDIR)/$(am__dirstamp) + +gst/sessionpool$(EXEEXT): $(gst_sessionpool_OBJECTS) $(gst_sessionpool_DEPENDENCIES) $(EXTRA_gst_sessionpool_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/sessionpool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_sessionpool_OBJECTS) $(gst_sessionpool_LDADD) $(LIBS) +gst/stream.$(OBJEXT): gst/$(am__dirstamp) \ + gst/$(DEPDIR)/$(am__dirstamp) + +gst/stream$(EXEEXT): $(gst_stream_OBJECTS) $(gst_stream_DEPENDENCIES) $(EXTRA_gst_stream_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/stream$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_stream_OBJECTS) $(gst_stream_LDADD) $(LIBS) +gst/threadpool.$(OBJEXT): gst/$(am__dirstamp) \ + gst/$(DEPDIR)/$(am__dirstamp) + +gst/threadpool$(EXEEXT): $(gst_threadpool_OBJECTS) $(gst_threadpool_DEPENDENCIES) $(EXTRA_gst_threadpool_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/threadpool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_threadpool_OBJECTS) $(gst_threadpool_LDADD) $(LIBS) +gst/token.$(OBJEXT): gst/$(am__dirstamp) gst/$(DEPDIR)/$(am__dirstamp) + +gst/token$(EXEEXT): $(gst_token_OBJECTS) $(gst_token_DEPENDENCIES) $(EXTRA_gst_token_DEPENDENCIES) gst/$(am__dirstamp) + @rm -f gst/token$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gst_token_OBJECTS) $(gst_token_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f gst/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/addresspool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/media.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/mediafactory.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/mountpoints.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/permissions.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/rtspserver.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/sessionmedia.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/sessionpool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/stream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/threadpool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gst/$(DEPDIR)/token.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf gst/.libs gst/_libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +gst/rtspserver.log: gst/rtspserver$(EXEEXT) + @p='gst/rtspserver$(EXEEXT)'; \ + b='gst/rtspserver'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gst/client.log: gst/client$(EXEEXT) + @p='gst/client$(EXEEXT)'; \ + b='gst/client'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gst/mountpoints.log: gst/mountpoints$(EXEEXT) + @p='gst/mountpoints$(EXEEXT)'; \ + b='gst/mountpoints'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gst/mediafactory.log: gst/mediafactory$(EXEEXT) + @p='gst/mediafactory$(EXEEXT)'; \ + b='gst/mediafactory'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gst/media.log: gst/media$(EXEEXT) + @p='gst/media$(EXEEXT)'; \ + b='gst/media'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gst/stream.log: gst/stream$(EXEEXT) + @p='gst/stream$(EXEEXT)'; \ + b='gst/stream'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gst/addresspool.log: gst/addresspool$(EXEEXT) + @p='gst/addresspool$(EXEEXT)'; \ + b='gst/addresspool'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gst/threadpool.log: gst/threadpool$(EXEEXT) + @p='gst/threadpool$(EXEEXT)'; \ + b='gst/threadpool'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gst/permissions.log: gst/permissions$(EXEEXT) + @p='gst/permissions$(EXEEXT)'; \ + b='gst/permissions'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gst/token.log: gst/token$(EXEEXT) + @p='gst/token$(EXEEXT)'; \ + b='gst/token'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gst/sessionmedia.log: gst/sessionmedia$(EXEEXT) + @p='gst/sessionmedia$(EXEEXT)'; \ + b='gst/sessionmedia'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gst/sessionpool.log: gst/sessionpool$(EXEEXT) + @p='gst/sessionpool$(EXEEXT)'; \ + b='gst/sessionpool'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f gst/$(DEPDIR)/$(am__dirstamp) + -rm -f gst/$(am__dirstamp) + +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-checkPROGRAMS clean-generic clean-libtool clean-local \ + clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf gst/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf gst/$(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: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool clean-local \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am 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-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am recheck tags tags-am uninstall \ + uninstall-am + + +# keep target around, since it's referenced in the modules' Makefiles +clean-local-check: + @echo + +# hangs spectacularly on some machines, so let's not do this by default yet +@HAVE_VALGRIND_TRUE@check-valgrind: +@HAVE_VALGRIND_TRUE@ $(MAKE) valgrind +@HAVE_VALGRIND_FALSE@check-valgrind: +@HAVE_VALGRIND_FALSE@ @true + +LOOPS ?= 10 + +# run any given test by running make test.check +# if the test fails, run it again at at least debug level 2 +%.check: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $* || \ + $(TESTS_ENVIRONMENT) \ + GST_DEBUG=$$GST_DEBUG,*:2 \ + CK_DEFAULT_TIMEOUT=20 \ + $* + +# just like 'check', but don't run it again if it fails (useful for debugging) +%.check-norepeat: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $* + +# run any given test in a loop +%.torture: % + @for i in `seq 1 $(LOOPS)`; do \ + $(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $*; done + +# run any given test in an infinite loop +%.forever: % + @while true; do \ + $(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=20 \ + $* || break; done + +# valgrind any given test by running make test.valgrind +%.valgrind: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=360 \ + G_SLICE=always-malloc \ + $(LIBTOOL) --mode=execute \ + $(VALGRIND_PATH) -q \ + $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ + --tool=memcheck --leak-check=full --trace-children=yes \ + --show-possibly-lost=no \ + --leak-resolution=high --num-callers=20 \ + ./$* 2>&1 | tee valgrind.log + @if grep "==" valgrind.log > /dev/null 2>&1; then \ + rm valgrind.log; \ + exit 1; \ + fi + @rm valgrind.log + +# valgrind any given test and generate suppressions for it +%.valgrind.gen-suppressions: % + @$(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=360 \ + G_SLICE=always-malloc \ + $(LIBTOOL) --mode=execute \ + $(VALGRIND_PATH) -q \ + $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ + --tool=memcheck --leak-check=full --trace-children=yes \ + --show-possibly-lost=no \ + --leak-resolution=high --num-callers=20 \ + --gen-suppressions=all \ + ./$* 2>&1 | tee suppressions.log + +# valgrind torture any given test +%.valgrind-torture: % + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) $*.valgrind || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# valgrind any given test until failure by running make test.valgrind-forever +%.valgrind-forever: % + @while $(MAKE) $*.valgrind; do \ + true; done + +# gdb any given test by running make test.gdb +%.gdb: % + @$(TESTS_ENVIRONMENT) \ + CK_FORK=no \ + $(LIBTOOL) --mode=execute \ + gdb $* + +%.lcov-reset: + $(MAKE) $*.lcov-run + $(MAKE) $*.lcov-report + +%.lcov: % + $(MAKE) $*.lcov-reset + +@GST_GCOV_ENABLED_TRUE@%.lcov-clean: +@GST_GCOV_ENABLED_TRUE@ $(MAKE) -C $(top_builddir) lcov-clean + +@GST_GCOV_ENABLED_TRUE@%.lcov-run: +@GST_GCOV_ENABLED_TRUE@ $(MAKE) $*.lcov-clean +@GST_GCOV_ENABLED_TRUE@ $(MAKE) $*.check + +@GST_GCOV_ENABLED_TRUE@%.lcov-report: +@GST_GCOV_ENABLED_TRUE@ $(MAKE) -C $(top_builddir) lcov-report +@GST_GCOV_ENABLED_FALSE@%.lcov-run: +@GST_GCOV_ENABLED_FALSE@ echo "Need to reconfigure with --enable-gcov" + +@GST_GCOV_ENABLED_FALSE@%.lcov-report: +@GST_GCOV_ENABLED_FALSE@ echo "Need to reconfigure with --enable-gcov" + +# torture tests +torture: $(TESTS) + -rm test-registry.* + @echo "Torturing tests ..." + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) check || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# forever tests +forever: $(TESTS) + -rm test-registry.* + @echo "Forever tests ..." + @while true; do \ + $(MAKE) check || \ + (echo "Failure"; exit 1) || \ + exit 1; \ + done + +# valgrind all tests +valgrind: $(TESTS) + @echo "Valgrinding tests ..." + @failed=0; \ + for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \ + $(MAKE) $$t.valgrind; \ + if test "$$?" -ne 0; then \ + echo "Valgrind error for test $$t"; \ + failed=`expr $$failed + 1`; \ + whicht="$$whicht $$t"; \ + fi; \ + done; \ + if test "$$failed" -ne 0; then \ + echo "$$failed tests had leaks or errors under valgrind:"; \ + echo "$$whicht"; \ + false; \ + fi + +# valgrind all tests until failure +valgrind-forever: $(TESTS) + -rm test-registry.* + @echo "Forever valgrinding tests ..." + @while true; do \ + $(MAKE) valgrind || \ + (echo "Failure"; exit 1) || \ + exit 1; \ + done + +# valgrind torture all tests +valgrind-torture: $(TESTS) + -rm test-registry.* + @echo "Torturing and valgrinding tests ..." + @for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) valgrind || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# valgrind all tests and generate suppressions +valgrind.gen-suppressions: $(TESTS) + @echo "Valgrinding tests ..." + @failed=0; \ + for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \ + $(MAKE) $$t.valgrind.gen-suppressions; \ + if test "$$?" -ne 0; then \ + echo "Valgrind error for test $$t"; \ + failed=`expr $$failed + 1`; \ + whicht="$$whicht $$t"; \ + fi; \ + done; \ + if test "$$failed" -ne 0; then \ + echo "$$failed tests had leaks or errors under valgrind:"; \ + echo "$$whicht"; \ + false; \ + fi +inspect: + @echo "Inspecting features ..." + @for e in `$(TESTS_ENVIRONMENT) $(GST_INSPECT) | head -n -2 \ + | cut -d: -f2`; \ + do echo Inspecting $$e; \ + $(GST_INSPECT) $$e > /dev/null 2>&1; done + +help: + @echo + @echo "make check -- run all checks" + @echo "make torture -- run all checks $(LOOPS) times" + @echo "make (dir)/(test).check -- run the given check once, repeat with GST_DEBUG=*:2 if it fails" + @echo "make (dir)/(test).check-norepeat -- run the given check once, but don't run it again if it fails" + @echo "make (dir)/(test).forever -- run the given check forever" + @echo "make (dir)/(test).torture -- run the given check $(LOOPS) times" + @echo + @echo "make (dir)/(test).gdb -- start up gdb for the given test" + @echo + @echo "make valgrind -- valgrind all tests" + @echo "make valgrind-forever -- valgrind all tests forever" + @echo "make valgrind-torture -- valgrind all tests $(LOOPS) times" + @echo "make valgrind.gen-suppressions -- generate suppressions for all tests" + @echo " and save to suppressions.log" + @echo "make (dir)/(test).valgrind -- valgrind the given test" + @echo "make (dir)/(test).valgrind-forever -- valgrind the given test forever" + @echo "make (dir)/(test).valgrind-torture -- valgrind the given test $(LOOPS) times" + @echo "make (dir)/(test).valgrind.gen-suppressions -- generate suppressions" + @echo " and save to suppressions.log" + @echo "make inspect -- inspect all plugin features" + @echo + @echo + @echo "Additionally, you can use the GST_CHECKS environment variable to" + @echo "specify which test(s) should be run. This is useful if you are" + @echo "debugging a failure in one particular test, or want to reproduce" + @echo "a race condition in a single test." + @echo + @echo "Examples:" + @echo + @echo " GST_CHECKS=test_this,test_that make element/foobar.check" + @echo " GST_CHECKS=test_many_threads make element/foobar.forever" + @echo + +clean-local: clean-local-check + +$(CHECK_REGISTRY): + $(TESTS_ENVIRONMENT) + +# 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: diff --git a/tests/check/gst/addresspool.c b/tests/check/gst/addresspool.c new file mode 100644 index 0000000..9a0ff54 --- /dev/null +++ b/tests/check/gst/addresspool.c @@ -0,0 +1,286 @@ +/* GStreamer + * Copyright (C) 2012 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +GST_START_TEST (test_pool) +{ + GstRTSPAddressPool *pool; + GstRTSPAddress *addr, *addr2, *addr3; + GstRTSPAddressPoolResult res; + + pool = gst_rtsp_address_pool_new (); + + fail_if (gst_rtsp_address_pool_add_range (pool, + "233.252.0.1", "233.252.0.0", 5000, 5010, 1)); + fail_if (gst_rtsp_address_pool_add_range (pool, + "233.252.0.1", "::1", 5000, 5010, 1)); + fail_if (gst_rtsp_address_pool_add_range (pool, + "233.252.0.1", "ff02::1", 5000, 5010, 1)); + fail_if (gst_rtsp_address_pool_add_range (pool, + "233.252.0.1.1", "233.252.0.1", 5000, 5010, 1)); + fail_if (gst_rtsp_address_pool_add_range (pool, + "233.252.0.1", "233.252.0.1.1", 5000, 5010, 1)); + ASSERT_CRITICAL (gst_rtsp_address_pool_add_range (pool, + "233.252.0.0", "233.252.0.1", 5010, 5000, 1)); + + fail_unless (gst_rtsp_address_pool_add_range (pool, + "233.252.0.0", "233.252.0.255", 5000, 5010, 1)); + fail_unless (gst_rtsp_address_pool_add_range (pool, + "233.255.0.0", "233.255.0.0", 5000, 5010, 1)); + fail_unless (gst_rtsp_address_pool_add_range (pool, + "233.255.0.0", "233.255.0.0", 5020, 5020, 1)); + + /* should fail, we can't allocate a block of 256 ports */ + addr = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_MULTICAST, 256); + fail_unless (addr == NULL); + + addr = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_MULTICAST, 2); + fail_unless (addr != NULL); + + addr2 = gst_rtsp_address_copy (addr); + + gst_rtsp_address_free (addr2); + gst_rtsp_address_free (addr); + + addr = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_MULTICAST, 4); + fail_unless (addr != NULL); + + /* Will fail because pool is NULL */ + ASSERT_CRITICAL (gst_rtsp_address_pool_clear (NULL)); + + /* will fail because an address is allocated */ + ASSERT_CRITICAL (gst_rtsp_address_pool_clear (pool)); + + gst_rtsp_address_free (addr); + + gst_rtsp_address_pool_clear (pool); + + /* start with odd port to make sure we are allocated address + * starting with even port + */ + fail_unless (gst_rtsp_address_pool_add_range (pool, + "FF11:DB8::1", "FF11:DB8::1", 5001, 5003, 1)); + + addr = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_IPV6 | GST_RTSP_ADDRESS_FLAG_EVEN_PORT | + GST_RTSP_ADDRESS_FLAG_MULTICAST, 2); + fail_unless (addr != NULL); + fail_unless (addr->port == 5002); + fail_unless (!g_ascii_strcasecmp (addr->address, "FF11:DB8::1")); + + /* Will fail becuse there is only one IPv6 address left */ + addr2 = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_IPV6 | GST_RTSP_ADDRESS_FLAG_MULTICAST, 2); + fail_unless (addr2 == NULL); + + /* Will fail because the only IPv6 address left has an odd port */ + addr2 = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_IPV6 | GST_RTSP_ADDRESS_FLAG_EVEN_PORT | + GST_RTSP_ADDRESS_FLAG_MULTICAST, 1); + fail_unless (addr2 == NULL); + + addr2 = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_IPV4 | GST_RTSP_ADDRESS_FLAG_MULTICAST, 1); + fail_unless (addr2 == NULL); + + gst_rtsp_address_free (addr); + + gst_rtsp_address_pool_clear (pool); + + fail_unless (gst_rtsp_address_pool_add_range (pool, + "233.252.0.0", "233.252.0.255", 5000, 5002, 1)); + + addr = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_EVEN_PORT | GST_RTSP_ADDRESS_FLAG_MULTICAST, 2); + fail_unless (addr != NULL); + fail_unless (addr->port == 5000); + fail_unless (!strcmp (addr->address, "233.252.0.0")); + + addr2 = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_EVEN_PORT | GST_RTSP_ADDRESS_FLAG_MULTICAST, 2); + fail_unless (addr2 != NULL); + fail_unless (addr2->port == 5000); + fail_unless (!strcmp (addr2->address, "233.252.0.1")); + + gst_rtsp_address_free (addr); + gst_rtsp_address_free (addr2); + + addr = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_IPV6 | GST_RTSP_ADDRESS_FLAG_MULTICAST, 1); + fail_unless (addr == NULL); + + gst_rtsp_address_pool_clear (pool); + + fail_unless (gst_rtsp_address_pool_add_range (pool, + "233.252.1.1", "233.252.1.1", 5000, 5001, 1)); + + res = gst_rtsp_address_pool_reserve_address (pool, "233.252.1.1", 5000, 3, + 1, &addr); + fail_unless (res == GST_RTSP_ADDRESS_POOL_ERANGE); + fail_unless (addr == NULL); + + res = gst_rtsp_address_pool_reserve_address (pool, "233.252.1.2", 5000, 2, + 1, &addr); + fail_unless (res == GST_RTSP_ADDRESS_POOL_ERANGE); + fail_unless (addr == NULL); + + res = gst_rtsp_address_pool_reserve_address (pool, "233.252.1.1", 500, 2, 1, + &addr); + fail_unless (res == GST_RTSP_ADDRESS_POOL_ERANGE); + fail_unless (addr == NULL); + + res = gst_rtsp_address_pool_reserve_address (pool, "233.252.1.1", 5000, 2, + 2, &addr); + fail_unless (res == GST_RTSP_ADDRESS_POOL_ERANGE); + fail_unless (addr == NULL); + + res = gst_rtsp_address_pool_reserve_address (pool, "2000::1", 5000, 2, 2, + &addr); + fail_unless (res == GST_RTSP_ADDRESS_POOL_EINVAL); + fail_unless (addr == NULL); + + res = gst_rtsp_address_pool_reserve_address (pool, "ff02::1", 5000, 2, 2, + &addr); + fail_unless (res == GST_RTSP_ADDRESS_POOL_ERANGE); + fail_unless (addr == NULL); + + res = gst_rtsp_address_pool_reserve_address (pool, "1.1", 5000, 2, 2, &addr); + fail_unless (res == GST_RTSP_ADDRESS_POOL_EINVAL); + fail_unless (addr == NULL); + + res = gst_rtsp_address_pool_reserve_address (pool, "233.252.1.1", 5000, 2, + 1, &addr); + fail_unless (res == GST_RTSP_ADDRESS_POOL_OK); + fail_unless (addr != NULL); + fail_unless (addr->port == 5000); + fail_unless (!strcmp (addr->address, "233.252.1.1")); + + res = gst_rtsp_address_pool_reserve_address (pool, "233.252.1.1", 5000, 2, + 1, &addr2); + fail_unless (res == GST_RTSP_ADDRESS_POOL_ERESERVED); + fail_unless (addr2 == NULL); + + gst_rtsp_address_free (addr); + gst_rtsp_address_pool_clear (pool); + + fail_unless (gst_rtsp_address_pool_add_range (pool, + "233.252.1.1", "233.252.1.3", 5000, 5001, 1)); + + res = gst_rtsp_address_pool_reserve_address (pool, "233.252.1.1", 5000, 2, + 1, &addr); + fail_unless (addr != NULL); + fail_unless (addr->port == 5000); + fail_unless (!strcmp (addr->address, "233.252.1.1")); + + res = gst_rtsp_address_pool_reserve_address (pool, "233.252.1.3", 5000, 2, + 1, &addr2); + fail_unless (addr2 != NULL); + fail_unless (addr2->port == 5000); + fail_unless (!strcmp (addr2->address, "233.252.1.3")); + + addr3 = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_EVEN_PORT | GST_RTSP_ADDRESS_FLAG_MULTICAST, 2); + fail_unless (addr3 != NULL); + fail_unless (addr3->port == 5000); + fail_unless (!strcmp (addr3->address, "233.252.1.2")); + + fail_unless (gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_EVEN_PORT | GST_RTSP_ADDRESS_FLAG_MULTICAST, 2) + == NULL); + + gst_rtsp_address_free (addr); + gst_rtsp_address_free (addr2); + gst_rtsp_address_free (addr3); + gst_rtsp_address_pool_clear (pool); + + fail_unless (gst_rtsp_address_pool_add_range (pool, + "233.252.1.1", "233.252.1.1", 5000, 5001, 1)); + fail_if (gst_rtsp_address_pool_has_unicast_addresses (pool)); + fail_unless (gst_rtsp_address_pool_add_range (pool, + "192.168.1.1", "192.168.1.1", 6000, 6001, 0)); + fail_unless (gst_rtsp_address_pool_has_unicast_addresses (pool)); + + addr = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_EVEN_PORT | GST_RTSP_ADDRESS_FLAG_MULTICAST, 2); + fail_unless (addr != NULL); + fail_unless (addr->port == 5000); + fail_unless (!strcmp (addr->address, "233.252.1.1")); + gst_rtsp_address_free (addr); + + addr = gst_rtsp_address_pool_acquire_address (pool, + GST_RTSP_ADDRESS_FLAG_EVEN_PORT | GST_RTSP_ADDRESS_FLAG_UNICAST, 2); + fail_unless (addr != NULL); + fail_unless (addr->port == 6000); + fail_unless (!strcmp (addr->address, "192.168.1.1")); + gst_rtsp_address_free (addr); + + fail_unless (gst_rtsp_address_pool_add_range (pool, + GST_RTSP_ADDRESS_POOL_ANY_IPV4, GST_RTSP_ADDRESS_POOL_ANY_IPV4, 5000, + 5001, 0)); + res = + gst_rtsp_address_pool_reserve_address (pool, "192.168.0.1", 5000, 1, 0, + &addr); + fail_unless (res == GST_RTSP_ADDRESS_POOL_ERANGE); + res = + gst_rtsp_address_pool_reserve_address (pool, "0.0.0.0", 5000, 1, 0, + &addr); + fail_unless (res == GST_RTSP_ADDRESS_POOL_OK); + gst_rtsp_address_free (addr); + gst_rtsp_address_pool_clear (pool); + + /* Error case 2. Using ANY as min address makes it possible to allocate the + * same address twice */ + fail_unless (gst_rtsp_address_pool_add_range (pool, + GST_RTSP_ADDRESS_POOL_ANY_IPV4, "255.255.255.255", 5000, 5001, 0)); + res = + gst_rtsp_address_pool_reserve_address (pool, "192.168.0.1", 5000, 1, 0, + &addr); + fail_unless (res == GST_RTSP_ADDRESS_POOL_OK); + res = + gst_rtsp_address_pool_reserve_address (pool, "192.168.0.1", 5000, 1, 0, + &addr2); + fail_unless (res == GST_RTSP_ADDRESS_POOL_ERESERVED); + gst_rtsp_address_free (addr); + gst_rtsp_address_pool_clear (pool); + + g_object_unref (pool); +} + +GST_END_TEST; + +static Suite * +rtspaddresspool_suite (void) +{ + Suite *s = suite_create ("rtspaddresspool"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_set_timeout (tc, 20); + tcase_add_test (tc, test_pool); + + return s; +} + +GST_CHECK_MAIN (rtspaddresspool); diff --git a/tests/check/gst/client.c b/tests/check/gst/client.c new file mode 100644 index 0000000..1bbd67d --- /dev/null +++ b/tests/check/gst/client.c @@ -0,0 +1,929 @@ +/* GStreamer + * Copyright (C) 2012 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +static gchar * session_id; +static gint cseq; +static guint expected_session_timeout = 60; + +static gboolean +test_response_200 (GstRTSPClient * client, GstRTSPMessage * response, + gboolean close, gpointer user_data) +{ + GstRTSPStatusCode code; + const gchar *reason; + GstRTSPVersion version; + + fail_unless (gst_rtsp_message_get_type (response) == + GST_RTSP_MESSAGE_RESPONSE); + + fail_unless (gst_rtsp_message_parse_response (response, &code, &reason, + &version) + == GST_RTSP_OK); + fail_unless (code == GST_RTSP_STS_OK); + fail_unless (g_str_equal (reason, "OK")); + fail_unless (version == GST_RTSP_VERSION_1_0); + + return TRUE; +} + +static gboolean +test_response_400 (GstRTSPClient * client, GstRTSPMessage * response, + gboolean close, gpointer user_data) +{ + GstRTSPStatusCode code; + const gchar *reason; + GstRTSPVersion version; + + fail_unless (gst_rtsp_message_get_type (response) == + GST_RTSP_MESSAGE_RESPONSE); + + fail_unless (gst_rtsp_message_parse_response (response, &code, &reason, + &version) + == GST_RTSP_OK); + fail_unless (code == GST_RTSP_STS_BAD_REQUEST); + fail_unless (g_str_equal (reason, "Bad Request")); + fail_unless (version == GST_RTSP_VERSION_1_0); + + return TRUE; +} + +static gboolean +test_response_404 (GstRTSPClient * client, GstRTSPMessage * response, + gboolean close, gpointer user_data) +{ + GstRTSPStatusCode code; + const gchar *reason; + GstRTSPVersion version; + + fail_unless (gst_rtsp_message_get_type (response) == + GST_RTSP_MESSAGE_RESPONSE); + + fail_unless (gst_rtsp_message_parse_response (response, &code, &reason, + &version) + == GST_RTSP_OK); + fail_unless (code == GST_RTSP_STS_NOT_FOUND); + fail_unless (g_str_equal (reason, "Not Found")); + fail_unless (version == GST_RTSP_VERSION_1_0); + + return TRUE; +} + +static gboolean +test_response_454 (GstRTSPClient * client, GstRTSPMessage * response, + gboolean close, gpointer user_data) +{ + GstRTSPStatusCode code; + const gchar *reason; + GstRTSPVersion version; + + fail_unless (gst_rtsp_message_get_type (response) == + GST_RTSP_MESSAGE_RESPONSE); + + fail_unless (gst_rtsp_message_parse_response (response, &code, &reason, + &version) + == GST_RTSP_OK); + fail_unless (code == GST_RTSP_STS_SESSION_NOT_FOUND); + fail_unless (g_str_equal (reason, "Session Not Found")); + fail_unless (version == GST_RTSP_VERSION_1_0); + + return TRUE; +} + +static GstRTSPClient * +setup_client (const gchar * launch_line) +{ + GstRTSPClient *client; + GstRTSPSessionPool *session_pool; + GstRTSPMountPoints *mount_points; + GstRTSPMediaFactory *factory; + GstRTSPThreadPool *thread_pool; + + client = gst_rtsp_client_new (); + + session_pool = gst_rtsp_session_pool_new (); + gst_rtsp_client_set_session_pool (client, session_pool); + + mount_points = gst_rtsp_mount_points_new (); + factory = gst_rtsp_media_factory_new (); + if (launch_line == NULL) + gst_rtsp_media_factory_set_launch (factory, + "videotestsrc ! video/x-raw,width=352,height=288 ! rtpgstpay name=pay0 pt=96"); + else + gst_rtsp_media_factory_set_launch (factory, launch_line); + + gst_rtsp_mount_points_add_factory (mount_points, "/test", factory); + gst_rtsp_client_set_mount_points (client, mount_points); + + thread_pool = gst_rtsp_thread_pool_new (); + gst_rtsp_client_set_thread_pool (client, thread_pool); + + g_object_unref (mount_points); + g_object_unref (session_pool); + g_object_unref (thread_pool); + + return client; +} + +static void +teardown_client (GstRTSPClient * client) +{ + gst_rtsp_client_set_thread_pool (client, NULL); + g_object_unref (client); +} + +GST_START_TEST (test_request) +{ + GstRTSPClient *client; + GstRTSPMessage request = { 0, }; + gchar *str; + GstRTSPConnection *conn; + GSocket *sock; + GError *error = NULL; + + client = gst_rtsp_client_new (); + + /* OPTIONS with invalid url */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_OPTIONS, + "foopy://padoop/") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_CSEQ, str); + g_free (str); + + gst_rtsp_client_set_send_func (client, test_response_400, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + + gst_rtsp_message_unset (&request); + + /* OPTIONS with unknown session id */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_OPTIONS, + "rtsp://localhost/test") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_CSEQ, str); + g_free (str); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_SESSION, "foobar"); + + gst_rtsp_client_set_send_func (client, test_response_454, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + + gst_rtsp_message_unset (&request); + + /* OPTIONS with an absolute path instead of an absolute url */ + /* set host information */ + sock = g_socket_new (G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_STREAM, + G_SOCKET_PROTOCOL_TCP, &error); + g_assert_no_error (error); + gst_rtsp_connection_create_from_socket (sock, "localhost", 444, NULL, &conn); + fail_unless (gst_rtsp_client_set_connection (client, conn)); + g_object_unref (sock); + + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_OPTIONS, + "/test") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_CSEQ, str); + g_free (str); + + gst_rtsp_client_set_send_func (client, test_response_200, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + + /* OPTIONS with an absolute path instead of an absolute url with invalid + * host information */ + g_object_unref (client); + client = gst_rtsp_client_new (); + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_OPTIONS, + "/test") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_CSEQ, str); + g_free (str); + + gst_rtsp_client_set_send_func (client, test_response_400, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + + g_object_unref (client); +} + +GST_END_TEST; + +static gboolean +test_option_response_200 (GstRTSPClient * client, GstRTSPMessage * response, + gboolean close, gpointer user_data) +{ + GstRTSPStatusCode code; + const gchar *reason; + GstRTSPVersion version; + gchar *str; + GstRTSPMethod methods; + + fail_unless (gst_rtsp_message_get_type (response) == + GST_RTSP_MESSAGE_RESPONSE); + + fail_unless (gst_rtsp_message_parse_response (response, &code, &reason, + &version) + == GST_RTSP_OK); + fail_unless (code == GST_RTSP_STS_OK); + fail_unless (g_str_equal (reason, "OK")); + fail_unless (version == GST_RTSP_VERSION_1_0); + + fail_unless (gst_rtsp_message_get_header (response, GST_RTSP_HDR_CSEQ, &str, + 0) == GST_RTSP_OK); + fail_unless (atoi (str) == cseq++); + + fail_unless (gst_rtsp_message_get_header (response, GST_RTSP_HDR_PUBLIC, &str, + 0) == GST_RTSP_OK); + + methods = gst_rtsp_options_from_text (str); + fail_if (methods == 0); + fail_unless (methods == (GST_RTSP_DESCRIBE | + GST_RTSP_OPTIONS | + GST_RTSP_PAUSE | + GST_RTSP_PLAY | + GST_RTSP_SETUP | + GST_RTSP_GET_PARAMETER | GST_RTSP_SET_PARAMETER | GST_RTSP_TEARDOWN)); + + return TRUE; +} + +GST_START_TEST (test_options) +{ + GstRTSPClient *client; + GstRTSPMessage request = { 0, }; + gchar *str; + + client = gst_rtsp_client_new (); + + /* simple OPTIONS */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_OPTIONS, + "rtsp://localhost/test") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_CSEQ, str); + g_free (str); + + gst_rtsp_client_set_send_func (client, test_option_response_200, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + + g_object_unref (client); +} + +GST_END_TEST; + +GST_START_TEST (test_describe) +{ + GstRTSPClient *client; + GstRTSPMessage request = { 0, }; + gchar *str; + + client = gst_rtsp_client_new (); + + /* simple DESCRIBE for non-existing url */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_DESCRIBE, + "rtsp://localhost/test") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_CSEQ, str); + g_free (str); + + gst_rtsp_client_set_send_func (client, test_response_404, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + + g_object_unref (client); + + /* simple DESCRIBE for an existing url */ + client = setup_client (NULL); + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_DESCRIBE, + "rtsp://localhost/test") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_CSEQ, str); + g_free (str); + + gst_rtsp_client_set_send_func (client, test_response_200, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + + teardown_client (client); +} + +GST_END_TEST; + +static const gchar *expected_transport = NULL;; + +static gboolean +test_setup_response_200_multicast (GstRTSPClient * client, + GstRTSPMessage * response, gboolean close, gpointer user_data) +{ + GstRTSPStatusCode code; + const gchar *reason; + GstRTSPVersion version; + gchar *str; + GstRTSPSessionPool *session_pool; + GstRTSPSession *session; + gchar **session_hdr_params; + + fail_unless (expected_transport != NULL); + + fail_unless (gst_rtsp_message_get_type (response) == + GST_RTSP_MESSAGE_RESPONSE); + + fail_unless (gst_rtsp_message_parse_response (response, &code, &reason, + &version) + == GST_RTSP_OK); + fail_unless (code == GST_RTSP_STS_OK); + fail_unless (g_str_equal (reason, "OK")); + fail_unless (version == GST_RTSP_VERSION_1_0); + + fail_unless (gst_rtsp_message_get_header (response, GST_RTSP_HDR_CSEQ, &str, + 0) == GST_RTSP_OK); + fail_unless (atoi (str) == cseq++); + + fail_unless (gst_rtsp_message_get_header (response, GST_RTSP_HDR_TRANSPORT, + &str, 0) == GST_RTSP_OK); + + fail_unless (!strcmp (str, expected_transport)); + + fail_unless (gst_rtsp_message_get_header (response, GST_RTSP_HDR_SESSION, + &str, 0) == GST_RTSP_OK); + session_hdr_params = g_strsplit (str, ";", -1); + + /* session-id value */ + fail_unless (session_hdr_params[0] != NULL); + + if (expected_session_timeout != 60) { + /* session timeout param */ + gchar *timeout_str = g_strdup_printf ("timeout=%u", + expected_session_timeout); + + fail_unless (session_hdr_params[1] != NULL); + g_strstrip (session_hdr_params[1]); + fail_unless (g_strcmp0 (session_hdr_params[1], timeout_str) == 0); + g_free (timeout_str); + } + + session_pool = gst_rtsp_client_get_session_pool (client); + fail_unless (session_pool != NULL); + + fail_unless (gst_rtsp_session_pool_get_n_sessions (session_pool) == 1); + session = gst_rtsp_session_pool_find (session_pool, session_hdr_params[0]); + g_strfreev (session_hdr_params); + + /* remember session id to be able to send teardown */ + session_id = g_strdup (gst_rtsp_session_get_sessionid (session)); + fail_unless (session_id != NULL); + + fail_unless (session != NULL); + g_object_unref (session); + + g_object_unref (session_pool); + + + return TRUE; +} + +static gboolean +test_teardown_response_200 (GstRTSPClient * client, + GstRTSPMessage * response, gboolean close, gpointer user_data) +{ + GstRTSPStatusCode code; + const gchar *reason; + GstRTSPVersion version; + + fail_unless (gst_rtsp_message_get_type (response) == + GST_RTSP_MESSAGE_RESPONSE); + + fail_unless (gst_rtsp_message_parse_response (response, &code, &reason, + &version) + == GST_RTSP_OK); + fail_unless (code == GST_RTSP_STS_OK); + fail_unless (g_str_equal (reason, "OK")); + fail_unless (version == GST_RTSP_VERSION_1_0); + + return TRUE; +} + +static void +send_teardown (GstRTSPClient * client) +{ + GstRTSPMessage request = { 0, }; + gchar *str; + + fail_unless (session_id != NULL); + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_TEARDOWN, + "rtsp://localhost/test") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_take_header (&request, GST_RTSP_HDR_CSEQ, str); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_SESSION, + session_id); + gst_rtsp_client_set_send_func (client, test_teardown_response_200, + NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + g_free (session_id); + session_id = NULL; +} + +static GstRTSPClient * +setup_multicast_client (void) +{ + GstRTSPClient *client; + GstRTSPSessionPool *session_pool; + GstRTSPMountPoints *mount_points; + GstRTSPMediaFactory *factory; + GstRTSPAddressPool *address_pool; + GstRTSPThreadPool *thread_pool; + + client = gst_rtsp_client_new (); + + session_pool = gst_rtsp_session_pool_new (); + gst_rtsp_client_set_session_pool (client, session_pool); + + mount_points = gst_rtsp_mount_points_new (); + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, + "audiotestsrc ! audio/x-raw,rate=44100 ! audioconvert ! rtpL16pay name=pay0"); + address_pool = gst_rtsp_address_pool_new (); + fail_unless (gst_rtsp_address_pool_add_range (address_pool, + "233.252.0.1", "233.252.0.1", 5000, 5010, 1)); + gst_rtsp_media_factory_set_address_pool (factory, address_pool); + gst_rtsp_media_factory_add_role (factory, "user", + "media.factory.access", G_TYPE_BOOLEAN, TRUE, + "media.factory.construct", G_TYPE_BOOLEAN, TRUE, NULL); + gst_rtsp_mount_points_add_factory (mount_points, "/test", factory); + gst_rtsp_client_set_mount_points (client, mount_points); + + thread_pool = gst_rtsp_thread_pool_new (); + gst_rtsp_client_set_thread_pool (client, thread_pool); + + g_object_unref (mount_points); + g_object_unref (session_pool); + g_object_unref (address_pool); + g_object_unref (thread_pool); + + return client; +} + +GST_START_TEST (test_client_multicast_transport_404) +{ + GstRTSPClient *client; + GstRTSPMessage request = { 0, }; + gchar *str; + + client = setup_multicast_client (); + + /* simple SETUP for non-existing url */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_SETUP, + "rtsp://localhost/test2/stream=0") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_take_header (&request, GST_RTSP_HDR_CSEQ, str); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_TRANSPORT, + "RTP/AVP;multicast"); + + gst_rtsp_client_set_send_func (client, test_response_404, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + + teardown_client (client); +} + +GST_END_TEST; + +static void +new_session_cb (GObject * client, GstRTSPSession * session, gpointer user_data) +{ + GST_DEBUG ("%p: new session %p", client, session); + gst_rtsp_session_set_timeout (session, expected_session_timeout); +} + +GST_START_TEST (test_client_multicast_transport) +{ + GstRTSPClient *client; + GstRTSPMessage request = { 0, }; + gchar *str; + + client = setup_multicast_client (); + + expected_session_timeout = 20; + g_signal_connect (G_OBJECT (client), "new-session", + G_CALLBACK (new_session_cb), NULL); + + /* simple SETUP with a valid URI and multicast */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_SETUP, + "rtsp://localhost/test/stream=0") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_take_header (&request, GST_RTSP_HDR_CSEQ, str); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_TRANSPORT, + "RTP/AVP;multicast"); + + expected_transport = "RTP/AVP;multicast;destination=233.252.0.1;" + "ttl=1;port=5000-5001;mode=\"PLAY\""; + gst_rtsp_client_set_send_func (client, test_setup_response_200_multicast, + NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + expected_transport = NULL; + expected_session_timeout = 60; + + send_teardown (client); + + teardown_client (client); +} + +GST_END_TEST; + +GST_START_TEST (test_client_multicast_ignore_transport_specific) +{ + GstRTSPClient *client; + GstRTSPMessage request = { 0, }; + gchar *str; + + client = setup_multicast_client (); + + /* simple SETUP with a valid URI and multicast and a specific dest, + * but ignore it */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_SETUP, + "rtsp://localhost/test/stream=0") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_take_header (&request, GST_RTSP_HDR_CSEQ, str); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_TRANSPORT, + "RTP/AVP;multicast;destination=233.252.0.2;ttl=2;port=5001-5006;"); + + expected_transport = "RTP/AVP;multicast;destination=233.252.0.1;" + "ttl=1;port=5000-5001;mode=\"PLAY\""; + gst_rtsp_client_set_send_func (client, test_setup_response_200_multicast, + NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + expected_transport = NULL; + + send_teardown (client); + + teardown_client (client); +} + +GST_END_TEST; + +static gboolean +test_setup_response_461 (GstRTSPClient * client, + GstRTSPMessage * response, gboolean close, gpointer user_data) +{ + GstRTSPStatusCode code; + const gchar *reason; + GstRTSPVersion version; + gchar *str; + + fail_unless (expected_transport == NULL); + + fail_unless (gst_rtsp_message_get_type (response) == + GST_RTSP_MESSAGE_RESPONSE); + + fail_unless (gst_rtsp_message_parse_response (response, &code, &reason, + &version) + == GST_RTSP_OK); + fail_unless (code == GST_RTSP_STS_UNSUPPORTED_TRANSPORT); + fail_unless (g_str_equal (reason, "Unsupported transport")); + fail_unless (version == GST_RTSP_VERSION_1_0); + + fail_unless (gst_rtsp_message_get_header (response, GST_RTSP_HDR_CSEQ, &str, + 0) == GST_RTSP_OK); + fail_unless (atoi (str) == cseq++); + + + return TRUE; +} + +GST_START_TEST (test_client_multicast_invalid_transport_specific) +{ + GstRTSPClient *client; + GstRTSPMessage request = { 0, }; + gchar *str; + GstRTSPSessionPool *session_pool; + GstRTSPContext ctx = { NULL }; + + client = setup_multicast_client (); + + ctx.client = client; + ctx.auth = gst_rtsp_auth_new (); + ctx.token = + gst_rtsp_token_new (GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS, + G_TYPE_BOOLEAN, TRUE, GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, G_TYPE_STRING, + "user", NULL); + gst_rtsp_context_push_current (&ctx); + + /* simple SETUP with a valid URI and multicast, but an invalid ip */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_SETUP, + "rtsp://localhost/test/stream=0") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_take_header (&request, GST_RTSP_HDR_CSEQ, str); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_TRANSPORT, + "RTP/AVP;multicast;destination=233.252.0.2;ttl=1;port=5000-5001;"); + + gst_rtsp_client_set_send_func (client, test_setup_response_461, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + + session_pool = gst_rtsp_client_get_session_pool (client); + fail_unless (session_pool != NULL); + /* FIXME: There seems to be a leak of a session here ! */ + fail_unless (gst_rtsp_session_pool_get_n_sessions (session_pool) == 0); + g_object_unref (session_pool); + + + + /* simple SETUP with a valid URI and multicast, but an invalid prt */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_SETUP, + "rtsp://localhost/test/stream=0") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_take_header (&request, GST_RTSP_HDR_CSEQ, str); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_TRANSPORT, + "RTP/AVP;multicast;destination=233.252.0.1;ttl=1;port=6000-6001;"); + + gst_rtsp_client_set_send_func (client, test_setup_response_461, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + + session_pool = gst_rtsp_client_get_session_pool (client); + fail_unless (session_pool != NULL); + /* FIXME: There seems to be a leak of a session here ! */ + fail_unless (gst_rtsp_session_pool_get_n_sessions (session_pool) == 0); + g_object_unref (session_pool); + + + + /* simple SETUP with a valid URI and multicast, but an invalid ttl */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_SETUP, + "rtsp://localhost/test/stream=0") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_take_header (&request, GST_RTSP_HDR_CSEQ, str); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_TRANSPORT, + "RTP/AVP;multicast;destination=233.252.0.1;ttl=2;port=5000-5001;"); + + gst_rtsp_client_set_send_func (client, test_setup_response_461, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + + session_pool = gst_rtsp_client_get_session_pool (client); + fail_unless (session_pool != NULL); + /* FIXME: There seems to be a leak of a session here ! */ + fail_unless (gst_rtsp_session_pool_get_n_sessions (session_pool) == 0); + g_object_unref (session_pool); + + + teardown_client (client); + g_object_unref (ctx.auth); + gst_rtsp_token_unref (ctx.token); + gst_rtsp_context_pop_current (&ctx); +} + +GST_END_TEST; + +GST_START_TEST (test_client_multicast_transport_specific) +{ + GstRTSPClient *client; + GstRTSPMessage request = { 0, }; + gchar *str; + GstRTSPSessionPool *session_pool; + GstRTSPContext ctx = { NULL }; + + client = setup_multicast_client (); + + ctx.client = client; + ctx.auth = gst_rtsp_auth_new (); + ctx.token = + gst_rtsp_token_new (GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS, + G_TYPE_BOOLEAN, TRUE, GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, G_TYPE_STRING, + "user", NULL); + gst_rtsp_context_push_current (&ctx); + + expected_transport = "RTP/AVP;multicast;destination=233.252.0.1;" + "ttl=1;port=5000-5001;mode=\"PLAY\""; + + /* simple SETUP with a valid URI and multicast, but an invalid ip */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_SETUP, + "rtsp://localhost/test/stream=0") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_take_header (&request, GST_RTSP_HDR_CSEQ, str); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_TRANSPORT, + expected_transport); + + gst_rtsp_client_set_send_func (client, test_setup_response_200_multicast, + NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + expected_transport = NULL; + + gst_rtsp_client_set_send_func (client, test_setup_response_200_multicast, + NULL, NULL); + session_pool = gst_rtsp_client_get_session_pool (client); + fail_unless (session_pool != NULL); + fail_unless (gst_rtsp_session_pool_get_n_sessions (session_pool) == 1); + g_object_unref (session_pool); + + send_teardown (client); + + teardown_client (client); + g_object_unref (ctx.auth); + gst_rtsp_token_unref (ctx.token); + gst_rtsp_context_pop_current (&ctx); +} + +GST_END_TEST; + +static gboolean +test_response_sdp (GstRTSPClient * client, GstRTSPMessage * response, + gboolean close, gpointer user_data) +{ + guint8 *data; + guint size; + GstSDPMessage *sdp_msg; + const GstSDPMedia *sdp_media; + const GstSDPBandwidth *bw; + gint bandwidth_val = GPOINTER_TO_INT (user_data); + + fail_unless (gst_rtsp_message_get_body (response, &data, &size) + == GST_RTSP_OK); + gst_sdp_message_new (&sdp_msg); + fail_unless (gst_sdp_message_parse_buffer (data, size, sdp_msg) + == GST_SDP_OK); + + /* session description */ + /* v= */ + fail_unless (gst_sdp_message_get_version (sdp_msg) != NULL); + /* o= */ + fail_unless (gst_sdp_message_get_origin (sdp_msg) != NULL); + /* s= */ + fail_unless (gst_sdp_message_get_session_name (sdp_msg) != NULL); + /* t=0 0 */ + fail_unless (gst_sdp_message_times_len (sdp_msg) == 0); + + /* verify number of medias */ + fail_unless (gst_sdp_message_medias_len (sdp_msg) == 1); + + /* media description */ + sdp_media = gst_sdp_message_get_media (sdp_msg, 0); + fail_unless (sdp_media != NULL); + + /* m= */ + fail_unless (gst_sdp_media_get_media (sdp_media) != NULL); + + /* media bandwidth */ + if (bandwidth_val) { + fail_unless (gst_sdp_media_bandwidths_len (sdp_media) == 1); + bw = gst_sdp_media_get_bandwidth (sdp_media, 0); + fail_unless (bw != NULL); + fail_unless (g_strcmp0 (bw->bwtype, "AS") == 0); + fail_unless (bw->bandwidth == bandwidth_val); + } else { + fail_unless (gst_sdp_media_bandwidths_len (sdp_media) == 0); + } + + gst_sdp_message_free (sdp_msg); + + return TRUE; +} + +static void +test_client_sdp (const gchar * launch_line, guint * bandwidth_val) +{ + GstRTSPClient *client; + GstRTSPMessage request = { 0, }; + gchar *str; + + /* simple DESCRIBE for an existing url */ + client = setup_client (launch_line); + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_DESCRIBE, + "rtsp://localhost/test") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_CSEQ, str); + g_free (str); + + gst_rtsp_client_set_send_func (client, test_response_sdp, + (gpointer) bandwidth_val, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + + teardown_client (client); +} + +GST_START_TEST (test_client_sdp_with_max_bitrate_tag) +{ + test_client_sdp ("videotestsrc " + "! taginject tags=\"maximum-bitrate=(uint)50000000\" " + "! video/x-raw,width=352,height=288 ! rtpgstpay name=pay0 pt=96", + GUINT_TO_POINTER (50000)); + + + /* max-bitrate=0: no bandwidth line */ + test_client_sdp ("videotestsrc " + "! taginject tags=\"maximum-bitrate=(uint)0\" " + "! video/x-raw,width=352,height=288 ! rtpgstpay name=pay0 pt=96", + GUINT_TO_POINTER (0)); +} + +GST_END_TEST; + +GST_START_TEST (test_client_sdp_with_bitrate_tag) +{ + test_client_sdp ("videotestsrc " + "! taginject tags=\"bitrate=(uint)7000000\" " + "! video/x-raw,width=352,height=288 ! rtpgstpay name=pay0 pt=96", + GUINT_TO_POINTER (7000)); + + /* bitrate=0: no bandwdith line */ + test_client_sdp ("videotestsrc " + "! taginject tags=\"bitrate=(uint)0\" " + "! video/x-raw,width=352,height=288 ! rtpgstpay name=pay0 pt=96", + GUINT_TO_POINTER (0)); +} + +GST_END_TEST; + +GST_START_TEST (test_client_sdp_with_max_bitrate_and_bitrate_tags) +{ + test_client_sdp ("videotestsrc " + "! taginject tags=\"bitrate=(uint)7000000,maximum-bitrate=(uint)50000000\" " + "! video/x-raw,width=352,height=288 ! rtpgstpay name=pay0 pt=96", + GUINT_TO_POINTER (50000)); + + /* max-bitrate is zero: fallback to bitrate */ + test_client_sdp ("videotestsrc " + "! taginject tags=\"bitrate=(uint)7000000,maximum-bitrate=(uint)0\" " + "! video/x-raw,width=352,height=288 ! rtpgstpay name=pay0 pt=96", + GUINT_TO_POINTER (7000)); + + /* max-bitrate=bitrate=0o: no bandwidth line */ + test_client_sdp ("videotestsrc " + "! taginject tags=\"bitrate=(uint)0,maximum-bitrate=(uint)0\" " + "! video/x-raw,width=352,height=288 ! rtpgstpay name=pay0 pt=96", + GUINT_TO_POINTER (0)); +} + +GST_END_TEST; + +GST_START_TEST (test_client_sdp_with_no_bitrate_tags) +{ + test_client_sdp ("videotestsrc " + "! video/x-raw,width=352,height=288 ! rtpgstpay name=pay0 pt=96", NULL); +} + +GST_END_TEST; + +static Suite * +rtspclient_suite (void) +{ + Suite *s = suite_create ("rtspclient"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_set_timeout (tc, 20); + tcase_add_test (tc, test_request); + tcase_add_test (tc, test_options); + tcase_add_test (tc, test_describe); + tcase_add_test (tc, test_client_multicast_transport_404); + tcase_add_test (tc, test_client_multicast_transport); + tcase_add_test (tc, test_client_multicast_ignore_transport_specific); + tcase_add_test (tc, test_client_multicast_invalid_transport_specific); + tcase_add_test (tc, test_client_multicast_transport_specific); + tcase_add_test (tc, test_client_sdp_with_max_bitrate_tag); + tcase_add_test (tc, test_client_sdp_with_bitrate_tag); + tcase_add_test (tc, test_client_sdp_with_max_bitrate_and_bitrate_tags); + tcase_add_test (tc, test_client_sdp_with_no_bitrate_tags); + + return s; +} + +GST_CHECK_MAIN (rtspclient); diff --git a/tests/check/gst/media.c b/tests/check/gst/media.c new file mode 100644 index 0000000..c7d680e --- /dev/null +++ b/tests/check/gst/media.c @@ -0,0 +1,434 @@ +/* GStreamer + * Copyright (C) 2012 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +GST_START_TEST (test_launch) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url; + GstRTSPStream *stream; + GstRTSPTimeRange *range; + gchar *str; + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + fail_unless (gst_rtsp_media_n_streams (media) == 1); + + stream = gst_rtsp_media_get_stream (media, 0); + fail_unless (stream != NULL); + + /* fails, need to be prepared */ + str = gst_rtsp_media_get_range_string (media, FALSE, GST_RTSP_RANGE_NPT); + fail_unless (str == NULL); + + fail_unless (gst_rtsp_range_parse ("npt=5.0-", &range) == GST_RTSP_OK); + /* fails, need to be prepared */ + fail_if (gst_rtsp_media_seek (media, range)); + + pool = gst_rtsp_thread_pool_new (); + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + + fail_unless (gst_rtsp_media_prepare (media, thread)); + + str = gst_rtsp_media_get_range_string (media, FALSE, GST_RTSP_RANGE_NPT); + fail_unless (g_str_equal (str, "npt=0-")); + g_free (str); + + str = gst_rtsp_media_get_range_string (media, TRUE, GST_RTSP_RANGE_NPT); + fail_unless (g_str_equal (str, "npt=0-")); + g_free (str); + + fail_unless (gst_rtsp_media_seek (media, range)); + + str = gst_rtsp_media_get_range_string (media, FALSE, GST_RTSP_RANGE_NPT); + fail_unless (g_str_equal (str, "npt=5-")); + g_free (str); + + str = gst_rtsp_media_get_range_string (media, TRUE, GST_RTSP_RANGE_NPT); + fail_unless (g_str_equal (str, "npt=5-")); + g_free (str); + + fail_unless (gst_rtsp_media_unprepare (media)); + + /* should fail again */ + str = gst_rtsp_media_get_range_string (media, FALSE, GST_RTSP_RANGE_NPT); + fail_unless (str == NULL); + fail_if (gst_rtsp_media_seek (media, range)); + + gst_rtsp_range_free (range); + g_object_unref (media); + + gst_rtsp_url_free (url); + g_object_unref (factory); + + g_object_unref (pool); + + gst_rtsp_thread_pool_cleanup (); +} + +GST_END_TEST; + +GST_START_TEST (test_media) +{ + GstRTSPMedia *media; + GstElement *bin, *e1, *e2; + + bin = gst_bin_new ("bin"); + fail_if (bin == NULL); + + e1 = gst_element_factory_make ("videotestsrc", NULL); + fail_if (e1 == NULL); + + e2 = gst_element_factory_make ("rtpvrawpay", "pay0"); + fail_if (e2 == NULL); + g_object_set (e2, "pt", 96, NULL); + + gst_bin_add_many (GST_BIN_CAST (bin), e1, e2, NULL); + gst_element_link_many (e1, e2, NULL); + + media = gst_rtsp_media_new (bin); + fail_unless (GST_IS_RTSP_MEDIA (media)); + g_object_unref (media); +} + +GST_END_TEST; + +static void +test_prepare_reusable (GstRTSPThreadPool * pool, const gchar * launch_line) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url; + GstRTSPThread *thread; + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, launch_line); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + fail_unless (gst_rtsp_media_n_streams (media) == 1); + + g_object_set (G_OBJECT (media), "reusable", TRUE, NULL); + + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + fail_unless (gst_rtsp_media_prepare (media, thread)); + fail_unless (gst_rtsp_media_unprepare (media)); + fail_unless (gst_rtsp_media_n_streams (media) == 1); + + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + fail_unless (gst_rtsp_media_prepare (media, thread)); + fail_unless (gst_rtsp_media_unprepare (media)); + + g_object_unref (media); + gst_rtsp_url_free (url); + g_object_unref (factory); +} + +GST_START_TEST (test_media_prepare) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url; + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + + pool = gst_rtsp_thread_pool_new (); + + /* test non-reusable media first */ + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + fail_unless (gst_rtsp_media_n_streams (media) == 1); + + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + fail_unless (gst_rtsp_media_prepare (media, thread)); + fail_unless (gst_rtsp_media_unprepare (media)); + fail_unless (gst_rtsp_media_n_streams (media) == 1); + + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + fail_if (gst_rtsp_media_prepare (media, thread)); + + g_object_unref (media); + gst_rtsp_url_free (url); + g_object_unref (factory); + + /* test reusable media */ + test_prepare_reusable (pool, "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + test_prepare_reusable (pool, + "( videotestsrc is-live=true ! rtpvrawpay pt=96 name=pay0 )"); + + g_object_unref (pool); + gst_rtsp_thread_pool_cleanup (); +} + +GST_END_TEST; + +static void +on_notify_caps (GstPad * pad, GParamSpec * pspec, GstElement * pay) +{ + GstCaps *caps; + static gboolean have_caps = FALSE; + + g_object_get (pad, "caps", &caps, NULL); + + GST_DEBUG ("notify %" GST_PTR_FORMAT, caps); + + if (caps) { + if (!have_caps) { + g_signal_emit_by_name (pay, "pad-added", pad); + g_signal_emit_by_name (pay, "no-more-pads", NULL); + have_caps = TRUE; + } + gst_caps_unref (caps); + } else { + if (have_caps) { + g_signal_emit_by_name (pay, "pad-removed", pad); + have_caps = FALSE; + } + } +} + +GST_START_TEST (test_media_dyn_prepare) +{ + GstRTSPMedia *media; + GstElement *bin, *src, *pay; + GstElement *pipeline; + GstPad *srcpad; + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + + bin = gst_bin_new ("bin"); + fail_if (bin == NULL); + + src = gst_element_factory_make ("videotestsrc", NULL); + fail_if (src == NULL); + + pay = gst_element_factory_make ("rtpvrawpay", "dynpay0"); + fail_if (pay == NULL); + g_object_set (pay, "pt", 96, NULL); + + gst_bin_add_many (GST_BIN_CAST (bin), src, pay, NULL); + gst_element_link_many (src, pay, NULL); + + media = gst_rtsp_media_new (bin); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + g_object_set (G_OBJECT (media), "reusable", TRUE, NULL); + + pipeline = gst_pipeline_new ("media-pipeline"); + gst_rtsp_media_take_pipeline (media, GST_PIPELINE_CAST (pipeline)); + + gst_rtsp_media_collect_streams (media); + + srcpad = gst_element_get_static_pad (pay, "src"); + + g_signal_connect (srcpad, "notify::caps", (GCallback) on_notify_caps, pay); + + pool = gst_rtsp_thread_pool_new (); + + fail_unless (gst_rtsp_media_n_streams (media) == 0); + + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + fail_unless (gst_rtsp_media_prepare (media, thread)); + fail_unless (gst_rtsp_media_n_streams (media) == 1); + fail_unless (gst_rtsp_media_unprepare (media)); + fail_unless (gst_rtsp_media_n_streams (media) == 0); + + fail_unless (gst_rtsp_media_n_streams (media) == 0); + + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + fail_unless (gst_rtsp_media_prepare (media, thread)); + fail_unless (gst_rtsp_media_n_streams (media) == 1); + fail_unless (gst_rtsp_media_unprepare (media)); + fail_unless (gst_rtsp_media_n_streams (media) == 0); + + gst_object_unref (srcpad); + g_object_unref (media); + g_object_unref (pool); + + gst_rtsp_thread_pool_cleanup (); +} + +GST_END_TEST; + +GST_START_TEST (test_media_prepare_port_alloc_fail) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url; + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + GstRTSPAddressPool *addrpool; + + pool = gst_rtsp_thread_pool_new (); + + factory = gst_rtsp_media_factory_new (); + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( fakesrc is-live=true ! text/plain ! rtpgstpay name=pay0 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + addrpool = gst_rtsp_address_pool_new (); + fail_unless (gst_rtsp_address_pool_add_range (addrpool, "192.168.1.1", + "192.168.1.1", 6000, 6001, 0)); + gst_rtsp_media_set_address_pool (media, addrpool); + + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + fail_if (gst_rtsp_media_prepare (media, thread)); + + g_object_unref (media); + g_object_unref (addrpool); + gst_rtsp_url_free (url); + g_object_unref (factory); + g_object_unref (pool); +} + +GST_END_TEST; + +GST_START_TEST (test_media_take_pipeline) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url; + GstElement *pipeline; + + factory = gst_rtsp_media_factory_new (); + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + gst_rtsp_media_factory_set_launch (factory, + "( fakesrc ! text/plain ! rtpgstpay name=pay0 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + pipeline = gst_pipeline_new ("media-pipeline"); + gst_rtsp_media_take_pipeline (media, GST_PIPELINE_CAST (pipeline)); + + g_object_unref (media); + gst_rtsp_url_free (url); + g_object_unref (factory); +} + +GST_END_TEST; + +GST_START_TEST (test_media_reset) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url; + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + + pool = gst_rtsp_thread_pool_new (); + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + gst_rtsp_url_parse ("rtsp://localhost:8554/test", &url); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + fail_unless (gst_rtsp_media_prepare (media, thread)); + fail_unless (gst_rtsp_media_suspend (media)); + fail_unless (gst_rtsp_media_unprepare (media)); + g_object_unref (media); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + gst_rtsp_media_set_suspend_mode (media, GST_RTSP_SUSPEND_MODE_RESET); + fail_unless (gst_rtsp_media_prepare (media, thread)); + fail_unless (gst_rtsp_media_suspend (media)); + fail_unless (gst_rtsp_media_unprepare (media)); + g_object_unref (media); + + gst_rtsp_url_free (url); + g_object_unref (factory); + g_object_unref (pool); + + gst_rtsp_thread_pool_cleanup (); +} + +GST_END_TEST; + +static Suite * +rtspmedia_suite (void) +{ + Suite *s = suite_create ("rtspmedia"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_set_timeout (tc, 20); + tcase_add_test (tc, test_launch); + tcase_add_test (tc, test_media); + tcase_add_test (tc, test_media_prepare); + tcase_add_test (tc, test_media_dyn_prepare); + tcase_add_test (tc, test_media_prepare_port_alloc_fail); + tcase_add_test (tc, test_media_take_pipeline); + tcase_add_test (tc, test_media_reset); + + return s; +} + +GST_CHECK_MAIN (rtspmedia); diff --git a/tests/check/gst/mediafactory.c b/tests/check/gst/mediafactory.c new file mode 100644 index 0000000..b6b250b --- /dev/null +++ b/tests/check/gst/mediafactory.c @@ -0,0 +1,336 @@ +/* GStreamer + * Copyright (C) 2012 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +GST_START_TEST (test_parse_error) +{ + GstRTSPMediaFactory *factory; + GstRTSPUrl *url; + + factory = gst_rtsp_media_factory_new (); + + gst_rtsp_media_factory_set_launch (factory, "foo"); + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + ASSERT_CRITICAL (gst_rtsp_media_factory_create_element (factory, url)); + ASSERT_CRITICAL (gst_rtsp_media_factory_construct (factory, url)); + + gst_rtsp_url_free (url); + g_object_unref (factory); +} + +GST_END_TEST; + +GST_START_TEST (test_launch) +{ + GstRTSPMediaFactory *factory; + GstElement *element; + GstRTSPUrl *url; + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + + element = gst_rtsp_media_factory_create_element (factory, url); + fail_unless (GST_IS_BIN (element)); + fail_if (GST_IS_PIPELINE (element)); + gst_object_unref (element); + + gst_rtsp_url_free (url); + g_object_unref (factory); +} + +GST_END_TEST; + +GST_START_TEST (test_launch_construct) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media, *media2; + GstRTSPUrl *url; + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + media2 = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media2)); + fail_if (media == media2); + + g_object_unref (media); + g_object_unref (media2); + + gst_rtsp_url_free (url); + g_object_unref (factory); +} + +GST_END_TEST; + +GST_START_TEST (test_shared) +{ + GstRTSPMediaFactory *factory; + GstElement *element; + GstRTSPMedia *media, *media2; + GstRTSPUrl *url; + + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_shared (factory, TRUE); + fail_unless (gst_rtsp_media_factory_is_shared (factory)); + + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + + element = gst_rtsp_media_factory_create_element (factory, url); + fail_unless (GST_IS_BIN (element)); + fail_if (GST_IS_PIPELINE (element)); + gst_object_unref (element); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + media2 = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media2)); + fail_unless (media == media2); + + g_object_unref (media); + g_object_unref (media2); + + gst_rtsp_url_free (url); + g_object_unref (factory); +} + +GST_END_TEST; + +GST_START_TEST (test_addresspool) +{ + GstRTSPMediaFactory *factory; + GstElement *element; + GstRTSPMedia *media; + GstRTSPUrl *url; + GstRTSPAddressPool *pool, *tmppool; + GstRTSPStream *stream; + GstRTSPAddress *addr; + + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_shared (factory, TRUE); + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 " + " audiotestsrc ! audioconvert ! rtpL16pay name=pay1 )"); + + pool = gst_rtsp_address_pool_new (); + fail_unless (gst_rtsp_address_pool_add_range (pool, + "233.252.0.1", "233.252.0.1", 5000, 5001, 3)); + + gst_rtsp_media_factory_set_address_pool (factory, pool); + + tmppool = gst_rtsp_media_factory_get_address_pool (factory); + fail_unless (pool == tmppool); + g_object_unref (tmppool); + + element = gst_rtsp_media_factory_create_element (factory, url); + fail_unless (GST_IS_BIN (element)); + fail_if (GST_IS_PIPELINE (element)); + gst_object_unref (element); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + tmppool = gst_rtsp_media_get_address_pool (media); + fail_unless (pool == tmppool); + g_object_unref (tmppool); + + fail_unless (gst_rtsp_media_n_streams (media) == 2); + + stream = gst_rtsp_media_get_stream (media, 0); + fail_unless (stream != NULL); + + tmppool = gst_rtsp_stream_get_address_pool (stream); + fail_unless (pool == tmppool); + g_object_unref (tmppool); + + addr = gst_rtsp_stream_get_multicast_address (stream, G_SOCKET_FAMILY_IPV4); + fail_unless (addr != NULL); + fail_unless (addr->port == 5000); + fail_unless (addr->n_ports == 2); + fail_unless (addr->ttl == 3); + gst_rtsp_address_free (addr); + + stream = gst_rtsp_media_get_stream (media, 1); + fail_unless (stream != NULL); + + tmppool = gst_rtsp_stream_get_address_pool (stream); + fail_unless (pool == tmppool); + g_object_unref (tmppool); + + addr = gst_rtsp_stream_get_multicast_address (stream, G_SOCKET_FAMILY_IPV4); + fail_unless (addr == NULL); + + + g_object_unref (media); + + g_object_unref (pool); + gst_rtsp_url_free (url); + g_object_unref (factory); +} + +GST_END_TEST; + +GST_START_TEST (test_permissions) +{ + GstRTSPMediaFactory *factory; + GstRTSPPermissions *perms; + GstRTSPMedia *media; + GstRTSPUrl *url; + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + + gst_rtsp_media_factory_add_role (factory, "admin", + "media.factory.access", G_TYPE_BOOLEAN, TRUE, + "media.factory.construct", G_TYPE_BOOLEAN, TRUE, NULL); + + perms = gst_rtsp_media_factory_get_permissions (factory); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "admin", + "media.factory.access")); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "admin", + "media.factory.construct")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "missing", + "media.factory.access")); + gst_rtsp_permissions_unref (perms); + + perms = gst_rtsp_permissions_new (); + gst_rtsp_permissions_add_role (perms, "user", + "media.factory.access", G_TYPE_BOOLEAN, TRUE, + "media.factory.construct", G_TYPE_BOOLEAN, FALSE, NULL); + gst_rtsp_media_factory_set_permissions (factory, perms); + gst_rtsp_permissions_unref (perms); + + perms = gst_rtsp_media_factory_get_permissions (factory); + fail_if (gst_rtsp_permissions_is_allowed (perms, "admin", + "media.factory.access")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "admin", + "media.factory.construct")); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "user", + "media.factory.access")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "user", + "media.factory.construct")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "missing", + "media.factory.access")); + gst_rtsp_permissions_unref (perms); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + perms = gst_rtsp_media_get_permissions (media); + fail_if (gst_rtsp_permissions_is_allowed (perms, "admin", + "media.factory.access")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "admin", + "media.factory.construct")); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "user", + "media.factory.access")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "user", + "media.factory.construct")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "missing", + "media.factory.access")); + gst_rtsp_permissions_unref (perms); + g_object_unref (media); + + gst_rtsp_url_free (url); + g_object_unref (factory); +} + +GST_END_TEST; + +GST_START_TEST (test_reset) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url; + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + gst_rtsp_url_parse ("rtsp://localhost:8554/test", &url); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + fail_if (gst_rtsp_media_get_suspend_mode (media) != + GST_RTSP_SUSPEND_MODE_NONE); + g_object_unref (media); + + gst_rtsp_media_factory_set_suspend_mode (factory, + GST_RTSP_SUSPEND_MODE_RESET); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + fail_if (gst_rtsp_media_get_suspend_mode (media) != + GST_RTSP_SUSPEND_MODE_RESET); + g_object_unref (media); + + gst_rtsp_url_free (url); + g_object_unref (factory); +} + +GST_END_TEST; + +static Suite * +rtspmediafactory_suite (void) +{ + Suite *s = suite_create ("rtspmediafactory"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_set_timeout (tc, 20); + tcase_add_test (tc, test_parse_error); + tcase_add_test (tc, test_launch); + tcase_add_test (tc, test_launch_construct); + tcase_add_test (tc, test_shared); + tcase_add_test (tc, test_addresspool); + tcase_add_test (tc, test_permissions); + tcase_add_test (tc, test_reset); + + return s; +} + +GST_CHECK_MAIN (rtspmediafactory); diff --git a/tests/check/gst/mountpoints.c b/tests/check/gst/mountpoints.c new file mode 100644 index 0000000..31a223e --- /dev/null +++ b/tests/check/gst/mountpoints.c @@ -0,0 +1,147 @@ +/* GStreamer + * Copyright (C) 2012 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +GST_START_TEST (test_create) +{ + GstRTSPMountPoints *mounts; + GstRTSPUrl *url, *url2; + GstRTSPMediaFactory *factory; + + mounts = gst_rtsp_mount_points_new (); + + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test", + &url) == GST_RTSP_OK); + fail_unless (gst_rtsp_url_parse ("rtsp://localhost:8554/test2", + &url2) == GST_RTSP_OK); + + fail_unless (gst_rtsp_mount_points_match (mounts, url->abspath, + NULL) == NULL); + + factory = gst_rtsp_media_factory_new (); + gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + + fail_unless (gst_rtsp_mount_points_match (mounts, url->abspath, + NULL) == factory); + g_object_unref (factory); + fail_unless (gst_rtsp_mount_points_match (mounts, url2->abspath, + NULL) == NULL); + + gst_rtsp_mount_points_remove_factory (mounts, "/test"); + + fail_unless (gst_rtsp_mount_points_match (mounts, url->abspath, + NULL) == NULL); + fail_unless (gst_rtsp_mount_points_match (mounts, url2->abspath, + NULL) == NULL); + + gst_rtsp_url_free (url); + gst_rtsp_url_free (url2); + + g_object_unref (mounts); +} + +GST_END_TEST; + +static const gchar *paths[] = { + "/test", + "/booz/fooz", + "/booz/foo/zoop", + "/tark/bar", + "/tark/bar/baz", + "/tark/bar/baz/t", + "/boozop", +}; + +GST_START_TEST (test_match) +{ + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *f[G_N_ELEMENTS (paths)], *tmp; + gint i, matched; + + mounts = gst_rtsp_mount_points_new (); + + for (i = 0; i < G_N_ELEMENTS (paths); i++) { + f[i] = gst_rtsp_media_factory_new (); + gst_rtsp_mount_points_add_factory (mounts, paths[i], f[i]); + } + + tmp = gst_rtsp_mount_points_match (mounts, "/test", &matched); + fail_unless (tmp == f[0]); + fail_unless (matched == 5); + g_object_unref (tmp); + tmp = gst_rtsp_mount_points_match (mounts, "/test/stream=1", &matched); + fail_unless (tmp == f[0]); + fail_unless (matched == 5); + g_object_unref (tmp); + tmp = gst_rtsp_mount_points_match (mounts, "/booz", &matched); + fail_unless (tmp == NULL); + tmp = gst_rtsp_mount_points_match (mounts, "/booz/foo", &matched); + fail_unless (tmp == NULL); + tmp = gst_rtsp_mount_points_match (mounts, "/booz/fooz", &matched); + fail_unless (tmp == f[1]); + fail_unless (matched == 10); + g_object_unref (tmp); + tmp = gst_rtsp_mount_points_match (mounts, "/booz/fooz/zoo", &matched); + fail_unless (tmp == f[1]); + fail_unless (matched == 10); + g_object_unref (tmp); + tmp = gst_rtsp_mount_points_match (mounts, "/booz/foo/zoop", &matched); + fail_unless (tmp == f[2]); + fail_unless (matched == 14); + g_object_unref (tmp); + tmp = gst_rtsp_mount_points_match (mounts, "/tark/bar", &matched); + fail_unless (tmp == f[3]); + fail_unless (matched == 9); + g_object_unref (tmp); + tmp = gst_rtsp_mount_points_match (mounts, "/tark/bar/boo", &matched); + fail_unless (tmp == f[3]); + fail_unless (matched == 9); + g_object_unref (tmp); + tmp = gst_rtsp_mount_points_match (mounts, "/tark/bar/ba", &matched); + fail_unless (tmp == f[3]); + fail_unless (matched == 9); + g_object_unref (tmp); + tmp = gst_rtsp_mount_points_match (mounts, "/tark/bar/baz", &matched); + fail_unless (tmp == f[4]); + fail_unless (matched == 13); + g_object_unref (tmp); + + g_object_unref (mounts); +} + +GST_END_TEST; + +static Suite * +rtspmountpoints_suite (void) +{ + Suite *s = suite_create ("rtspmountpoints"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_set_timeout (tc, 20); + tcase_add_test (tc, test_create); + tcase_add_test (tc, test_match); + + return s; +} + +GST_CHECK_MAIN (rtspmountpoints); diff --git a/tests/check/gst/permissions.c b/tests/check/gst/permissions.c new file mode 100644 index 0000000..0dcf770 --- /dev/null +++ b/tests/check/gst/permissions.c @@ -0,0 +1,107 @@ +/* GStreamer + * Copyright (C) 2013 Sebastian Rasmussen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +GST_START_TEST (test_permissions) +{ + GstRTSPPermissions *perms; + GstRTSPPermissions *copy; + + perms = gst_rtsp_permissions_new (); + fail_if (gst_rtsp_permissions_is_allowed (perms, "missing", "permission1")); + gst_rtsp_permissions_unref (perms); + + perms = gst_rtsp_permissions_new (); + gst_rtsp_permissions_add_role (perms, "user", + "permission1", G_TYPE_BOOLEAN, TRUE, + "permission2", G_TYPE_BOOLEAN, FALSE, NULL); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "user", "permission1")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "user", "permission2")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "user", "missing")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "missing", "permission1")); + copy = GST_RTSP_PERMISSIONS (gst_mini_object_copy (GST_MINI_OBJECT (perms))); + gst_rtsp_permissions_unref (perms); + fail_unless (gst_rtsp_permissions_is_allowed (copy, "user", "permission1")); + fail_if (gst_rtsp_permissions_is_allowed (copy, "user", "permission2")); + gst_rtsp_permissions_unref (copy); + + perms = gst_rtsp_permissions_new (); + gst_rtsp_permissions_add_role (perms, "admin", + "permission1", G_TYPE_BOOLEAN, TRUE, + "permission2", G_TYPE_BOOLEAN, TRUE, NULL); + gst_rtsp_permissions_add_role (perms, "user", + "permission1", G_TYPE_BOOLEAN, TRUE, + "permission2", G_TYPE_BOOLEAN, FALSE, NULL); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "admin", "permission1")); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "admin", "permission2")); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "user", "permission1")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "user", "permission2")); + gst_rtsp_permissions_unref (perms); + + perms = gst_rtsp_permissions_new (); + gst_rtsp_permissions_add_role (perms, "user", + "permission1", G_TYPE_BOOLEAN, TRUE, + "permission2", G_TYPE_BOOLEAN, FALSE, NULL); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "user", "permission1")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "user", "permission2")); + gst_rtsp_permissions_add_role (perms, "user", + "permission1", G_TYPE_BOOLEAN, FALSE, + "permission2", G_TYPE_BOOLEAN, TRUE, NULL); + fail_if (gst_rtsp_permissions_is_allowed (perms, "user", "permission1")); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "user", "permission2")); + gst_rtsp_permissions_unref (perms); + + perms = gst_rtsp_permissions_new (); + gst_rtsp_permissions_add_role (perms, "admin", + "permission1", G_TYPE_BOOLEAN, TRUE, + "permission2", G_TYPE_BOOLEAN, TRUE, NULL); + gst_rtsp_permissions_add_role (perms, "user", + "permission1", G_TYPE_BOOLEAN, TRUE, + "permission2", G_TYPE_BOOLEAN, FALSE, NULL); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "admin", "permission1")); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "admin", "permission2")); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "user", "permission1")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "user", "permission2")); + gst_rtsp_permissions_remove_role (perms, "user"); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "admin", "permission1")); + fail_unless (gst_rtsp_permissions_is_allowed (perms, "admin", "permission2")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "user", "permission1")); + fail_if (gst_rtsp_permissions_is_allowed (perms, "user", "permission2")); + gst_rtsp_permissions_unref (perms); +} + +GST_END_TEST; + +static Suite * +rtsppermissions_suite (void) +{ + Suite *s = suite_create ("rtsppermissions"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_set_timeout (tc, 20); + tcase_add_test (tc, test_permissions); + + return s; +} + +GST_CHECK_MAIN (rtsppermissions); diff --git a/tests/check/gst/rtspserver.c b/tests/check/gst/rtspserver.c new file mode 100644 index 0000000..28910f7 --- /dev/null +++ b/tests/check/gst/rtspserver.c @@ -0,0 +1,1454 @@ +/* GStreamer + * + * unit test for GstRTSPServer + * + * Copyright (C) 2012 Axis Communications + * @author David Svensson Fors + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include +#include +#include + +#include +#include + +#include "rtsp-server.h" + +#define VIDEO_PIPELINE "videotestsrc ! " \ + "video/x-raw,width=352,height=288 ! " \ + "rtpgstpay name=pay0 pt=96" +#define AUDIO_PIPELINE "audiotestsrc ! " \ + "audio/x-raw,rate=8000 ! " \ + "rtpgstpay name=pay1 pt=97" + +#define TEST_MOUNT_POINT "/test" +#define TEST_PROTO "RTP/AVP" +#define TEST_ENCODING "X-GST" +#define TEST_CLOCK_RATE "90000" + +/* tested rtsp server */ +static GstRTSPServer *server = NULL; + +/* tcp port that the test server listens for rtsp requests on */ +static gint test_port = 0; + +/* id of the server's source within the GMainContext */ +static guint source_id; + +/* iterate the default main loop until there are no events to dispatch */ +static void +iterate (void) +{ + while (g_main_context_iteration (NULL, FALSE)) { + GST_DEBUG ("iteration"); + } +} + +static void +get_client_ports_full (GstRTSPRange * range, GSocket ** rtp_socket, + GSocket ** rtcp_socket) +{ + GSocket *rtp = NULL; + GSocket *rtcp = NULL; + gint rtp_port = 0; + gint rtcp_port; + GInetAddress *anyaddr = g_inet_address_new_any (G_SOCKET_FAMILY_IPV4); + GSocketAddress *sockaddr; + gboolean bound; + + for (;;) { + if (rtp_port != 0) + rtp_port += 2; + + rtp = g_socket_new (G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_DATAGRAM, + G_SOCKET_PROTOCOL_UDP, NULL); + fail_unless (rtp != NULL); + + sockaddr = g_inet_socket_address_new (anyaddr, rtp_port); + fail_unless (sockaddr != NULL); + bound = g_socket_bind (rtp, sockaddr, FALSE, NULL); + g_object_unref (sockaddr); + if (!bound) { + g_object_unref (rtp); + continue; + } + + sockaddr = g_socket_get_local_address (rtp, NULL); + fail_unless (sockaddr != NULL && G_IS_INET_SOCKET_ADDRESS (sockaddr)); + rtp_port = + g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (sockaddr)); + g_object_unref (sockaddr); + + if (rtp_port % 2 != 0) { + rtp_port += 1; + g_object_unref (rtp); + continue; + } + + rtcp_port = rtp_port + 1; + + rtcp = g_socket_new (G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_DATAGRAM, + G_SOCKET_PROTOCOL_UDP, NULL); + fail_unless (rtcp != NULL); + + sockaddr = g_inet_socket_address_new (anyaddr, rtcp_port); + fail_unless (sockaddr != NULL); + bound = g_socket_bind (rtcp, sockaddr, FALSE, NULL); + g_object_unref (sockaddr); + if (!bound) { + g_object_unref (rtp); + g_object_unref (rtcp); + continue; + } + + sockaddr = g_socket_get_local_address (rtcp, NULL); + fail_unless (sockaddr != NULL && G_IS_INET_SOCKET_ADDRESS (sockaddr)); + fail_unless (rtcp_port == + g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (sockaddr))); + g_object_unref (sockaddr); + + break; + } + + range->min = rtp_port; + range->max = rtcp_port; + if (rtp_socket) + *rtp_socket = rtp; + else + g_object_unref (rtp); + if (rtcp_socket) + *rtcp_socket = rtcp; + else + g_object_unref (rtcp); + GST_DEBUG ("client_port=%d-%d", range->min, range->max); + g_object_unref (anyaddr); +} + +/* get a free rtp/rtcp client port pair */ +static void +get_client_ports (GstRTSPRange * range) +{ + get_client_ports_full (range, NULL, NULL); +} + +/* start the tested rtsp server */ +static void +start_server (void) +{ + GstRTSPMountPoints *mounts; + gchar *service; + GstRTSPMediaFactory *factory; + + mounts = gst_rtsp_server_get_mount_points (server); + + factory = gst_rtsp_media_factory_new (); + + gst_rtsp_media_factory_set_launch (factory, + "( " VIDEO_PIPELINE " " AUDIO_PIPELINE " )"); + gst_rtsp_mount_points_add_factory (mounts, TEST_MOUNT_POINT, factory); + g_object_unref (mounts); + + /* set port to any */ + gst_rtsp_server_set_service (server, "0"); + + /* attach to default main context */ + source_id = gst_rtsp_server_attach (server, NULL); + fail_if (source_id == 0); + + /* get port */ + service = gst_rtsp_server_get_service (server); + test_port = atoi (service); + fail_unless (test_port != 0); + g_free (service); + + GST_DEBUG ("rtsp server listening on port %d", test_port); +} + +/* stop the tested rtsp server */ +static void +stop_server (void) +{ + g_source_remove (source_id); + source_id = 0; + + GST_DEBUG ("rtsp server stopped"); +} + +/* create an rtsp connection to the server on test_port */ +static GstRTSPConnection * +connect_to_server (gint port, const gchar * mount_point) +{ + GstRTSPConnection *conn = NULL; + gchar *address; + gchar *uri_string; + GstRTSPUrl *url = NULL; + + address = gst_rtsp_server_get_address (server); + uri_string = g_strdup_printf ("rtsp://%s:%d%s", address, port, mount_point); + g_free (address); + fail_unless (gst_rtsp_url_parse (uri_string, &url) == GST_RTSP_OK); + g_free (uri_string); + + fail_unless (gst_rtsp_connection_create (url, &conn) == GST_RTSP_OK); + gst_rtsp_url_free (url); + + fail_unless (gst_rtsp_connection_connect (conn, NULL) == GST_RTSP_OK); + + return conn; +} + +/* create an rtsp request */ +static GstRTSPMessage * +create_request (GstRTSPConnection * conn, GstRTSPMethod method, + const gchar * control) +{ + GstRTSPMessage *request = NULL; + gchar *base_uri; + gchar *full_uri; + + base_uri = gst_rtsp_url_get_request_uri (gst_rtsp_connection_get_url (conn)); + full_uri = g_strdup_printf ("%s/%s", base_uri, control ? control : ""); + g_free (base_uri); + if (gst_rtsp_message_new_request (&request, method, full_uri) != GST_RTSP_OK) { + GST_DEBUG ("failed to create request object"); + g_free (full_uri); + return NULL; + } + g_free (full_uri); + return request; +} + +/* send an rtsp request */ +static gboolean +send_request (GstRTSPConnection * conn, GstRTSPMessage * request) +{ + if (gst_rtsp_connection_send (conn, request, NULL) != GST_RTSP_OK) { + GST_DEBUG ("failed to send request"); + return FALSE; + } + return TRUE; +} + +/* read rtsp response. response must be freed by the caller */ +static GstRTSPMessage * +read_response (GstRTSPConnection * conn) +{ + GstRTSPMessage *response = NULL; + + if (gst_rtsp_message_new (&response) != GST_RTSP_OK) { + GST_DEBUG ("failed to create response object"); + return NULL; + } + if (gst_rtsp_connection_receive (conn, response, NULL) != GST_RTSP_OK) { + GST_DEBUG ("failed to read response"); + gst_rtsp_message_free (response); + return NULL; + } + fail_unless (gst_rtsp_message_get_type (response) == + GST_RTSP_MESSAGE_RESPONSE); + return response; +} + +/* send an rtsp request and receive response. gchar** parameters are out + * parameters that have to be freed by the caller */ +static GstRTSPStatusCode +do_request_full (GstRTSPConnection * conn, GstRTSPMethod method, + const gchar * control, const gchar * session_in, const gchar * transport_in, + const gchar * range_in, const gchar * require_in, + gchar ** content_type, gchar ** content_base, gchar ** body, + gchar ** session_out, gchar ** transport_out, gchar ** range_out, + gchar ** unsupported_out) +{ + GstRTSPMessage *request; + GstRTSPMessage *response; + GstRTSPStatusCode code; + gchar *value; + + /* create request */ + request = create_request (conn, method, control); + + /* add headers */ + if (session_in) { + gst_rtsp_message_add_header (request, GST_RTSP_HDR_SESSION, session_in); + } + if (transport_in) { + gst_rtsp_message_add_header (request, GST_RTSP_HDR_TRANSPORT, transport_in); + } + if (range_in) { + gst_rtsp_message_add_header (request, GST_RTSP_HDR_RANGE, range_in); + } + if (require_in) { + gst_rtsp_message_add_header (request, GST_RTSP_HDR_REQUIRE, require_in); + } + + /* send request */ + fail_unless (send_request (conn, request)); + gst_rtsp_message_free (request); + + iterate (); + + /* read response */ + response = read_response (conn); + + /* check status line */ + gst_rtsp_message_parse_response (response, &code, NULL, NULL); + if (code != GST_RTSP_STS_OK) { + if (unsupported_out != NULL && code == GST_RTSP_STS_OPTION_NOT_SUPPORTED) { + gst_rtsp_message_get_header (response, GST_RTSP_HDR_UNSUPPORTED, + &value, 0); + *unsupported_out = g_strdup (value); + } + gst_rtsp_message_free (response); + return code; + } + + /* get information from response */ + if (content_type) { + gst_rtsp_message_get_header (response, GST_RTSP_HDR_CONTENT_TYPE, + &value, 0); + *content_type = g_strdup (value); + } + if (content_base) { + gst_rtsp_message_get_header (response, GST_RTSP_HDR_CONTENT_BASE, + &value, 0); + *content_base = g_strdup (value); + } + if (body) { + *body = g_malloc (response->body_size + 1); + strncpy (*body, (gchar *) response->body, response->body_size); + } + if (session_out) { + gst_rtsp_message_get_header (response, GST_RTSP_HDR_SESSION, &value, 0); + + value = g_strdup (value); + + /* Remove the timeout */ + if (value) { + char *pos = strchr (value, ';'); + if (pos) + *pos = 0; + } + if (session_in) { + /* check that we got the same session back */ + fail_unless (!g_strcmp0 (value, session_in)); + } + *session_out = value; + } + if (transport_out) { + gst_rtsp_message_get_header (response, GST_RTSP_HDR_TRANSPORT, &value, 0); + *transport_out = g_strdup (value); + } + if (range_out) { + gst_rtsp_message_get_header (response, GST_RTSP_HDR_RANGE, &value, 0); + *range_out = g_strdup (value); + } + + gst_rtsp_message_free (response); + return code; +} + +/* send an rtsp request and receive response. gchar** parameters are out + * parameters that have to be freed by the caller */ +static GstRTSPStatusCode +do_request (GstRTSPConnection * conn, GstRTSPMethod method, + const gchar * control, const gchar * session_in, + const gchar * transport_in, const gchar * range_in, + gchar ** content_type, gchar ** content_base, gchar ** body, + gchar ** session_out, gchar ** transport_out, gchar ** range_out) +{ + return do_request_full (conn, method, control, session_in, transport_in, + range_in, NULL, content_type, content_base, body, session_out, + transport_out, range_out, NULL); +} + +/* send an rtsp request with a method and a session, and receive response */ +static GstRTSPStatusCode +do_simple_request (GstRTSPConnection * conn, GstRTSPMethod method, + const gchar * session) +{ + return do_request (conn, method, NULL, session, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL); +} + +/* send a DESCRIBE request and receive response. returns a received + * GstSDPMessage that must be freed by the caller */ +static GstSDPMessage * +do_describe (GstRTSPConnection * conn, const gchar * mount_point) +{ + GstSDPMessage *sdp_message; + gchar *content_type; + gchar *content_base; + gchar *body; + gchar *address; + gchar *expected_content_base; + + /* send DESCRIBE request */ + fail_unless (do_request (conn, GST_RTSP_DESCRIBE, NULL, NULL, NULL, NULL, + &content_type, &content_base, &body, NULL, NULL, NULL) == + GST_RTSP_STS_OK); + + /* check response values */ + fail_unless (!g_strcmp0 (content_type, "application/sdp")); + address = gst_rtsp_server_get_address (server); + expected_content_base = + g_strdup_printf ("rtsp://%s:%d%s/", address, test_port, mount_point); + fail_unless (!g_strcmp0 (content_base, expected_content_base)); + + /* create sdp message */ + fail_unless (gst_sdp_message_new (&sdp_message) == GST_SDP_OK); + fail_unless (gst_sdp_message_parse_buffer ((guint8 *) body, + strlen (body), sdp_message) == GST_SDP_OK); + + /* clean up */ + g_free (content_type); + g_free (content_base); + g_free (body); + g_free (address); + g_free (expected_content_base); + + return sdp_message; +} + +/* send a SETUP request and receive response. if *session is not NULL, + * it is used in the request. otherwise, *session is set to a returned + * session string that must be freed by the caller. the returned + * transport must be freed by the caller. */ +static GstRTSPStatusCode +do_setup_full (GstRTSPConnection * conn, const gchar * control, + const GstRTSPRange * client_ports, const gchar * require, gchar ** session, + GstRTSPTransport ** transport, gchar ** unsupported) +{ + GstRTSPStatusCode code; + gchar *session_in = NULL; + gchar *transport_string_in = NULL; + gchar **session_out = NULL; + gchar *transport_string_out = NULL; + + /* prepare and send SETUP request */ + if (session) { + if (*session) { + session_in = *session; + } else { + session_out = session; + } + } + transport_string_in = + g_strdup_printf (TEST_PROTO ";unicast;client_port=%d-%d", + client_ports->min, client_ports->max); + code = + do_request_full (conn, GST_RTSP_SETUP, control, session_in, + transport_string_in, NULL, require, NULL, NULL, NULL, session_out, + &transport_string_out, NULL, unsupported); + g_free (transport_string_in); + + if (transport_string_out) { + /* create transport */ + fail_unless (gst_rtsp_transport_new (transport) == GST_RTSP_OK); + fail_unless (gst_rtsp_transport_parse (transport_string_out, + *transport) == GST_RTSP_OK); + g_free (transport_string_out); + } + GST_INFO ("code=%d", code); + return code; +} + +/* send a SETUP request and receive response. if *session is not NULL, + * it is used in the request. otherwise, *session is set to a returned + * session string that must be freed by the caller. the returned + * transport must be freed by the caller. */ +static GstRTSPStatusCode +do_setup (GstRTSPConnection * conn, const gchar * control, + const GstRTSPRange * client_ports, gchar ** session, + GstRTSPTransport ** transport) +{ + return do_setup_full (conn, control, client_ports, NULL, session, transport, + NULL); +} + +/* fixture setup function */ +static void +setup (void) +{ + server = gst_rtsp_server_new (); +} + +/* fixture clean-up function */ +static void +teardown (void) +{ + if (server) { + g_object_unref (server); + server = NULL; + } + test_port = 0; +} + +GST_START_TEST (test_connect) +{ + GstRTSPConnection *conn; + + start_server (); + + /* connect to server */ + conn = connect_to_server (test_port, TEST_MOUNT_POINT); + + /* clean up */ + gst_rtsp_connection_free (conn); + stop_server (); + + /* iterate so the clean-up can finish */ + iterate (); +} + +GST_END_TEST; + +GST_START_TEST (test_describe) +{ + GstRTSPConnection *conn; + GstSDPMessage *sdp_message = NULL; + const GstSDPMedia *sdp_media; + gint32 format; + gchar *expected_rtpmap; + const gchar *rtpmap; + const gchar *control_video; + const gchar *control_audio; + + start_server (); + + conn = connect_to_server (test_port, TEST_MOUNT_POINT); + + /* send DESCRIBE request */ + sdp_message = do_describe (conn, TEST_MOUNT_POINT); + + fail_unless (gst_sdp_message_medias_len (sdp_message) == 2); + + /* check video sdp */ + sdp_media = gst_sdp_message_get_media (sdp_message, 0); + fail_unless (!g_strcmp0 (gst_sdp_media_get_proto (sdp_media), TEST_PROTO)); + fail_unless (gst_sdp_media_formats_len (sdp_media) == 1); + sscanf (gst_sdp_media_get_format (sdp_media, 0), "%" G_GINT32_FORMAT, + &format); + expected_rtpmap = + g_strdup_printf ("%d " TEST_ENCODING "/" TEST_CLOCK_RATE, format); + rtpmap = gst_sdp_media_get_attribute_val (sdp_media, "rtpmap"); + fail_unless (!g_strcmp0 (rtpmap, expected_rtpmap)); + g_free (expected_rtpmap); + control_video = gst_sdp_media_get_attribute_val (sdp_media, "control"); + fail_unless (!g_strcmp0 (control_video, "stream=0")); + + /* check audio sdp */ + sdp_media = gst_sdp_message_get_media (sdp_message, 1); + fail_unless (!g_strcmp0 (gst_sdp_media_get_proto (sdp_media), TEST_PROTO)); + fail_unless (gst_sdp_media_formats_len (sdp_media) == 1); + sscanf (gst_sdp_media_get_format (sdp_media, 0), "%" G_GINT32_FORMAT, + &format); + expected_rtpmap = + g_strdup_printf ("%d " TEST_ENCODING "/" TEST_CLOCK_RATE, format); + rtpmap = gst_sdp_media_get_attribute_val (sdp_media, "rtpmap"); + fail_unless (!g_strcmp0 (rtpmap, expected_rtpmap)); + g_free (expected_rtpmap); + control_audio = gst_sdp_media_get_attribute_val (sdp_media, "control"); + fail_unless (!g_strcmp0 (control_audio, "stream=1")); + + /* clean up and iterate so the clean-up can finish */ + gst_sdp_message_free (sdp_message); + gst_rtsp_connection_free (conn); + stop_server (); + iterate (); +} + +GST_END_TEST; + +GST_START_TEST (test_describe_non_existing_mount_point) +{ + GstRTSPConnection *conn; + + start_server (); + + /* send DESCRIBE request for a non-existing mount point + * and check that we get a 404 Not Found */ + conn = connect_to_server (test_port, "/non-existing"); + fail_unless (do_simple_request (conn, GST_RTSP_DESCRIBE, NULL) + == GST_RTSP_STS_NOT_FOUND); + + /* clean up and iterate so the clean-up can finish */ + gst_rtsp_connection_free (conn); + stop_server (); + iterate (); +} + +GST_END_TEST; + +GST_START_TEST (test_setup) +{ + GstRTSPConnection *conn; + GstSDPMessage *sdp_message = NULL; + const GstSDPMedia *sdp_media; + const gchar *video_control; + const gchar *audio_control; + GstRTSPRange client_ports; + gchar *session = NULL; + GstRTSPTransport *video_transport = NULL; + GstRTSPTransport *audio_transport = NULL; + + start_server (); + + conn = connect_to_server (test_port, TEST_MOUNT_POINT); + + sdp_message = do_describe (conn, TEST_MOUNT_POINT); + + /* get control strings from DESCRIBE response */ + fail_unless (gst_sdp_message_medias_len (sdp_message) == 2); + sdp_media = gst_sdp_message_get_media (sdp_message, 0); + video_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + sdp_media = gst_sdp_message_get_media (sdp_message, 1); + audio_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + + get_client_ports (&client_ports); + + /* send SETUP request for video */ + fail_unless (do_setup (conn, video_control, &client_ports, &session, + &video_transport) == GST_RTSP_STS_OK); + GST_DEBUG ("set up video %s, got session '%s'", video_control, session); + + /* check response from SETUP */ + fail_unless (video_transport->trans == GST_RTSP_TRANS_RTP); + fail_unless (video_transport->profile == GST_RTSP_PROFILE_AVP); + fail_unless (video_transport->lower_transport == GST_RTSP_LOWER_TRANS_UDP); + fail_unless (video_transport->mode_play); + gst_rtsp_transport_free (video_transport); + + /* send SETUP request for audio */ + fail_unless (do_setup (conn, audio_control, &client_ports, &session, + &audio_transport) == GST_RTSP_STS_OK); + GST_DEBUG ("set up audio %s with session '%s'", audio_control, session); + + /* check response from SETUP */ + fail_unless (audio_transport->trans == GST_RTSP_TRANS_RTP); + fail_unless (audio_transport->profile == GST_RTSP_PROFILE_AVP); + fail_unless (audio_transport->lower_transport == GST_RTSP_LOWER_TRANS_UDP); + fail_unless (audio_transport->mode_play); + gst_rtsp_transport_free (audio_transport); + + /* send TEARDOWN request and check that we get 200 OK */ + fail_unless (do_simple_request (conn, GST_RTSP_TEARDOWN, + session) == GST_RTSP_STS_OK); + + /* clean up and iterate so the clean-up can finish */ + g_free (session); + gst_sdp_message_free (sdp_message); + gst_rtsp_connection_free (conn); + stop_server (); + iterate (); +} + +GST_END_TEST; + +GST_START_TEST (test_setup_with_require_header) +{ + GstRTSPConnection *conn; + GstSDPMessage *sdp_message = NULL; + const GstSDPMedia *sdp_media; + const gchar *video_control; + GstRTSPRange client_ports; + gchar *session = NULL; + gchar *unsupported = NULL; + GstRTSPTransport *video_transport = NULL; + + start_server (); + + conn = connect_to_server (test_port, TEST_MOUNT_POINT); + + sdp_message = do_describe (conn, TEST_MOUNT_POINT); + + /* get control strings from DESCRIBE response */ + fail_unless (gst_sdp_message_medias_len (sdp_message) == 2); + sdp_media = gst_sdp_message_get_media (sdp_message, 0); + video_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + + get_client_ports (&client_ports); + + /* send SETUP request for video, with single Require header */ + fail_unless_equals_int (do_setup_full (conn, video_control, &client_ports, + "funky-feature", &session, &video_transport, &unsupported), + GST_RTSP_STS_OPTION_NOT_SUPPORTED); + fail_unless_equals_string (unsupported, "funky-feature"); + g_free (unsupported); + unsupported = NULL; + + /* send SETUP request for video, with multiple Require headers */ + fail_unless_equals_int (do_setup_full (conn, video_control, &client_ports, + "funky-feature, foo-bar, superburst", &session, &video_transport, + &unsupported), GST_RTSP_STS_OPTION_NOT_SUPPORTED); + fail_unless_equals_string (unsupported, "funky-feature, foo-bar, superburst"); + g_free (unsupported); + unsupported = NULL; + + /* ok, just do a normal setup then (make sure that still works) */ + fail_unless_equals_int (do_setup (conn, video_control, &client_ports, + &session, &video_transport), GST_RTSP_STS_OK); + + GST_DEBUG ("set up video %s, got session '%s'", video_control, session); + + /* check response from SETUP */ + fail_unless (video_transport->trans == GST_RTSP_TRANS_RTP); + fail_unless (video_transport->profile == GST_RTSP_PROFILE_AVP); + fail_unless (video_transport->lower_transport == GST_RTSP_LOWER_TRANS_UDP); + fail_unless (video_transport->mode_play); + gst_rtsp_transport_free (video_transport); + + /* send TEARDOWN request and check that we get 200 OK */ + fail_unless (do_simple_request (conn, GST_RTSP_TEARDOWN, + session) == GST_RTSP_STS_OK); + + /* clean up and iterate so the clean-up can finish */ + g_free (session); + gst_sdp_message_free (sdp_message); + gst_rtsp_connection_free (conn); + stop_server (); + iterate (); +} + +GST_END_TEST; + +GST_START_TEST (test_setup_non_existing_stream) +{ + GstRTSPConnection *conn; + GstRTSPRange client_ports; + + start_server (); + + conn = connect_to_server (test_port, TEST_MOUNT_POINT); + + get_client_ports (&client_ports); + + /* send SETUP request with a non-existing stream and check that we get a + * 404 Not Found */ + fail_unless (do_setup (conn, "stream=7", &client_ports, NULL, + NULL) == GST_RTSP_STS_NOT_FOUND); + + /* clean up and iterate so the clean-up can finish */ + gst_rtsp_connection_free (conn); + stop_server (); + iterate (); +} + +GST_END_TEST; + +static void +receive_rtp (GSocket * socket, GSocketAddress ** addr) +{ + GstBuffer *buffer = gst_buffer_new_allocate (NULL, 65536, NULL); + + for (;;) { + gssize bytes; + GstMapInfo map = GST_MAP_INFO_INIT; + GstRTPBuffer rtpbuffer = GST_RTP_BUFFER_INIT; + + gst_buffer_map (buffer, &map, GST_MAP_WRITE); + bytes = g_socket_receive_from (socket, addr, (gchar *) map.data, + map.maxsize, NULL, NULL); + fail_unless (bytes > 0); + gst_buffer_unmap (buffer, &map); + gst_buffer_set_size (buffer, bytes); + + if (gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtpbuffer)) { + gst_rtp_buffer_unmap (&rtpbuffer); + break; + } + + if (addr) + g_clear_object (addr); + } + + gst_buffer_unref (buffer); +} + +static void +receive_rtcp (GSocket * socket, GSocketAddress ** addr, GstRTCPType type) +{ + GstBuffer *buffer = gst_buffer_new_allocate (NULL, 65536, NULL); + + for (;;) { + gssize bytes; + GstMapInfo map = GST_MAP_INFO_INIT; + + gst_buffer_map (buffer, &map, GST_MAP_WRITE); + bytes = g_socket_receive_from (socket, addr, (gchar *) map.data, + map.maxsize, NULL, NULL); + fail_unless (bytes > 0); + gst_buffer_unmap (buffer, &map); + gst_buffer_set_size (buffer, bytes); + + if (gst_rtcp_buffer_validate (buffer)) { + GstRTCPBuffer rtcpbuffer = GST_RTCP_BUFFER_INIT; + GstRTCPPacket packet; + + if (type) { + fail_unless (gst_rtcp_buffer_map (buffer, GST_MAP_READ, &rtcpbuffer)); + fail_unless (gst_rtcp_buffer_get_first_packet (&rtcpbuffer, &packet)); + do { + if (gst_rtcp_packet_get_type (&packet) == type) { + gst_rtcp_buffer_unmap (&rtcpbuffer); + goto done; + } + } while (gst_rtcp_packet_move_to_next (&packet)); + gst_rtcp_buffer_unmap (&rtcpbuffer); + } else { + break; + } + } + + if (addr) + g_clear_object (addr); + } + +done: + + gst_buffer_unref (buffer); +} + +static void +do_test_play (const gchar * range) +{ + GstRTSPConnection *conn; + GstSDPMessage *sdp_message = NULL; + const GstSDPMedia *sdp_media; + const gchar *video_control; + const gchar *audio_control; + GstRTSPRange client_port; + gchar *session = NULL; + GstRTSPTransport *video_transport = NULL; + GstRTSPTransport *audio_transport = NULL; + GSocket *rtp_socket, *rtcp_socket; + gchar *range_out = NULL; + + conn = connect_to_server (test_port, TEST_MOUNT_POINT); + + sdp_message = do_describe (conn, TEST_MOUNT_POINT); + + /* get control strings from DESCRIBE response */ + fail_unless (gst_sdp_message_medias_len (sdp_message) == 2); + sdp_media = gst_sdp_message_get_media (sdp_message, 0); + video_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + sdp_media = gst_sdp_message_get_media (sdp_message, 1); + audio_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + + get_client_ports_full (&client_port, &rtp_socket, &rtcp_socket); + + /* do SETUP for video and audio */ + fail_unless (do_setup (conn, video_control, &client_port, &session, + &video_transport) == GST_RTSP_STS_OK); + fail_unless (do_setup (conn, audio_control, &client_port, &session, + &audio_transport) == GST_RTSP_STS_OK); + + /* send PLAY request and check that we get 200 OK */ + fail_unless (do_request (conn, GST_RTSP_PLAY, NULL, session, NULL, range, + NULL, NULL, NULL, NULL, NULL, &range_out) == GST_RTSP_STS_OK); + if (range) + fail_unless_equals_string (range, range_out); + g_free (range_out); + + receive_rtp (rtp_socket, NULL); + receive_rtcp (rtcp_socket, NULL, 0); + + /* send TEARDOWN request and check that we get 200 OK */ + fail_unless (do_simple_request (conn, GST_RTSP_TEARDOWN, + session) == GST_RTSP_STS_OK); + + /* FIXME: The rtsp-server always disconnects the transport before + * sending the RTCP BYE + * receive_rtcp (rtcp_socket, NULL, GST_RTCP_TYPE_BYE); + */ + + /* clean up and iterate so the clean-up can finish */ + g_object_unref (rtp_socket); + g_object_unref (rtcp_socket); + g_free (session); + gst_rtsp_transport_free (video_transport); + gst_rtsp_transport_free (audio_transport); + gst_sdp_message_free (sdp_message); + gst_rtsp_connection_free (conn); +} + + +GST_START_TEST (test_play) +{ + start_server (); + + do_test_play (NULL); + + stop_server (); + iterate (); +} + +GST_END_TEST; + +GST_START_TEST (test_play_without_session) +{ + GstRTSPConnection *conn; + + start_server (); + + conn = connect_to_server (test_port, TEST_MOUNT_POINT); + + /* send PLAY request without a session and check that we get a + * 454 Session Not Found */ + fail_unless (do_simple_request (conn, GST_RTSP_PLAY, + NULL) == GST_RTSP_STS_SESSION_NOT_FOUND); + + /* clean up and iterate so the clean-up can finish */ + gst_rtsp_connection_free (conn); + stop_server (); + iterate (); +} + +GST_END_TEST; + +GST_START_TEST (test_bind_already_in_use) +{ + GstRTSPServer *serv; + GSocketService *service; + GError *error = NULL; + guint16 port; + gchar *port_str; + + serv = gst_rtsp_server_new (); + service = g_socket_service_new (); + + /* bind service to port */ + port = + g_socket_listener_add_any_inet_port (G_SOCKET_LISTENER (service), NULL, + &error); + g_assert_no_error (error); + + port_str = g_strdup_printf ("%d\n", port); + + /* try to bind server to the same port */ + g_object_set (serv, "service", port_str, NULL); + g_free (port_str); + + /* attach to default main context */ + fail_unless (gst_rtsp_server_attach (serv, NULL) == 0); + + /* cleanup */ + g_object_unref (serv); + g_socket_service_stop (service); + g_object_unref (service); +} + +GST_END_TEST; + + +GST_START_TEST (test_play_multithreaded) +{ + GstRTSPThreadPool *pool; + + pool = gst_rtsp_server_get_thread_pool (server); + gst_rtsp_thread_pool_set_max_threads (pool, 2); + g_object_unref (pool); + + start_server (); + + do_test_play (NULL); + + stop_server (); + iterate (); +} + +GST_END_TEST; + +enum +{ + BLOCK_ME, + BLOCKED, + UNBLOCK +}; + + +static void +media_constructed_block (GstRTSPMediaFactory * factory, + GstRTSPMedia * media, gpointer user_data) +{ + gint *block_state = user_data; + + g_mutex_lock (&check_mutex); + + *block_state = BLOCKED; + g_cond_broadcast (&check_cond); + + while (*block_state != UNBLOCK) + g_cond_wait (&check_cond, &check_mutex); + g_mutex_unlock (&check_mutex); +} + + +GST_START_TEST (test_play_multithreaded_block_in_describe) +{ + GstRTSPConnection *conn; + GstRTSPMountPoints *mounts; + GstRTSPMediaFactory *factory; + gint block_state = BLOCK_ME; + GstRTSPMessage *request; + GstRTSPMessage *response; + GstRTSPStatusCode code; + GstRTSPThreadPool *pool; + + pool = gst_rtsp_server_get_thread_pool (server); + gst_rtsp_thread_pool_set_max_threads (pool, 2); + g_object_unref (pool); + + mounts = gst_rtsp_server_get_mount_points (server); + fail_unless (mounts != NULL); + factory = gst_rtsp_media_factory_new (); + gst_rtsp_media_factory_set_launch (factory, + "( " VIDEO_PIPELINE " " AUDIO_PIPELINE " )"); + g_signal_connect (factory, "media-constructed", + G_CALLBACK (media_constructed_block), &block_state); + gst_rtsp_mount_points_add_factory (mounts, TEST_MOUNT_POINT "2", factory); + g_object_unref (mounts); + + start_server (); + + conn = connect_to_server (test_port, TEST_MOUNT_POINT "2"); + iterate (); + + /* do describe, it will not return now as we've blocked it */ + request = create_request (conn, GST_RTSP_DESCRIBE, NULL); + fail_unless (send_request (conn, request)); + gst_rtsp_message_free (request); + + g_mutex_lock (&check_mutex); + while (block_state != BLOCKED) + g_cond_wait (&check_cond, &check_mutex); + g_mutex_unlock (&check_mutex); + + /* Do a second connection while the first one is blocked */ + do_test_play (NULL); + + /* Now unblock the describe */ + g_mutex_lock (&check_mutex); + block_state = UNBLOCK; + g_cond_broadcast (&check_cond); + g_mutex_unlock (&check_mutex); + + response = read_response (conn); + gst_rtsp_message_parse_response (response, &code, NULL, NULL); + fail_unless (code == GST_RTSP_STS_OK); + gst_rtsp_message_free (response); + + + gst_rtsp_connection_free (conn); + stop_server (); + iterate (); + +} + +GST_END_TEST; + + +static void +new_session_timeout_one (GstRTSPClient * client, + GstRTSPSession * session, gpointer user_data) +{ + gst_rtsp_session_set_timeout (session, 1); + + g_signal_handlers_disconnect_by_func (client, new_session_timeout_one, + user_data); +} + +static void +session_connected_new_session_cb (GstRTSPServer * server, + GstRTSPClient * client, gpointer user_data) +{ + + g_signal_connect (client, "new-session", user_data, NULL); +} + +GST_START_TEST (test_play_multithreaded_timeout_client) +{ + GstRTSPConnection *conn; + GstSDPMessage *sdp_message = NULL; + const GstSDPMedia *sdp_media; + const gchar *video_control; + const gchar *audio_control; + GstRTSPRange client_port; + gchar *session = NULL; + GstRTSPTransport *video_transport = NULL; + GstRTSPTransport *audio_transport = NULL; + GstRTSPSessionPool *pool; + GstRTSPThreadPool *thread_pool; + + thread_pool = gst_rtsp_server_get_thread_pool (server); + gst_rtsp_thread_pool_set_max_threads (thread_pool, 2); + g_object_unref (thread_pool); + + pool = gst_rtsp_server_get_session_pool (server); + g_signal_connect (server, "client-connected", + G_CALLBACK (session_connected_new_session_cb), new_session_timeout_one); + + start_server (); + + + conn = connect_to_server (test_port, TEST_MOUNT_POINT); + + sdp_message = do_describe (conn, TEST_MOUNT_POINT); + + /* get control strings from DESCRIBE response */ + fail_unless (gst_sdp_message_medias_len (sdp_message) == 2); + sdp_media = gst_sdp_message_get_media (sdp_message, 0); + video_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + sdp_media = gst_sdp_message_get_media (sdp_message, 1); + audio_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + + get_client_ports (&client_port); + + /* do SETUP for video and audio */ + fail_unless (do_setup (conn, video_control, &client_port, &session, + &video_transport) == GST_RTSP_STS_OK); + fail_unless (do_setup (conn, audio_control, &client_port, &session, + &audio_transport) == GST_RTSP_STS_OK); + + fail_unless (gst_rtsp_session_pool_get_n_sessions (pool) == 1); + + /* send PLAY request and check that we get 200 OK */ + fail_unless (do_simple_request (conn, GST_RTSP_PLAY, + session) == GST_RTSP_STS_OK); + + sleep (7); + + fail_unless (gst_rtsp_session_pool_cleanup (pool) == 1); + fail_unless (gst_rtsp_session_pool_get_n_sessions (pool) == 0); + + /* clean up and iterate so the clean-up can finish */ + g_object_unref (pool); + g_free (session); + gst_rtsp_transport_free (video_transport); + gst_rtsp_transport_free (audio_transport); + gst_sdp_message_free (sdp_message); + gst_rtsp_connection_free (conn); + + stop_server (); + iterate (); +} + +GST_END_TEST; + + +GST_START_TEST (test_play_multithreaded_timeout_session) +{ + GstRTSPConnection *conn; + GstSDPMessage *sdp_message = NULL; + const GstSDPMedia *sdp_media; + const gchar *video_control; + const gchar *audio_control; + GstRTSPRange client_port; + gchar *session1 = NULL; + gchar *session2 = NULL; + GstRTSPTransport *video_transport = NULL; + GstRTSPTransport *audio_transport = NULL; + GstRTSPSessionPool *pool; + GstRTSPThreadPool *thread_pool; + + thread_pool = gst_rtsp_server_get_thread_pool (server); + gst_rtsp_thread_pool_set_max_threads (thread_pool, 2); + g_object_unref (thread_pool); + + pool = gst_rtsp_server_get_session_pool (server); + g_signal_connect (server, "client-connected", + G_CALLBACK (session_connected_new_session_cb), new_session_timeout_one); + + start_server (); + + + conn = connect_to_server (test_port, TEST_MOUNT_POINT); + + gst_rtsp_connection_set_remember_session_id (conn, FALSE); + + sdp_message = do_describe (conn, TEST_MOUNT_POINT); + + /* get control strings from DESCRIBE response */ + fail_unless (gst_sdp_message_medias_len (sdp_message) == 2); + sdp_media = gst_sdp_message_get_media (sdp_message, 0); + video_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + sdp_media = gst_sdp_message_get_media (sdp_message, 1); + audio_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + + get_client_ports (&client_port); + + /* do SETUP for video and audio */ + fail_unless (do_setup (conn, video_control, &client_port, &session1, + &video_transport) == GST_RTSP_STS_OK); + fail_unless (do_setup (conn, audio_control, &client_port, &session2, + &audio_transport) == GST_RTSP_STS_OK); + + fail_unless (gst_rtsp_session_pool_get_n_sessions (pool) == 2); + + /* send PLAY request and check that we get 200 OK */ + fail_unless (do_simple_request (conn, GST_RTSP_PLAY, + session1) == GST_RTSP_STS_OK); + fail_unless (do_simple_request (conn, GST_RTSP_PLAY, + session2) == GST_RTSP_STS_OK); + + sleep (7); + + fail_unless (gst_rtsp_session_pool_cleanup (pool) == 1); + + /* send TEARDOWN request and check that we get 454 Session Not found */ + fail_unless (do_simple_request (conn, GST_RTSP_TEARDOWN, + session1) == GST_RTSP_STS_SESSION_NOT_FOUND); + + fail_unless (do_simple_request (conn, GST_RTSP_TEARDOWN, + session2) == GST_RTSP_STS_OK); + + /* clean up and iterate so the clean-up can finish */ + g_object_unref (pool); + g_free (session1); + g_free (session2); + gst_rtsp_transport_free (video_transport); + gst_rtsp_transport_free (audio_transport); + gst_sdp_message_free (sdp_message); + gst_rtsp_connection_free (conn); + + stop_server (); + iterate (); +} + +GST_END_TEST; + + +GST_START_TEST (test_play_disconnect) +{ + GstRTSPConnection *conn; + GstSDPMessage *sdp_message = NULL; + const GstSDPMedia *sdp_media; + const gchar *video_control; + const gchar *audio_control; + GstRTSPRange client_port; + gchar *session = NULL; + GstRTSPTransport *video_transport = NULL; + GstRTSPTransport *audio_transport = NULL; + GstRTSPSessionPool *pool; + + pool = gst_rtsp_server_get_session_pool (server); + g_signal_connect (server, "client-connected", + G_CALLBACK (session_connected_new_session_cb), new_session_timeout_one); + + start_server (); + + conn = connect_to_server (test_port, TEST_MOUNT_POINT); + + sdp_message = do_describe (conn, TEST_MOUNT_POINT); + + /* get control strings from DESCRIBE response */ + fail_unless (gst_sdp_message_medias_len (sdp_message) == 2); + sdp_media = gst_sdp_message_get_media (sdp_message, 0); + video_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + sdp_media = gst_sdp_message_get_media (sdp_message, 1); + audio_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + + get_client_ports (&client_port); + + /* do SETUP for video and audio */ + fail_unless (do_setup (conn, video_control, &client_port, &session, + &video_transport) == GST_RTSP_STS_OK); + fail_unless (do_setup (conn, audio_control, &client_port, &session, + &audio_transport) == GST_RTSP_STS_OK); + + fail_unless (gst_rtsp_session_pool_get_n_sessions (pool) == 1); + + /* send PLAY request and check that we get 200 OK */ + fail_unless (do_simple_request (conn, GST_RTSP_PLAY, + session) == GST_RTSP_STS_OK); + + gst_rtsp_connection_free (conn); + + sleep (7); + + fail_unless (gst_rtsp_session_pool_get_n_sessions (pool) == 1); + fail_unless (gst_rtsp_session_pool_cleanup (pool) == 1); + + + /* clean up and iterate so the clean-up can finish */ + g_object_unref (pool); + g_free (session); + gst_rtsp_transport_free (video_transport); + gst_rtsp_transport_free (audio_transport); + gst_sdp_message_free (sdp_message); + + stop_server (); + iterate (); +} + +GST_END_TEST; + +/* Only different with test_play is the specific ports selected */ + +GST_START_TEST (test_play_specific_server_port) +{ + GstRTSPMountPoints *mounts; + gchar *service; + GstRTSPMediaFactory *factory; + GstRTSPAddressPool *pool; + GstRTSPConnection *conn; + GstSDPMessage *sdp_message = NULL; + const GstSDPMedia *sdp_media; + const gchar *video_control; + GstRTSPRange client_port; + gchar *session = NULL; + GstRTSPTransport *video_transport = NULL; + GSocket *rtp_socket, *rtcp_socket; + GSocketAddress *rtp_address, *rtcp_address; + guint16 rtp_port, rtcp_port; + + mounts = gst_rtsp_server_get_mount_points (server); + + factory = gst_rtsp_media_factory_new (); + pool = gst_rtsp_address_pool_new (); + gst_rtsp_address_pool_add_range (pool, GST_RTSP_ADDRESS_POOL_ANY_IPV4, + GST_RTSP_ADDRESS_POOL_ANY_IPV4, 7770, 7780, 0); + gst_rtsp_media_factory_set_address_pool (factory, pool); + g_object_unref (pool); + gst_rtsp_media_factory_set_launch (factory, "( " VIDEO_PIPELINE " )"); + gst_rtsp_mount_points_add_factory (mounts, TEST_MOUNT_POINT, factory); + g_object_unref (mounts); + + /* set port to any */ + gst_rtsp_server_set_service (server, "0"); + + /* attach to default main context */ + source_id = gst_rtsp_server_attach (server, NULL); + fail_if (source_id == 0); + + /* get port */ + service = gst_rtsp_server_get_service (server); + test_port = atoi (service); + fail_unless (test_port != 0); + g_free (service); + + GST_DEBUG ("rtsp server listening on port %d", test_port); + + + conn = connect_to_server (test_port, TEST_MOUNT_POINT); + + sdp_message = do_describe (conn, TEST_MOUNT_POINT); + + /* get control strings from DESCRIBE response */ + fail_unless (gst_sdp_message_medias_len (sdp_message) == 1); + sdp_media = gst_sdp_message_get_media (sdp_message, 0); + video_control = gst_sdp_media_get_attribute_val (sdp_media, "control"); + + get_client_ports_full (&client_port, &rtp_socket, &rtcp_socket); + + /* do SETUP for video */ + fail_unless (do_setup (conn, video_control, &client_port, &session, + &video_transport) == GST_RTSP_STS_OK); + + /* send PLAY request and check that we get 200 OK */ + fail_unless (do_simple_request (conn, GST_RTSP_PLAY, + session) == GST_RTSP_STS_OK); + + receive_rtp (rtp_socket, &rtp_address); + receive_rtcp (rtcp_socket, &rtcp_address, 0); + + fail_unless (G_IS_INET_SOCKET_ADDRESS (rtp_address)); + fail_unless (G_IS_INET_SOCKET_ADDRESS (rtcp_address)); + rtp_port = + g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (rtp_address)); + rtcp_port = + g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (rtcp_address)); + fail_unless (rtp_port >= 7770 && rtp_port <= 7780 && rtp_port % 2 == 0); + fail_unless (rtcp_port >= 7770 && rtcp_port <= 7780 && rtcp_port % 2 == 1); + fail_unless (rtp_port + 1 == rtcp_port); + + g_object_unref (rtp_address); + g_object_unref (rtcp_address); + + /* send TEARDOWN request and check that we get 200 OK */ + fail_unless (do_simple_request (conn, GST_RTSP_TEARDOWN, + session) == GST_RTSP_STS_OK); + + /* FIXME: The rtsp-server always disconnects the transport before + * sending the RTCP BYE + * receive_rtcp (rtcp_socket, NULL, GST_RTCP_TYPE_BYE); + */ + + /* clean up and iterate so the clean-up can finish */ + g_object_unref (rtp_socket); + g_object_unref (rtcp_socket); + g_free (session); + gst_rtsp_transport_free (video_transport); + gst_sdp_message_free (sdp_message); + gst_rtsp_connection_free (conn); + + + stop_server (); + iterate (); +} + +GST_END_TEST; + + +GST_START_TEST (test_play_smpte_range) +{ + start_server (); + + do_test_play ("npt=5-"); + do_test_play ("smpte=0:00:00-"); + do_test_play ("smpte=1:00:00-"); + do_test_play ("smpte=1:00:03-"); + do_test_play ("clock=20120321T152256Z-"); + + stop_server (); + iterate (); +} + +GST_END_TEST; + + +static Suite * +rtspserver_suite (void) +{ + Suite *s = suite_create ("rtspserver"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_add_checked_fixture (tc, setup, teardown); + tcase_set_timeout (tc, 20); + tcase_add_test (tc, test_connect); + tcase_add_test (tc, test_describe); + tcase_add_test (tc, test_describe_non_existing_mount_point); + tcase_add_test (tc, test_setup); + tcase_add_test (tc, test_setup_with_require_header); + tcase_add_test (tc, test_setup_non_existing_stream); + tcase_add_test (tc, test_play); + tcase_add_test (tc, test_play_without_session); + tcase_add_test (tc, test_bind_already_in_use); + tcase_add_test (tc, test_play_multithreaded); + tcase_add_test (tc, test_play_multithreaded_block_in_describe); + tcase_add_test (tc, test_play_multithreaded_timeout_client); + tcase_add_test (tc, test_play_multithreaded_timeout_session); + tcase_add_test (tc, test_play_disconnect); + tcase_add_test (tc, test_play_specific_server_port); + tcase_add_test (tc, test_play_smpte_range); + return s; +} + +GST_CHECK_MAIN (rtspserver); diff --git a/tests/check/gst/sessionmedia.c b/tests/check/gst/sessionmedia.c new file mode 100644 index 0000000..13445b4 --- /dev/null +++ b/tests/check/gst/sessionmedia.c @@ -0,0 +1,399 @@ +/* GStreamer + * Copyright (C) 2013 Branko Subasic + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include +#include + +#define TEST_PATH "rtsp://localhost:8554/test" +#define SETUP_URL1 TEST_PATH "/stream=0" +#define SETUP_URL2 TEST_PATH "/stream=1" + +GST_START_TEST (test_setup_url) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url, *setup_url; + GstRTSPStream *stream; + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + GstRTSPSessionMedia *sm; + GstRTSPStreamTransport *trans; + GstRTSPTransport *ct; + gint match_len; + gchar *url_str, *url_str2; + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + fail_unless (gst_rtsp_url_parse (TEST_PATH, &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + fail_unless (gst_rtsp_media_n_streams (media) == 1); + + stream = gst_rtsp_media_get_stream (media, 0); + fail_unless (GST_IS_RTSP_STREAM (stream)); + + pool = gst_rtsp_thread_pool_new (); + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + + fail_unless (gst_rtsp_media_prepare (media, thread)); + + /* create session media and make sure it matches test path + * note that gst_rtsp_session_media_new takes ownership of the media + * thus no need to unref it at the bottom of function */ + sm = gst_rtsp_session_media_new (TEST_PATH, media); + fail_unless (GST_IS_RTSP_SESSION_MEDIA (sm)); + fail_unless (gst_rtsp_session_media_matches (sm, TEST_PATH, &match_len)); + fail_unless (match_len == strlen (TEST_PATH)); + fail_unless (gst_rtsp_session_media_get_media (sm) == media); + + /* make a transport for the stream */ + gst_rtsp_transport_new (&ct); + trans = gst_rtsp_session_media_set_transport (sm, stream, ct); + fail_unless (gst_rtsp_session_media_get_transport (sm, 0) == trans); + + /* make sure there's no setup url stored initially */ + fail_unless (gst_rtsp_stream_transport_get_url (trans) == NULL); + + /* now store a setup url and make sure it can be retrieved and that it's correct */ + fail_unless (gst_rtsp_url_parse (SETUP_URL1, &setup_url) == GST_RTSP_OK); + gst_rtsp_stream_transport_set_url (trans, setup_url); + + url_str = gst_rtsp_url_get_request_uri (setup_url); + url_str2 = + gst_rtsp_url_get_request_uri (gst_rtsp_stream_transport_get_url (trans)); + fail_if (g_strcmp0 (url_str, url_str2) != 0); + g_free (url_str); + g_free (url_str2); + + /* check that it's ok to try to store the same url again */ + gst_rtsp_stream_transport_set_url (trans, setup_url); + + fail_unless (gst_rtsp_media_unprepare (media)); + + gst_rtsp_url_free (setup_url); + gst_rtsp_url_free (url); + + g_object_unref (sm); + + g_object_unref (factory); + g_object_unref (pool); +} + +GST_END_TEST; + +GST_START_TEST (test_rtsp_state) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url; + GstRTSPStream *stream; + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + GstRTSPSessionMedia *sm; + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + fail_unless (gst_rtsp_url_parse (TEST_PATH, &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + fail_unless (gst_rtsp_media_n_streams (media) == 1); + + stream = gst_rtsp_media_get_stream (media, 0); + fail_unless (GST_IS_RTSP_STREAM (stream)); + + pool = gst_rtsp_thread_pool_new (); + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + + fail_unless (gst_rtsp_media_prepare (media, thread)); + + sm = gst_rtsp_session_media_new (TEST_PATH, media); + fail_unless (GST_IS_RTSP_SESSION_MEDIA (sm)); + fail_unless_equals_int (gst_rtsp_session_media_get_rtsp_state (sm), + GST_RTSP_STATE_INIT); + + gst_rtsp_session_media_set_rtsp_state (sm, GST_RTSP_STATE_READY); + fail_unless_equals_int (gst_rtsp_session_media_get_rtsp_state (sm), + GST_RTSP_STATE_READY); + + gst_rtsp_session_media_set_rtsp_state (sm, GST_RTSP_STATE_SEEKING); + fail_unless_equals_int (gst_rtsp_session_media_get_rtsp_state (sm), + GST_RTSP_STATE_SEEKING); + + gst_rtsp_session_media_set_rtsp_state (sm, GST_RTSP_STATE_PLAYING); + fail_unless_equals_int (gst_rtsp_session_media_get_rtsp_state (sm), + GST_RTSP_STATE_PLAYING); + + gst_rtsp_session_media_set_rtsp_state (sm, GST_RTSP_STATE_RECORDING); + fail_unless_equals_int (gst_rtsp_session_media_get_rtsp_state (sm), + GST_RTSP_STATE_RECORDING); + + fail_unless (gst_rtsp_media_unprepare (media)); + + gst_rtsp_url_free (url); + + g_object_unref (sm); + + g_object_unref (factory); + g_object_unref (pool); +} + +GST_END_TEST; + +GST_START_TEST (test_transports) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url; + GstRTSPStream *stream1, *stream2; + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + GstRTSPSessionMedia *sm; + GstRTSPStreamTransport *trans; + GstRTSPTransport *ct1, *ct2, *ct3, *ct4; + gint match_len; + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + fail_unless (gst_rtsp_url_parse (TEST_PATH, &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 audiotestsrc ! rtpgstpay pt=97 name=pay1 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + fail_unless (gst_rtsp_media_n_streams (media) == 2); + + stream1 = gst_rtsp_media_get_stream (media, 0); + fail_unless (GST_IS_RTSP_STREAM (stream1)); + + stream2 = gst_rtsp_media_get_stream (media, 1); + fail_unless (GST_IS_RTSP_STREAM (stream2)); + + pool = gst_rtsp_thread_pool_new (); + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + + fail_unless (gst_rtsp_media_prepare (media, thread)); + + sm = gst_rtsp_session_media_new (TEST_PATH, media); + fail_unless (GST_IS_RTSP_SESSION_MEDIA (sm)); + fail_unless (gst_rtsp_session_media_matches (sm, TEST_PATH, &match_len)); + fail_unless (match_len == strlen (TEST_PATH)); + + gst_rtsp_transport_new (&ct1); + trans = gst_rtsp_session_media_set_transport (sm, stream1, ct1); + fail_unless (gst_rtsp_session_media_get_transport (sm, 0) == trans); + + gst_rtsp_transport_new (&ct2); + trans = gst_rtsp_session_media_set_transport (sm, stream1, ct2); + fail_unless (gst_rtsp_session_media_get_transport (sm, 0) == trans); + + gst_rtsp_transport_new (&ct3); + trans = gst_rtsp_session_media_set_transport (sm, stream2, ct3); + fail_unless (gst_rtsp_session_media_get_transport (sm, 1) == trans); + + gst_rtsp_transport_new (&ct4); + trans = gst_rtsp_session_media_set_transport (sm, stream2, ct4); + fail_unless (gst_rtsp_session_media_get_transport (sm, 1) == trans); + + fail_unless (gst_rtsp_media_unprepare (media)); + + gst_rtsp_url_free (url); + + g_object_unref (sm); + + g_object_unref (factory); + g_object_unref (pool); +} + +GST_END_TEST; + +GST_START_TEST (test_time_and_rtpinfo) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url; + GstRTSPStream *stream1, *stream2; + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + GstRTSPSessionMedia *sm; + GstClockTime base_time; + gchar *rtpinfo; + GstRTSPTransport *ct1; + GstRTSPStreamTransport *trans; + GstRTSPUrl *setup_url; + gchar **streaminfo; + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + fail_unless (gst_rtsp_url_parse (TEST_PATH, &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc do-timestamp=true timestamp-offset=0 ! rtpvrawpay pt=96 name=pay0 " + "audiotestsrc do-timestamp=true timestamp-offset=1000000000 ! rtpgstpay pt=97 name=pay1 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + fail_unless (gst_rtsp_media_n_streams (media) == 2); + + stream1 = gst_rtsp_media_get_stream (media, 0); + fail_unless (GST_IS_RTSP_STREAM (stream1)); + + stream2 = gst_rtsp_media_get_stream (media, 1); + fail_unless (GST_IS_RTSP_STREAM (stream2)); + + pool = gst_rtsp_thread_pool_new (); + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + + fail_unless (gst_rtsp_media_prepare (media, thread)); + + sm = gst_rtsp_session_media_new (TEST_PATH, media); + fail_unless (GST_IS_RTSP_SESSION_MEDIA (sm)); + + base_time = gst_rtsp_session_media_get_base_time (sm); + fail_unless_equals_int64 (base_time, 0); + + rtpinfo = gst_rtsp_session_media_get_rtpinfo (sm); + fail_unless (rtpinfo == NULL); + + gst_rtsp_transport_new (&ct1); + trans = gst_rtsp_session_media_set_transport (sm, stream1, ct1); + fail_unless (gst_rtsp_session_media_get_transport (sm, 0) == trans); + fail_unless (gst_rtsp_url_parse (SETUP_URL1, &setup_url) == GST_RTSP_OK); + gst_rtsp_stream_transport_set_url (trans, setup_url); + + base_time = gst_rtsp_session_media_get_base_time (sm); + fail_unless_equals_int64 (base_time, 0); + + rtpinfo = gst_rtsp_session_media_get_rtpinfo (sm); + streaminfo = g_strsplit (rtpinfo, ",", 1); + g_free (rtpinfo); + + fail_unless (g_strstr_len (streaminfo[0], -1, "url=") != NULL); + fail_unless (g_strstr_len (streaminfo[0], -1, "seq=") != NULL); + fail_unless (g_strstr_len (streaminfo[0], -1, "rtptime=") != NULL); + fail_unless (g_strstr_len (streaminfo[0], -1, SETUP_URL1) != NULL); + + g_strfreev (streaminfo); + + fail_unless (gst_rtsp_media_unprepare (media)); + + rtpinfo = gst_rtsp_session_media_get_rtpinfo (sm); + fail_unless (rtpinfo == NULL); + + gst_rtsp_url_free (setup_url); + gst_rtsp_url_free (url); + + g_object_unref (sm); + + g_object_unref (factory); + g_object_unref (pool); +} + +GST_END_TEST; + +GST_START_TEST (test_allocate_channels) +{ + GstRTSPMediaFactory *factory; + GstRTSPMedia *media; + GstRTSPUrl *url; + GstRTSPStream *stream; + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + GstRTSPSessionMedia *sm; + GstRTSPRange range; + + factory = gst_rtsp_media_factory_new (); + fail_if (gst_rtsp_media_factory_is_shared (factory)); + fail_unless (gst_rtsp_url_parse (TEST_PATH, &url) == GST_RTSP_OK); + + gst_rtsp_media_factory_set_launch (factory, + "( videotestsrc ! rtpvrawpay pt=96 name=pay0 )"); + + media = gst_rtsp_media_factory_construct (factory, url); + fail_unless (GST_IS_RTSP_MEDIA (media)); + + fail_unless (gst_rtsp_media_n_streams (media) == 1); + + stream = gst_rtsp_media_get_stream (media, 0); + fail_unless (GST_IS_RTSP_STREAM (stream)); + + pool = gst_rtsp_thread_pool_new (); + thread = gst_rtsp_thread_pool_get_thread (pool, + GST_RTSP_THREAD_TYPE_MEDIA, NULL); + + fail_unless (gst_rtsp_media_prepare (media, thread)); + + sm = gst_rtsp_session_media_new (TEST_PATH, media); + fail_unless (GST_IS_RTSP_SESSION_MEDIA (sm)); + + fail_unless (gst_rtsp_session_media_alloc_channels (sm, &range)); + fail_unless_equals_int (range.min, 0); + fail_unless_equals_int (range.max, 1); + + fail_unless (gst_rtsp_session_media_alloc_channels (sm, &range)); + fail_unless_equals_int (range.min, 2); + fail_unless_equals_int (range.max, 3); + + fail_unless (gst_rtsp_media_unprepare (media)); + + gst_rtsp_url_free (url); + + g_object_unref (sm); + + g_object_unref (factory); + g_object_unref (pool); +} + +GST_END_TEST; +static Suite * +rtspsessionmedia_suite (void) +{ + Suite *s = suite_create ("rtspsessionmedia"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_set_timeout (tc, 20); + tcase_add_test (tc, test_setup_url); + tcase_add_test (tc, test_rtsp_state); + tcase_add_test (tc, test_transports); + tcase_add_test (tc, test_time_and_rtpinfo); + tcase_add_test (tc, test_allocate_channels); + + return s; +} + +GST_CHECK_MAIN (rtspsessionmedia); diff --git a/tests/check/gst/sessionpool.c b/tests/check/gst/sessionpool.c new file mode 100644 index 0000000..c1cc149 --- /dev/null +++ b/tests/check/gst/sessionpool.c @@ -0,0 +1,197 @@ +/* GStreamer + * Copyright (C) 2014 Sebastian Rasmussen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include + +typedef struct +{ + GstRTSPSession *sessions[3]; + GstRTSPFilterResult response[3]; +} Responses; + +static GstRTSPFilterResult +filter_func (GstRTSPSessionPool * pool, GstRTSPSession * session, + gpointer user_data) +{ + Responses *responses = (Responses *) user_data; + gint i; + + for (i = 0; i < 3; i++) + if (session == responses->sessions[i]) + return responses->response[i]; + + return GST_RTSP_FILTER_KEEP; +} + +GST_START_TEST (test_pool) +{ + GstRTSPSessionPool *pool; + GstRTSPSession *session1, *session2, *session3; + GstRTSPSession *compare; + gchar *session1id, *session2id, *session3id; + GList *list; + guint maxsessions; + GSource *source; + guint sourceid; + + pool = gst_rtsp_session_pool_new (); + fail_unless_equals_int (gst_rtsp_session_pool_get_n_sessions (pool), 0); + fail_unless_equals_int (gst_rtsp_session_pool_get_max_sessions (pool), 0); + + gst_rtsp_session_pool_set_max_sessions (pool, 3); + fail_unless_equals_int (gst_rtsp_session_pool_get_max_sessions (pool), 3); + + session1 = gst_rtsp_session_pool_create (pool); + fail_unless (GST_IS_RTSP_SESSION (session1)); + fail_unless_equals_int (gst_rtsp_session_pool_get_n_sessions (pool), 1); + fail_unless_equals_int (gst_rtsp_session_pool_get_max_sessions (pool), 3); + session1id = g_strdup (gst_rtsp_session_get_sessionid (session1)); + + session2 = gst_rtsp_session_pool_create (pool); + fail_unless (GST_IS_RTSP_SESSION (session2)); + fail_unless_equals_int (gst_rtsp_session_pool_get_n_sessions (pool), 2); + fail_unless_equals_int (gst_rtsp_session_pool_get_max_sessions (pool), 3); + session2id = g_strdup (gst_rtsp_session_get_sessionid (session2)); + + session3 = gst_rtsp_session_pool_create (pool); + fail_unless (GST_IS_RTSP_SESSION (session3)); + fail_unless_equals_int (gst_rtsp_session_pool_get_n_sessions (pool), 3); + fail_unless_equals_int (gst_rtsp_session_pool_get_max_sessions (pool), 3); + session3id = g_strdup (gst_rtsp_session_get_sessionid (session3)); + + fail_if (GST_IS_RTSP_SESSION (gst_rtsp_session_pool_create (pool))); + + compare = gst_rtsp_session_pool_find (pool, session1id); + fail_unless (compare == session1); + g_object_unref (compare); + compare = gst_rtsp_session_pool_find (pool, session2id); + fail_unless (compare == session2); + g_object_unref (compare); + compare = gst_rtsp_session_pool_find (pool, session3id); + fail_unless (compare == session3); + g_object_unref (compare); + fail_unless (gst_rtsp_session_pool_find (pool, "") == NULL); + + fail_unless (gst_rtsp_session_pool_remove (pool, session2)); + g_object_unref (session2); + fail_unless_equals_int (gst_rtsp_session_pool_get_n_sessions (pool), 2); + fail_unless_equals_int (gst_rtsp_session_pool_get_max_sessions (pool), 3); + + gst_rtsp_session_pool_set_max_sessions (pool, 2); + fail_unless_equals_int (gst_rtsp_session_pool_get_n_sessions (pool), 2); + fail_unless_equals_int (gst_rtsp_session_pool_get_max_sessions (pool), 2); + + session2 = gst_rtsp_session_pool_create (pool); + fail_if (GST_IS_RTSP_SESSION (session2)); + + { + list = gst_rtsp_session_pool_filter (pool, NULL, NULL); + fail_unless_equals_int (g_list_length (list), 2); + fail_unless (g_list_find (list, session1) != NULL); + fail_unless (g_list_find (list, session3) != NULL); + g_list_free_full (list, (GDestroyNotify) g_object_unref); + } + + { + Responses responses = { + {session1, session2, session3}, + {GST_RTSP_FILTER_KEEP, GST_RTSP_FILTER_KEEP, GST_RTSP_FILTER_KEEP}, + }; + + list = gst_rtsp_session_pool_filter (pool, filter_func, &responses); + fail_unless (list == NULL); + } + + { + Responses responses = { + {session1, session2, session3}, + {GST_RTSP_FILTER_REF, GST_RTSP_FILTER_KEEP, GST_RTSP_FILTER_KEEP}, + }; + + list = gst_rtsp_session_pool_filter (pool, filter_func, &responses); + fail_unless_equals_int (g_list_length (list), 1); + fail_unless (g_list_nth_data (list, 0) == session1); + g_list_free_full (list, (GDestroyNotify) g_object_unref); + } + + { + Responses responses = { + {session1, session2, session3}, + {GST_RTSP_FILTER_KEEP, GST_RTSP_FILTER_KEEP, GST_RTSP_FILTER_REMOVE}, + }; + + list = gst_rtsp_session_pool_filter (pool, filter_func, &responses); + fail_unless_equals_int (g_list_length (list), 0); + g_list_free (list); + } + + compare = gst_rtsp_session_pool_find (pool, session1id); + fail_unless (compare == session1); + g_object_unref (compare); + fail_unless (gst_rtsp_session_pool_find (pool, session2id) == NULL); + fail_unless (gst_rtsp_session_pool_find (pool, session3id) == NULL); + + g_object_get (pool, "max-sessions", &maxsessions, NULL); + fail_unless_equals_int (maxsessions, 2); + + g_object_set (pool, "max-sessions", 3, NULL); + g_object_get (pool, "max-sessions", &maxsessions, NULL); + fail_unless_equals_int (maxsessions, 3); + + fail_unless_equals_int (gst_rtsp_session_pool_cleanup (pool), 0); + + gst_rtsp_session_set_timeout (session1, 1); + + source = gst_rtsp_session_pool_create_watch (pool); + fail_unless (source != NULL); + + sourceid = g_source_attach (source, NULL); + fail_unless (sourceid != 0); + + while (!g_main_context_iteration (NULL, TRUE)); + + g_source_unref (source); + + g_object_unref (session1); + g_object_unref (session3); + + g_free (session1id); + g_free (session2id); + g_free (session3id); + + g_object_unref (pool); +} + +GST_END_TEST; + +static Suite * +rtspsessionpool_suite (void) +{ + Suite *s = suite_create ("rtspsessionpool"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_set_timeout (tc, 15); + tcase_add_test (tc, test_pool); + + return s; +} + +GST_CHECK_MAIN (rtspsessionpool); diff --git a/tests/check/gst/stream.c b/tests/check/gst/stream.c new file mode 100644 index 0000000..582e674 --- /dev/null +++ b/tests/check/gst/stream.c @@ -0,0 +1,172 @@ +/* GStreamer + * Copyright (C) 2013 Axis Communications AB + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include +#include + +GST_START_TEST (test_get_sockets) +{ + GstPad *srcpad; + GstElement *pay; + GstRTSPStream *stream; + GstBin *bin; + GstElement *rtpbin; + GSocket *socket; + gboolean have_ipv4; + gboolean have_ipv6; + + srcpad = gst_pad_new ("testsrcpad", GST_PAD_SRC); + fail_unless (srcpad != NULL); + gst_pad_set_active (srcpad, TRUE); + pay = gst_element_factory_make ("rtpgstpay", "testpayloader"); + fail_unless (pay != NULL); + stream = gst_rtsp_stream_new (0, pay, srcpad); + fail_unless (stream != NULL); + gst_object_unref (pay); + gst_object_unref (srcpad); + rtpbin = gst_element_factory_make ("rtpbin", "testrtpbin"); + fail_unless (rtpbin != NULL); + bin = GST_BIN (gst_bin_new ("testbin")); + fail_unless (bin != NULL); + fail_unless (gst_bin_add (bin, rtpbin)); + + fail_unless (gst_rtsp_stream_join_bin (stream, bin, rtpbin, GST_STATE_NULL)); + + socket = gst_rtsp_stream_get_rtp_socket (stream, G_SOCKET_FAMILY_IPV4); + have_ipv4 = (socket != NULL); + if (have_ipv4) { + fail_unless (g_socket_get_fd (socket) >= 0); + g_object_unref (socket); + } + + socket = gst_rtsp_stream_get_rtcp_socket (stream, G_SOCKET_FAMILY_IPV4); + if (have_ipv4) { + fail_unless (socket != NULL); + fail_unless (g_socket_get_fd (socket) >= 0); + g_object_unref (socket); + } else { + fail_unless (socket == NULL); + } + + socket = gst_rtsp_stream_get_rtp_socket (stream, G_SOCKET_FAMILY_IPV6); + have_ipv6 = (socket != NULL); + if (have_ipv6) { + fail_unless (g_socket_get_fd (socket) >= 0); + g_object_unref (socket); + } + + socket = gst_rtsp_stream_get_rtcp_socket (stream, G_SOCKET_FAMILY_IPV6); + if (have_ipv6) { + fail_unless (socket != NULL); + fail_unless (g_socket_get_fd (socket) >= 0); + g_object_unref (socket); + } else { + fail_unless (socket == NULL); + } + + /* check that at least one family is available */ + fail_unless (have_ipv4 || have_ipv6); + + fail_unless (gst_rtsp_stream_leave_bin (stream, bin, rtpbin)); + + gst_object_unref (bin); + gst_object_unref (stream); +} + +GST_END_TEST; + +GST_START_TEST (test_get_multicast_address) +{ + GstPad *srcpad; + GstElement *pay; + GstRTSPStream *stream; + GstRTSPAddressPool *pool; + GstRTSPAddress *addr1; + GstRTSPAddress *addr2; + + srcpad = gst_pad_new ("testsrcpad", GST_PAD_SRC); + fail_unless (srcpad != NULL); + gst_pad_set_active (srcpad, TRUE); + pay = gst_element_factory_make ("rtpgstpay", "testpayloader"); + fail_unless (pay != NULL); + stream = gst_rtsp_stream_new (0, pay, srcpad); + fail_unless (stream != NULL); + gst_object_unref (pay); + gst_object_unref (srcpad); + + pool = gst_rtsp_address_pool_new (); + fail_unless (gst_rtsp_address_pool_add_range (pool, + "233.252.0.0", "233.252.0.0", 5000, 5001, 1)); + fail_unless (gst_rtsp_address_pool_add_range (pool, + "FF11:DB8::1", "FF11:DB8::1", 5002, 5003, 1)); + gst_rtsp_stream_set_address_pool (stream, pool); + + addr1 = gst_rtsp_stream_get_multicast_address (stream, G_SOCKET_FAMILY_IPV4); + fail_unless (addr1 != NULL); + fail_unless_equals_string (addr1->address, "233.252.0.0"); + fail_unless_equals_int (addr1->port, 5000); + fail_unless_equals_int (addr1->n_ports, 2); + + addr2 = gst_rtsp_stream_get_multicast_address (stream, G_SOCKET_FAMILY_IPV4); + fail_unless (addr2 != NULL); + fail_unless_equals_string (addr2->address, "233.252.0.0"); + fail_unless_equals_int (addr2->port, 5000); + fail_unless_equals_int (addr2->n_ports, 2); + + gst_rtsp_address_free (addr1); + gst_rtsp_address_free (addr2); + + addr1 = gst_rtsp_stream_get_multicast_address (stream, G_SOCKET_FAMILY_IPV6); + fail_unless (addr1 != NULL); + fail_unless (!g_ascii_strcasecmp (addr1->address, "FF11:DB8::1")); + fail_unless_equals_int (addr1->port, 5002); + fail_unless_equals_int (addr1->n_ports, 2); + + addr2 = gst_rtsp_stream_get_multicast_address (stream, G_SOCKET_FAMILY_IPV6); + fail_unless (addr2 != NULL); + fail_unless (!g_ascii_strcasecmp (addr2->address, "FF11:DB8::1")); + fail_unless_equals_int (addr2->port, 5002); + fail_unless_equals_int (addr2->n_ports, 2); + + gst_rtsp_address_free (addr1); + gst_rtsp_address_free (addr2); + + g_object_unref (pool); + + gst_object_unref (stream); +} + +GST_END_TEST; + +static Suite * +rtspstream_suite (void) +{ + Suite *s = suite_create ("rtspstream"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_add_test (tc, test_get_sockets); + tcase_add_test (tc, test_get_multicast_address); + + return s; +} + +GST_CHECK_MAIN (rtspstream); diff --git a/tests/check/gst/threadpool.c b/tests/check/gst/threadpool.c new file mode 100644 index 0000000..c92e64f --- /dev/null +++ b/tests/check/gst/threadpool.c @@ -0,0 +1,236 @@ +/* GStreamer + * unit tests for GstRTSPThreadPool + * Copyright (C) 2013 Axis Communications + * @author Ognyan Tonchev + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +GST_START_TEST (test_pool_get_thread) +{ + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + + pool = gst_rtsp_thread_pool_new (); + fail_unless (GST_IS_RTSP_THREAD_POOL (pool)); + + thread = gst_rtsp_thread_pool_get_thread (pool, GST_RTSP_THREAD_TYPE_CLIENT, + NULL); + fail_unless (GST_IS_RTSP_THREAD (thread)); + /* one ref is hold by the pool */ + fail_unless_equals_int (GST_MINI_OBJECT_REFCOUNT (thread), 2); + + gst_rtsp_thread_stop (thread); + g_object_unref (pool); + gst_rtsp_thread_pool_cleanup (); +} + +GST_END_TEST; + +GST_START_TEST (test_pool_get_media_thread) +{ + GstRTSPThreadPool *pool; + GstRTSPThread *thread; + + pool = gst_rtsp_thread_pool_new (); + fail_unless (GST_IS_RTSP_THREAD_POOL (pool)); + + thread = gst_rtsp_thread_pool_get_thread (pool, GST_RTSP_THREAD_TYPE_MEDIA, + NULL); + fail_unless (GST_IS_RTSP_THREAD (thread)); + /* one ref is hold by the pool */ + fail_unless_equals_int (GST_MINI_OBJECT_REFCOUNT (thread), 2); + + gst_rtsp_thread_stop (thread); + g_object_unref (pool); + gst_rtsp_thread_pool_cleanup (); +} + +GST_END_TEST; + +GST_START_TEST (test_pool_get_thread_reuse) +{ + GstRTSPThreadPool *pool; + GstRTSPThread *thread1; + GstRTSPThread *thread2; + + pool = gst_rtsp_thread_pool_new (); + fail_unless (GST_IS_RTSP_THREAD_POOL (pool)); + + gst_rtsp_thread_pool_set_max_threads (pool, 1); + + thread1 = gst_rtsp_thread_pool_get_thread (pool, GST_RTSP_THREAD_TYPE_CLIENT, + NULL); + fail_unless (GST_IS_RTSP_THREAD (thread1)); + + thread2 = gst_rtsp_thread_pool_get_thread (pool, GST_RTSP_THREAD_TYPE_CLIENT, + NULL); + fail_unless (GST_IS_RTSP_THREAD (thread2)); + + fail_unless (thread2 == thread1); + /* one ref is hold by the pool */ + fail_unless_equals_int (GST_MINI_OBJECT_REFCOUNT (thread1), 3); + + gst_rtsp_thread_stop (thread1); + gst_rtsp_thread_stop (thread2); + g_object_unref (pool); + + gst_rtsp_thread_pool_cleanup (); +} + +GST_END_TEST; + +static void +do_test_pool_max_thread (gboolean use_property) +{ + GstRTSPThreadPool *pool; + GstRTSPThread *thread1; + GstRTSPThread *thread2; + GstRTSPThread *thread3; + gint max_threads; + + pool = gst_rtsp_thread_pool_new (); + fail_unless (GST_IS_RTSP_THREAD_POOL (pool)); + + if (use_property) { + g_object_get (pool, "max-threads", &max_threads, NULL); + fail_unless_equals_int (max_threads, 1); + } else { + fail_unless_equals_int (gst_rtsp_thread_pool_get_max_threads (pool), 1); + } + + thread1 = gst_rtsp_thread_pool_get_thread (pool, GST_RTSP_THREAD_TYPE_CLIENT, + NULL); + fail_unless (GST_IS_RTSP_THREAD (thread1)); + + thread2 = gst_rtsp_thread_pool_get_thread (pool, GST_RTSP_THREAD_TYPE_CLIENT, + NULL); + fail_unless (GST_IS_RTSP_THREAD (thread2)); + + fail_unless (thread1 == thread2); + + gst_rtsp_thread_stop (thread1); + gst_rtsp_thread_stop (thread2); + + if (use_property) { + g_object_set (pool, "max-threads", 2, NULL); + g_object_get (pool, "max-threads", &max_threads, NULL); + fail_unless_equals_int (max_threads, 2); + } else { + gst_rtsp_thread_pool_set_max_threads (pool, 2); + fail_unless_equals_int (gst_rtsp_thread_pool_get_max_threads (pool), 2); + } + + thread1 = gst_rtsp_thread_pool_get_thread (pool, GST_RTSP_THREAD_TYPE_CLIENT, + NULL); + fail_unless (GST_IS_RTSP_THREAD (thread1)); + + thread2 = gst_rtsp_thread_pool_get_thread (pool, GST_RTSP_THREAD_TYPE_CLIENT, + NULL); + fail_unless (GST_IS_RTSP_THREAD (thread2)); + + thread3 = gst_rtsp_thread_pool_get_thread (pool, GST_RTSP_THREAD_TYPE_CLIENT, + NULL); + fail_unless (GST_IS_RTSP_THREAD (thread3)); + + fail_unless (thread2 != thread1); + fail_unless (thread3 == thread2 || thread3 == thread1); + + gst_rtsp_thread_stop (thread1); + gst_rtsp_thread_stop (thread2); + gst_rtsp_thread_stop (thread3); + + if (use_property) { + g_object_set (pool, "max-threads", 0, NULL); + g_object_get (pool, "max-threads", &max_threads, NULL); + fail_unless_equals_int (max_threads, 0); + } else { + gst_rtsp_thread_pool_set_max_threads (pool, 0); + fail_unless_equals_int (gst_rtsp_thread_pool_get_max_threads (pool), 0); + } + + thread1 = gst_rtsp_thread_pool_get_thread (pool, GST_RTSP_THREAD_TYPE_CLIENT, + NULL); + fail_if (GST_IS_RTSP_THREAD (thread1)); + + g_object_unref (pool); + + gst_rtsp_thread_pool_cleanup (); +} + +GST_START_TEST (test_pool_max_threads) +{ + do_test_pool_max_thread (FALSE); +} + +GST_END_TEST; + +GST_START_TEST (test_pool_max_threads_property) +{ + do_test_pool_max_thread (TRUE); +} + +GST_END_TEST; + +GST_START_TEST (test_pool_thread_copy) +{ + GstRTSPThreadPool *pool; + GstRTSPThread *thread1; + GstRTSPThread *thread2; + + pool = gst_rtsp_thread_pool_new (); + fail_unless (GST_IS_RTSP_THREAD_POOL (pool)); + + thread1 = gst_rtsp_thread_pool_get_thread (pool, GST_RTSP_THREAD_TYPE_CLIENT, + NULL); + fail_unless (GST_IS_RTSP_THREAD (thread1)); + fail_unless (GST_IS_MINI_OBJECT_TYPE (thread1, GST_TYPE_RTSP_THREAD)); + + thread2 = GST_RTSP_THREAD (gst_mini_object_copy (GST_MINI_OBJECT (thread1))); + fail_unless (GST_IS_RTSP_THREAD (thread2)); + fail_unless (GST_IS_MINI_OBJECT_TYPE (thread2, GST_TYPE_RTSP_THREAD)); + + gst_rtsp_thread_stop (thread1); + gst_rtsp_thread_stop (thread2); + g_object_unref (pool); + gst_rtsp_thread_pool_cleanup (); +} + +GST_END_TEST; + +static Suite * +rtspthreadpool_suite (void) +{ + Suite *s = suite_create ("rtspthreadpool"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_set_timeout (tc, 20); + tcase_add_test (tc, test_pool_get_thread); + tcase_add_test (tc, test_pool_get_media_thread); + tcase_add_test (tc, test_pool_get_thread_reuse); + tcase_add_test (tc, test_pool_max_threads); + tcase_add_test (tc, test_pool_max_threads_property); + tcase_add_test (tc, test_pool_thread_copy); + + return s; +} + +GST_CHECK_MAIN (rtspthreadpool); diff --git a/tests/check/gst/token.c b/tests/check/gst/token.c new file mode 100644 index 0000000..df5bbd5 --- /dev/null +++ b/tests/check/gst/token.c @@ -0,0 +1,99 @@ +/* GStreamer + * Copyright (C) 2013 Sebastian Rasmussen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +GST_START_TEST (test_token) +{ + GstRTSPToken *token; + GstRTSPToken *token2; + GstRTSPToken *copy; + GstStructure *str; + + token = gst_rtsp_token_new_empty (); + fail_if (gst_rtsp_token_is_allowed (token, "missing")); + gst_rtsp_token_unref (token); + + token = gst_rtsp_token_new ("role", G_TYPE_STRING, "user", + "permission1", G_TYPE_BOOLEAN, TRUE, + "permission2", G_TYPE_BOOLEAN, FALSE, NULL); + fail_unless_equals_string (gst_rtsp_token_get_string (token, "role"), "user"); + fail_unless (gst_rtsp_token_is_allowed (token, "permission1")); + fail_if (gst_rtsp_token_is_allowed (token, "permission2")); + fail_if (gst_rtsp_token_is_allowed (token, "missing")); + copy = GST_RTSP_TOKEN (gst_mini_object_copy (GST_MINI_OBJECT (token))); + gst_rtsp_token_unref (token); + fail_unless_equals_string (gst_rtsp_token_get_string (copy, "role"), "user"); + fail_unless (gst_rtsp_token_is_allowed (copy, "permission1")); + fail_if (gst_rtsp_token_is_allowed (copy, "permission2")); + fail_if (gst_rtsp_token_is_allowed (copy, "missing")); + gst_rtsp_token_unref (copy); + + token = gst_rtsp_token_new ("role", G_TYPE_STRING, "user", + "permission1", G_TYPE_BOOLEAN, TRUE, + "permission2", G_TYPE_BOOLEAN, FALSE, NULL); + fail_unless_equals_string (gst_rtsp_token_get_string (token, "role"), "user"); + fail_unless (gst_rtsp_token_is_allowed (token, "permission1")); + fail_if (gst_rtsp_token_is_allowed (token, "permission2")); + fail_unless_equals_string (gst_rtsp_token_get_string (token, "role"), "user"); + + fail_unless (gst_mini_object_is_writable (GST_MINI_OBJECT (token))); + fail_unless (gst_rtsp_token_writable_structure (token) != NULL); + fail_unless (gst_rtsp_token_get_structure (token) != NULL); + + token2 = gst_rtsp_token_ref (token); + + fail_if (gst_mini_object_is_writable (GST_MINI_OBJECT (token))); + ASSERT_CRITICAL (fail_unless (gst_rtsp_token_writable_structure (token) == + NULL)); + fail_unless (gst_rtsp_token_get_structure (token) != NULL); + + gst_rtsp_token_unref (token2); + + fail_unless (gst_mini_object_is_writable (GST_MINI_OBJECT (token))); + fail_unless (gst_rtsp_token_writable_structure (token) != NULL); + fail_unless (gst_rtsp_token_get_structure (token) != NULL); + + str = gst_rtsp_token_writable_structure (token); + gst_structure_set (str, "permission2", G_TYPE_BOOLEAN, TRUE, NULL); + fail_unless_equals_string (gst_rtsp_token_get_string (token, "role"), "user"); + fail_unless (gst_rtsp_token_is_allowed (token, "permission1")); + fail_unless (gst_rtsp_token_is_allowed (token, "permission2")); + fail_unless_equals_string (gst_rtsp_token_get_string (token, "role"), "user"); + gst_rtsp_token_unref (token); +} + +GST_END_TEST; + +static Suite * +rtsptoken_suite (void) +{ + Suite *s = suite_create ("rtsptoken"); + TCase *tc = tcase_create ("general"); + + suite_add_tcase (s, tc); + tcase_set_timeout (tc, 20); + tcase_add_test (tc, test_token); + + return s; +} + +GST_CHECK_MAIN (rtsptoken); diff --git a/tests/test-cleanup.c b/tests/test-cleanup.c new file mode 100644 index 0000000..3b6f7f6 --- /dev/null +++ b/tests/test-cleanup.c @@ -0,0 +1,68 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +static gboolean +timeout (GMainLoop * loop, gboolean ignored) +{ + g_main_loop_quit (loop); + return FALSE; +} + + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + GstRTSPServer *server; + guint id; + + gst_init (&argc, &argv); + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* attach the server to the default maincontext */ + if ((id = gst_rtsp_server_attach (server, NULL)) == 0) + goto failed; + + g_timeout_add_seconds (2, (GSourceFunc) timeout, loop); + + /* start serving */ + g_main_loop_run (loop); + + /* cleanup */ + g_source_remove (id); + g_object_unref (server); + g_main_loop_unref (loop); + + return 0; + + /* ERRORS */ +failed: + { + g_print ("failed to attach the server\n"); + return -1; + } +} diff --git a/tests/test-reuse.c b/tests/test-reuse.c new file mode 100644 index 0000000..67063a8 --- /dev/null +++ b/tests/test-reuse.c @@ -0,0 +1,90 @@ +/* GStreamer + * Copyright (C) 2008 Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include + +#define TIMEOUT 2 + +static gboolean timeout_1 (GMainLoop * loop, gboolean ignored); + +static guint id; +static gint rounds = 3; +static GstRTSPServer *server; + +static gboolean +timeout_2 (GMainLoop * loop, gboolean ignored) +{ + rounds--; + if (rounds > 0) { + id = gst_rtsp_server_attach (server, NULL); + g_print ("have attached\n"); + g_timeout_add_seconds (TIMEOUT, (GSourceFunc) timeout_1, loop); + } else { + g_main_loop_quit (loop); + } + return FALSE; +} + +static gboolean +timeout_1 (GMainLoop * loop, gboolean ignored) +{ + g_source_remove (id); + g_print ("have removed\n"); + g_timeout_add_seconds (TIMEOUT, (GSourceFunc) timeout_2, loop); + return FALSE; +} + +int +main (int argc, char *argv[]) +{ + GMainLoop *loop; + + gst_init (&argc, &argv); + + loop = g_main_loop_new (NULL, FALSE); + + /* create a server instance */ + server = gst_rtsp_server_new (); + + /* attach the server to the default maincontext */ + if ((id = gst_rtsp_server_attach (server, NULL)) == 0) + goto failed; + g_print ("have attached\n"); + + g_timeout_add_seconds (TIMEOUT, (GSourceFunc) timeout_1, loop); + + /* start serving */ + g_main_loop_run (loop); + + /* cleanup */ + g_object_unref (server); + g_main_loop_unref (loop); + + g_print ("quit\n"); + return 0; + + /* ERRORS */ +failed: + { + g_print ("failed to attach the server\n"); + return -1; + } +} -- 2.7.4 From 0799b985c54bb07928b54faad77fde760fb9f2c9 Mon Sep 17 00:00:00 2001 From: Hyunjun Date: Tue, 10 Mar 2015 15:53:21 +0900 Subject: [PATCH 3/5] Fix build break and warnings on 64bit system Change-Id: Id6433a5ecd041354cf1fabecbd42eb6b6248c4f5 --- gst/rtsp-server/gstwfdmessage.c | 6 ++-- gst/rtsp-server/rtsp-client-wfd.c | 2 +- gst/rtsp-server/rtsp-media-factory-wfd.c | 4 +-- packaging/gst-rtsp-server.spec | 5 ++- packaging/orig/gst-rtsp.spec | 54 -------------------------------- packaging/orig/gst-rtsp.spec.in | 54 -------------------------------- 6 files changed, 8 insertions(+), 117 deletions(-) delete mode 100644 packaging/orig/gst-rtsp.spec delete mode 100644 packaging/orig/gst-rtsp.spec.in diff --git a/gst/rtsp-server/gstwfdmessage.c b/gst/rtsp-server/gstwfdmessage.c index 3bff785..759216d 100644 --- a/gst/rtsp-server/gstwfdmessage.c +++ b/gst/rtsp-server/gstwfdmessage.c @@ -1116,9 +1116,9 @@ gst_wfd_message_as_text (const GstWFDMessage * msg) if (msg->av_format_change_timing) { g_string_append_printf (lines, "wfd_av_format_change_timing"); g_string_append_printf (lines, ":"); - g_string_append_printf (lines, " %10llu", + g_string_append_printf (lines, " %10"G_GUINT64_FORMAT, msg->av_format_change_timing->PTS); - g_string_append_printf (lines, " %10llu", + g_string_append_printf (lines, " %10"G_GUINT64_FORMAT, msg->av_format_change_timing->DTS); g_string_append_printf (lines, "\r\n"); } @@ -1127,7 +1127,7 @@ gst_wfd_message_as_text (const GstWFDMessage * msg) g_string_append_printf (lines, "wfd_preferred_display_mode"); g_string_append_printf (lines, ":"); if (msg->preferred_display_mode->displaymodesupported) { - g_string_append_printf (lines, " %06llu", + g_string_append_printf (lines, " %06"G_GUINT64_FORMAT, msg->preferred_display_mode->p_clock); g_string_append_printf (lines, " %04x", msg->preferred_display_mode->H); g_string_append_printf (lines, " %04x", msg->preferred_display_mode->HB); diff --git a/gst/rtsp-server/rtsp-client-wfd.c b/gst/rtsp-server/rtsp-client-wfd.c index 75a5202..97d5fba 100644 --- a/gst/rtsp-server/rtsp-client-wfd.c +++ b/gst/rtsp-server/rtsp-client-wfd.c @@ -1995,7 +1995,7 @@ gst_rtsp_wfd_client_set_video_supported_resolution (GstRTSPWFDClient * client, GstRTSPResult res = GST_RTSP_OK; GstRTSPWFDClientPrivate *priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client); priv->video_resolution_supported = supported_reso; - GST_DEBUG ("Resolution : %lld", supported_reso); + GST_DEBUG ("Resolution : %"G_GUINT64_FORMAT, supported_reso); return res; } diff --git a/gst/rtsp-server/rtsp-media-factory-wfd.c b/gst/rtsp-server/rtsp-media-factory-wfd.c index 5bf7c5b..137930a 100644 --- a/gst/rtsp-server/rtsp-media-factory-wfd.c +++ b/gst/rtsp-server/rtsp-media-factory-wfd.c @@ -317,9 +317,9 @@ _rtsp_media_factory_wfd_create_audio_capture_bin (GstRTSPMediaFactoryWFD * } GST_INFO_OBJECT (factory, "audio device : %s", priv->audio_device); - GST_INFO_OBJECT (factory, "audio latency time : %lld", + GST_INFO_OBJECT (factory, "audio latency time : %"G_GUINT64_FORMAT, priv->audio_latency_time); - GST_INFO_OBJECT (factory, "audio_buffer_time : %lld", + GST_INFO_OBJECT (factory, "audio_buffer_time : %"G_GUINT64_FORMAT, priv->audio_buffer_time); GST_INFO_OBJECT (factory, "audio_do_timestamp : %d", priv->audio_do_timestamp); diff --git a/packaging/gst-rtsp-server.spec b/packaging/gst-rtsp-server.spec index c457923..2a1edc5 100755 --- a/packaging/gst-rtsp-server.spec +++ b/packaging/gst-rtsp-server.spec @@ -39,11 +39,10 @@ CFLAGS+=" -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" "; expor LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--hash-style=both -Wl,--as-needed"; export LDFLAGS # always enable sdk build. This option should go away -./configure --enable-sdk --prefix=%{_prefix} --disable-static +%configure --disable-static # Call make instruction with smp support -#make %{?jobs:-j%jobs} -make +make %{?jobs:-j%jobs} %install rm -rf %{buildroot} diff --git a/packaging/orig/gst-rtsp.spec b/packaging/orig/gst-rtsp.spec deleted file mode 100644 index 8033373..0000000 --- a/packaging/orig/gst-rtsp.spec +++ /dev/null @@ -1,54 +0,0 @@ -%define gst_majorminor 1.0 - -Name: gstreamer-rtsp-server -Version: 1.4.1 -Release: 1%{?dist} -Summary: GStreamer based RTSP server -Vendor: Collabora Multimedia -Group: Applications/Multimedia -License: LGPLv2+ -Source0: gst-rtsp-%{version}.tar.bz2 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -BuildRequires: gstreamer-devel >= 0.10.11 - - -%description -This is a RTSP server using the GStreamer framework. - - -%prep -%setup -q -n gst-rtsp-%{version} - - -%build -%configure - -make - -%install -%makeinstall - -# Clean out files that should not be part of the rpm. -rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-%{majorminor}/*.a -rm -f $RPM_BUILD_ROOT%{_libdir}/*.a -rm -f $RPM_BUILD_ROOT%{_libdir}/*.la - -%clean -rm -rf $RPM_BUILD_ROOT - - -%post -p /sbin/ldconfig - - -%postun -p /sbin/ldconfig - - -%files -%defattr(-,root,root,-) -%doc AUTHORS COPYING README INSTALL docs/design/gst-rtp-server-design -%{_bindir}/gst-rtsp-server - -%changelog -* Thu Oct 9 2008 Christian Schaller -- First spec file diff --git a/packaging/orig/gst-rtsp.spec.in b/packaging/orig/gst-rtsp.spec.in deleted file mode 100644 index 12224f8..0000000 --- a/packaging/orig/gst-rtsp.spec.in +++ /dev/null @@ -1,54 +0,0 @@ -%define gst_majorminor @GST_API_VERSION@ - -Name: gstreamer-rtsp-server -Version: @VERSION@ -Release: 1%{?dist} -Summary: GStreamer based RTSP server -Vendor: Collabora Multimedia -Group: Applications/Multimedia -License: LGPLv2+ -Source0: gst-rtsp-%{version}.tar.bz2 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -BuildRequires: gstreamer-devel >= 0.10.11 - - -%description -This is a RTSP server using the GStreamer framework. - - -%prep -%setup -q -n gst-rtsp-%{version} - - -%build -%configure - -make - -%install -%makeinstall - -# Clean out files that should not be part of the rpm. -rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-%{majorminor}/*.a -rm -f $RPM_BUILD_ROOT%{_libdir}/*.a -rm -f $RPM_BUILD_ROOT%{_libdir}/*.la - -%clean -rm -rf $RPM_BUILD_ROOT - - -%post -p /sbin/ldconfig - - -%postun -p /sbin/ldconfig - - -%files -%defattr(-,root,root,-) -%doc AUTHORS COPYING README INSTALL docs/design/gst-rtp-server-design -%{_bindir}/gst-rtsp-server - -%changelog -* Thu Oct 9 2008 Christian Schaller -- First spec file -- 2.7.4 From 49bd0fb8c9f6c55b41c3394b7c688bbf6a351e96 Mon Sep 17 00:00:00 2001 From: Hyunjun Date: Wed, 1 Apr 2015 18:28:17 +0900 Subject: [PATCH 4/5] 1. Pause/Resume trigger method implementation 2. Fix to send keep-alive message Change-Id: Ie684813eb50c0b7e6472f35f4df944696b1b4723 --- gst/rtsp-server/rtsp-client-wfd.c | 92 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 3 deletions(-) diff --git a/gst/rtsp-server/rtsp-client-wfd.c b/gst/rtsp-server/rtsp-client-wfd.c index 97d5fba..27607ef 100644 --- a/gst/rtsp-server/rtsp-client-wfd.c +++ b/gst/rtsp-server/rtsp-client-wfd.c @@ -1153,6 +1153,8 @@ typedef enum M4_RES_MSG, M5_REQ_MSG, TEARDOWN_TRIGGER, + PLAY_TRIGGER, + PAUSE_TRIGGER, } GstWFDMessageType; static gboolean @@ -1462,6 +1464,16 @@ _set_wfd_message_body (GstRTSPWFDClient * client, GstWFDMessageType msg_type, g_string_append (buf, "\r\n"); *len = buf->len; *data = g_string_free (buf, FALSE); + } else if (msg_type == PLAY_TRIGGER) { + g_string_append (buf, "wfd_trigger_method: PLAY"); + g_string_append (buf, "\r\n"); + *len = buf->len; + *data = g_string_free (buf, FALSE); + } else if (msg_type == PAUSE_TRIGGER) { + g_string_append (buf, "wfd_trigger_method: PAUSE"); + g_string_append (buf, "\r\n"); + *len = buf->len; + *data = g_string_free (buf, FALSE); } else { return; } @@ -1701,6 +1713,80 @@ prepare_trigger_request (GstRTSPWFDClient * client, GstRTSPMessage * request, g_free (msg); break; } + case WFD_TRIGGER_PLAY:{ + gchar *msg; + guint msglen = 0; + GString *msglength; + + /* add content type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_TYPE, + "text/parameters"); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp request..."); + goto error; + } + + _set_wfd_message_body (client, PLAY_TRIGGER, &msg, &msglen); + msglength = g_string_new (""); + g_string_append_printf (msglength, "%d", msglen); + GST_DEBUG ("Trigger PLAY server side message body: %s", msg); + + /* add content-length type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_LENGTH, + g_string_free (msglength, FALSE)); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + res = gst_rtsp_message_set_body (request, (guint8 *) msg, msglen); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + g_free (msg); + break; + } + case WFD_TRIGGER_PAUSE:{ + gchar *msg; + guint msglen = 0; + GString *msglength; + + /* add content type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_TYPE, + "text/parameters"); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp request..."); + goto error; + } + + _set_wfd_message_body (client, PAUSE_TRIGGER, &msg, &msglen); + msglength = g_string_new (""); + g_string_append_printf (msglength, "%d", msglen); + GST_DEBUG ("Trigger PAUSE server side message body: %s", msg); + + /* add content-length type */ + res = + gst_rtsp_message_add_header (request, GST_RTSP_HDR_CONTENT_LENGTH, + g_string_free (msglength, FALSE)); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + res = gst_rtsp_message_set_body (request, (guint8 *) msg, msglen); + if (res != GST_RTSP_OK) { + GST_ERROR_OBJECT (client, "Failed to add header to rtsp message..."); + goto error; + } + + g_free (msg); + break; + } /* TODO-WFD: implement to handle other trigger type */ default:{ } @@ -2065,14 +2151,14 @@ keep_alive_condition(gpointer userdata) GST_DEBUG("sending keep alive message"); res = handle_M16_message(client); - if(res) { + if(res == GST_RTSP_OK) { priv->keep_alive_flag = FALSE; - } - else { + } else { GST_ERROR_OBJECT (client, "Failed to send Keep Alive Message"); g_mutex_unlock(&priv->keep_alive_lock); return FALSE; } + g_mutex_unlock(&priv->keep_alive_lock); return TRUE; } -- 2.7.4 From 933bc9394fa510d051feecc98b2c97153e8fb448 Mon Sep 17 00:00:00 2001 From: Hyunjun Date: Fri, 29 May 2015 15:12:19 +0900 Subject: [PATCH 5/5] 1.4.5 migration and bug fixes Change-Id: I7a16b3cbcc1e63bb3e090c6050f496b0abf76ea0 --- ChangeLog | 81 ++++++- Makefile.am | 3 +- Makefile.in | 4 +- NEWS | 2 +- RELEASE | 8 +- aclocal.m4 | 7 +- config.sub | 9 +- configure | 38 +-- configure.ac | 4 +- docs/libs/html/GstRTSPAuth.html | 46 ++-- docs/libs/html/GstRTSPClient.html | 94 ++++---- docs/libs/html/GstRTSPMedia.html | 152 ++++++------ docs/libs/html/GstRTSPMediaFactory.html | 60 ++--- docs/libs/html/GstRTSPMountPoints.html | 22 +- docs/libs/html/GstRTSPServer.html | 152 ++++++------ docs/libs/html/GstRTSPSession.html | 74 +++--- docs/libs/html/GstRTSPSessionPool.html | 64 +++--- docs/libs/html/GstRTSPStream.html | 166 +++++++------- .../html/gst-rtsp-server-GstRTSPAddressPool.html | 34 +-- docs/libs/html/gst-rtsp-server-GstRTSPContext.html | 12 +- .../gst-rtsp-server-GstRTSPMediaFactoryURI.html | 8 +- .../html/gst-rtsp-server-GstRTSPPermissions.html | 24 +- docs/libs/html/gst-rtsp-server-GstRTSPSdp.html | 4 +- .../html/gst-rtsp-server-GstRTSPSessionMedia.html | 32 +-- .../gst-rtsp-server-GstRTSPStreamTransport.html | 56 ++--- .../html/gst-rtsp-server-GstRTSPThreadPool.html | 26 +-- docs/libs/html/gst-rtsp-server-GstRTSPToken.html | 26 +-- docs/libs/html/index.html | 2 +- docs/libs/html/rtsp-server-hierarchy.html | 2 +- gst-rtsp-server.doap | 40 ++++ gst/rtsp-server/from_upstream.diff | 255 --------------------- gst/rtsp-server/rtsp-client-wfd.c | 13 +- gst/rtsp-server/rtsp-client-wfd.h | 4 +- gst/rtsp-server/rtsp-client.c | 11 + gst/rtsp-server/rtsp-media-factory-wfd.c | 12 +- gst/rtsp-server/rtsp-media.c | 14 ++ gst/rtsp-server/rtsp-server-wfd.c | 20 ++ gst/rtsp-server/rtsp-server-wfd.h | 3 +- gst/rtsp-server/rtsp-stream.c | 46 +++- gst/rtsp-server/rtsp-stream.h | 3 + ltmain.sh | 4 +- packaging/gst-rtsp-server.spec | 2 +- 42 files changed, 808 insertions(+), 831 deletions(-) delete mode 100644 gst/rtsp-server/from_upstream.diff mode change 100755 => 100644 packaging/gst-rtsp-server.spec diff --git a/ChangeLog b/ChangeLog index 9ec36fd..c8c6360 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,86 @@ +=== release 1.4.5 === + +2014-12-18 Sebastian Dröge + + * configure.ac: + releasing 1.4.5 + +2014-10-31 23:01:53 -0700 Aleix Conchillo Flaqué + + * gst/rtsp-server/rtsp-stream.c: + rtsp-stream: unref srtp decoder when leaving bin + https://bugzilla.gnome.org/show_bug.cgi?id=739481 + +=== release 1.4.4 === + +2014-11-06 13:18:04 +0100 Sebastian Dröge + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-rtsp-server.doap: + Release 1.4.4 + +2014-10-29 21:01:39 -0700 Aleix Conchillo Flaqué + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: mikey memory leaks + https://bugzilla.gnome.org/show_bug.cgi?id=739383 + +=== release 1.4.3 === + +2014-09-24 12:51:21 +0300 Sebastian Dröge + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-rtsp-server.doap: + Release 1.4.3 + +=== release 1.4.2 === + +2014-09-19 15:13:37 +0300 Sebastian Dröge + + * ChangeLog: + * NEWS: + * RELEASE: + * configure.ac: + * gst-rtsp-server.doap: + Release 1.4.2 + +2014-09-08 09:26:23 +0200 Srimanta Panda + + * gst/rtsp-server/rtsp-media.c: + * gst/rtsp-server/rtsp-stream.c: + * gst/rtsp-server/rtsp-stream.h: + rtsp-media: Make sure that sequence numbers are monotonic after pause + The sequence number is not monotonic for RTP packets after pause. The + reason is basepayloader generates a randon sequence number when the + pipeline goes from ready to pause. With this fix generation of sequence + number will be monotonic when going from pause to play request. + https://bugzilla.gnome.org/show_bug.cgi?id=736017 + +2014-08-28 13:35:15 +0200 Göran Jönsson + + * gst/rtsp-server/rtsp-client.c: + rtsp-client: Protect saved clients watch with a mutex + Fixes a crash when close() is called while merging clients + in handle_tunnel(). In that case close() would destroy the + watch while it is still being used in handle_tunnel(). + https://bugzilla.gnome.org/show_bug.cgi?id=735570 + === release 1.4.1 === -2014-08-27 Sebastian Dröge +2014-08-27 15:05:07 +0300 Sebastian Dröge + * ChangeLog: + * NEWS: + * RELEASE: * configure.ac: - releasing 1.4.1 + * gst-rtsp-server.doap: + Release 1.4.1 2014-08-05 16:12:19 +0200 Sebastian Dröge diff --git a/Makefile.am b/Makefile.am index 2272985..100b512 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,9 +3,8 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc SUBDIRS = \ gst \ common \ - pkgconfig \ - docs \ examples \ + pkgconfig \ tests DIST_SUBDIRS = $(SUBDIRS) diff --git a/Makefile.in b/Makefile.in index 901f570..f72cc77 100644 --- a/Makefile.in +++ b/Makefile.in @@ -94,8 +94,8 @@ DIST_COMMON = $(top_srcdir)/common/release.mak \ ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in $(srcdir)/gst-rtsp.spec.in COPYING \ - COPYING.LIB TODO compile config.guess config.sub install-sh \ - missing ltmain.sh + COPYING.LIB TODO compile config.guess config.sub depcomp \ + install-sh missing ltmain.sh subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ diff --git a/NEWS b/NEWS index 3062b31..cc265ee 100644 --- a/NEWS +++ b/NEWS @@ -1,2 +1,2 @@ -This is GStreamer RTSP Server 1.4.1 +This is GStreamer RTSP Server 1.4.5 diff --git a/RELEASE b/RELEASE index 0052e43..f5876ce 100644 --- a/RELEASE +++ b/RELEASE @@ -1,6 +1,5 @@ -Release notes for GStreamer RTSP Server Library 1.4.1 - +Release notes for GStreamer RTSP Server Library 1.4.5 The GStreamer team is pleased to announce a bugfix release of the stable 1.4 release series. The 1.4 release series is adding new features on top @@ -29,7 +28,7 @@ risky as a bugfix. Bugs fixed in this release - * 732644 : RTSP PLAY with specified range replies with wrong range + * 739481 : rtsp-stream: leaks srtp decoder when leaving rtpbin ==== Download ==== @@ -66,6 +65,5 @@ subscribe to the gstreamer-devel list. Contributors to this release - * Arun Raghavan - * Sebastian Dröge + * Aleix Conchillo Flaqué   \ No newline at end of file diff --git a/aclocal.m4 b/aclocal.m4 index a653c19..f429e2a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -123,10 +123,9 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # 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` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- diff --git a/config.sub b/config.sub index d654d03..bba4efb 100755 --- a/config.sub +++ b/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2014-05-01' +timestamp='2014-09-11' # 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 @@ -302,6 +302,7 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -828,6 +829,10 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -1373,7 +1378,7 @@ case $os in | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ diff --git a/configure b/configure index 2b2deac..e2dfa91 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GStreamer RTSP Server Library 1.4.1. +# Generated by GNU Autoconf 2.69 for GStreamer RTSP Server Library 1.4.5. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='GStreamer RTSP Server Library' PACKAGE_TARNAME='gst-rtsp-server' -PACKAGE_VERSION='1.4.1' -PACKAGE_STRING='GStreamer RTSP Server Library 1.4.1' +PACKAGE_VERSION='1.4.5' +PACKAGE_STRING='GStreamer RTSP Server Library 1.4.5' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer' PACKAGE_URL='' @@ -1508,7 +1508,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GStreamer RTSP Server Library 1.4.1 to adapt to many kinds of systems. +\`configure' configures GStreamer RTSP Server Library 1.4.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1579,7 +1579,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GStreamer RTSP Server Library 1.4.1:";; + short | recursive ) echo "Configuration of GStreamer RTSP Server Library 1.4.5:";; esac cat <<\_ACEOF @@ -1766,7 +1766,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GStreamer RTSP Server Library configure 1.4.1 +GStreamer RTSP Server Library configure 1.4.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2044,7 +2044,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GStreamer RTSP Server Library $as_me 1.4.1, which was +It was created by GStreamer RTSP Server Library $as_me 1.4.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2707,8 +2707,8 @@ test "$program_suffix" != NONE && ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -3021,7 +3021,7 @@ fi # Define the identity of the package. PACKAGE='gst-rtsp-server' - VERSION='1.4.1' + VERSION='1.4.5' cat >>confdefs.h <<_ACEOF @@ -3232,9 +3232,9 @@ fi - PACKAGE_VERSION_MAJOR=$(echo 1.4.1 | cut -d'.' -f1) - PACKAGE_VERSION_MINOR=$(echo 1.4.1 | cut -d'.' -f2) - PACKAGE_VERSION_MICRO=$(echo 1.4.1 | cut -d'.' -f3) + PACKAGE_VERSION_MAJOR=$(echo 1.4.5 | cut -d'.' -f1) + PACKAGE_VERSION_MINOR=$(echo 1.4.5 | cut -d'.' -f2) + PACKAGE_VERSION_MICRO=$(echo 1.4.5 | cut -d'.' -f3) @@ -3245,7 +3245,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking nano version" >&5 $as_echo_n "checking nano version... " >&6; } - NANO=$(echo 1.4.1 | cut -d'.' -f4) + NANO=$(echo 1.4.5 | cut -d'.' -f4) if test x"$NANO" = x || test "x$NANO" = "x0" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: 0 (release)" >&5 @@ -7889,10 +7889,10 @@ fi done - GST_CURRENT=401 + GST_CURRENT=405 GST_REVISION=0 - GST_AGE=401 - GST_LIBVERSION=401:0:401 + GST_AGE=405 + GST_LIBVERSION=405:0:405 @@ -17643,7 +17643,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GStreamer RTSP Server Library $as_me 1.4.1, which was +This file was extended by GStreamer RTSP Server Library $as_me 1.4.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17709,7 +17709,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GStreamer RTSP Server Library config.status 1.4.1 +GStreamer RTSP Server Library config.status 1.4.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 5c7802c..7a65c6f 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ(2.62) dnl initialize autoconf dnl when going to/from release please set the nano (fourth number) right ! dnl releases only do Wall, cvs and prerelease does Werror too -AC_INIT([GStreamer RTSP Server Library], [1.4.1], +AC_INIT([GStreamer RTSP Server Library], [1.4.5], [http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer], [gst-rtsp-server]) AG_GST_INIT @@ -53,7 +53,7 @@ dnl 1.2.5 => 205 dnl 1.10.9 (who knows) => 1009 dnl dnl sets GST_LT_LDFLAGS -AS_LIBTOOL(GST, 401, 0, 401) +AS_LIBTOOL(GST, 405, 0, 405) dnl *** required versions of GStreamer stuff *** GST_REQ=1.4.0 diff --git a/docs/libs/html/GstRTSPAuth.html b/docs/libs/html/GstRTSPAuth.html index 1b1fc1b..b51425a 100644 --- a/docs/libs/html/GstRTSPAuth.html +++ b/docs/libs/html/GstRTSPAuth.html @@ -50,7 +50,7 @@ -GTlsCertificate * +GTlsCertificate * gst_rtsp_auth_get_tls_certificate () @@ -66,7 +66,7 @@ -gchar * +gchar * gst_rtsp_auth_make_basic () @@ -90,7 +90,7 @@ -gboolean +gboolean gst_rtsp_auth_check () @@ -172,7 +172,7 @@

Object Hierarchy

-
    GObject
+
    GObject
     ╰── GstRTSPAuth
 
@@ -213,9 +213,9 @@ gst_rtsp_auth_new (void

gst_rtsp_auth_get_tls_certificate ()

-
GTlsCertificate *
+
GTlsCertificate *
 gst_rtsp_auth_get_tls_certificate (GstRTSPAuth *auth);
-

Get the GTlsCertificate used for negotiating TLS auth +

Get the GTlsCertificate used for negotiating TLS auth .

Parameters

@@ -234,8 +234,8 @@ gst_rtsp_auth_get_tls_certificate (

Returns

-

the GTlsCertificate of auth -. g_object_unref() after +

the GTlsCertificate of auth +. g_object_unref() after usage.

[transfer full]

@@ -245,7 +245,7 @@ usage.

gst_rtsp_auth_set_tls_certificate ()

void
 gst_rtsp_auth_set_tls_certificate (GstRTSPAuth *auth,
-                                   GTlsCertificate *cert);
+ GTlsCertificate *cert);

Set the TLS certificate for the auth. Client connections will only be accepted when TLS is negotiated.

@@ -264,7 +264,7 @@ be accepted when TLS is negotiated.

cert

-

a GTlsCertificate.

+

a GTlsCertificate.

[transfer none][allow-none] @@ -274,9 +274,9 @@ be accepted when TLS is negotiated.


gst_rtsp_auth_make_basic ()

-
gchar *
-gst_rtsp_auth_make_basic (const gchar *user,
-                          const gchar *pass);
+
gchar *
+gst_rtsp_auth_make_basic (const gchar *user,
+                          const gchar *pass);

Construct a Basic authorisation token from user and pass .

@@ -307,7 +307,7 @@ gst_rtsp_auth_make_basic (const user :pass . -g_free() after usage.

+g_free() after usage.

[transfer full]

@@ -316,7 +316,7 @@ gst_rtsp_auth_make_basic (const

gst_rtsp_auth_add_basic ()

void
 gst_rtsp_auth_add_basic (GstRTSPAuth *auth,
-                         const gchar *basic,
+                         const gchar *basic,
                          GstRTSPToken *token);

Add a basic token for the default authentication algorithm that enables the client with privileges listed in token @@ -354,7 +354,7 @@ enables the client with privileges listed in token

gst_rtsp_auth_remove_basic ()

void
 gst_rtsp_auth_remove_basic (GstRTSPAuth *auth,
-                            const gchar *basic);
+ const gchar *basic);

Add a basic token for the default authentication algorithm that enables the client with privileges from authgroup .

@@ -384,8 +384,8 @@ enables the client with privileges from authgroup

gst_rtsp_auth_check ()

-
gboolean
-gst_rtsp_auth_check (const gchar *check);
+
gboolean
+gst_rtsp_auth_check (const gchar *check);

Check if check is allowed in the current context.

@@ -503,7 +503,7 @@ be used for unauthenticated users.

-

GObjectClass parent_class;

+

GObjectClass parent_class;

    @@ -564,7 +564,7 @@ A response should be sent on error.

Check if the client can specify TTL, destination and port pair in multicast. No response is sent when the check returns -FALSE.

+FALSE.


@@ -581,7 +581,7 @@ the media factory and retrieve the role with the same name.

GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS

#define GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS   "transport.client-settings"
 
-

G_TYPE_BOOLEAN, TRUE if the client can specify TTL, destination and +

G_TYPE_BOOLEAN, TRUE if the client can specify TTL, destination and port pair in multicast.


@@ -589,7 +589,7 @@ the media factory and retrieve the role with the same name.

GST_RTSP_PERM_MEDIA_FACTORY_ACCESS

#define GST_RTSP_PERM_MEDIA_FACTORY_ACCESS      "media.factory.access"
 
-

G_TYPE_BOOLEAN, TRUE if the media can be accessed, FALSE will +

G_TYPE_BOOLEAN, TRUE if the media can be accessed, FALSE will return a 404 Not Found error when trying to access the media.


@@ -597,7 +597,7 @@ return a 404 Not Found error when trying to access the media.

GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT

#define GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT   "media.factory.construct"
 
-

G_TYPE_BOOLEAN, TRUE if the media can be constructed, FALSE will +

G_TYPE_BOOLEAN, TRUE if the media can be constructed, FALSE will return a 404 Not Found error when trying to access the media.

diff --git a/docs/libs/html/GstRTSPClient.html b/docs/libs/html/GstRTSPClient.html index e02e8a7..d806b44 100644 --- a/docs/libs/html/GstRTSPClient.html +++ b/docs/libs/html/GstRTSPClient.html @@ -132,7 +132,7 @@ -gboolean +gboolean gst_rtsp_client_set_connection () @@ -140,7 +140,7 @@ -guint +guint gst_rtsp_client_attach () @@ -148,7 +148,7 @@ -gboolean +gboolean (*GstRTSPClientSendFunc) () @@ -188,7 +188,7 @@ -GList * +GList * gst_rtsp_client_session_filter () @@ -207,7 +207,7 @@ -gboolean +gboolean drop-backlog Read / Write @@ -319,7 +319,7 @@

Object Hierarchy

-
    GObject
+
    GObject
     ╰── GstRTSPClient
 
@@ -331,7 +331,7 @@ connection is open.

accepted and it inherits the GstRTSPMountPoints, GstRTSPSessionPool, GstRTSPAuth and GstRTSPThreadPool from the server.

The client connection should be configured with the GstRTSPConnection using -gst_rtsp_client_set_connection() before it can be attached to a GMainContext +gst_rtsp_client_set_connection() before it can be attached to a GMainContext using gst_rtsp_client_attach(). From then on the client will handle requests on the connection.

Use gst_rtsp_client_session_filter() to iterate or modify all the @@ -524,7 +524,7 @@ gst_rtsp_client_get_auth (

Returns

the GstRTSPAuth of client -. g_object_unref() after +. g_object_unref() after usage.

[transfer full]

@@ -586,7 +586,7 @@ gst_rtsp_client_get_thread_pool (

Returns

the GstRTSPThreadPool of client -. g_object_unref() after +. g_object_unref() after usage.

[transfer full]

@@ -656,7 +656,7 @@ The connection object returned remains valid until the client is freed.


gst_rtsp_client_set_connection ()

-
gboolean
+
gboolean
 gst_rtsp_client_set_connection (GstRTSPClient *client,
                                 GstRTSPConnection *conn);

Set the GstRTSPConnection of client @@ -687,22 +687,22 @@ gst_rtsp_client_set_connection (

Returns

-

TRUE on success.

+

TRUE on success.


gst_rtsp_client_attach ()

-
guint
+
guint
 gst_rtsp_client_attach (GstRTSPClient *client,
-                        GMainContext *context);
+ GMainContext *context);

Attaches client to context . When the mainloop for context is run, the client will be dispatched. When context - is NULL, the default context will be + is NULL, the default context will be used).

This function should be called when the client properties and urls are fully configured and the client is ready to start.

@@ -722,7 +722,7 @@ configured and the client is ready to start.

context

-

a GMainContext.

+

a GMainContext.

[allow-none] @@ -737,16 +737,16 @@ configured and the client is ready to start.


GstRTSPClientSendFunc ()

-
gboolean
+
gboolean
 (*GstRTSPClientSendFunc) (GstRTSPClient *client,
                           GstRTSPMessage *message,
-                          gboolean close,
-                          gpointer user_data);
+ gboolean close, + gpointer user_data);

This callback is called when client wants to send message . When close is -TRUE, the connection should be closed when the message has been sent.

+TRUE, the connection should be closed when the message has been sent.

Parameters

@@ -781,7 +781,7 @@ configured and the client is ready to start.

Returns

-

TRUE on success.

+

TRUE on success.

@@ -791,8 +791,8 @@ configured and the client is ready to start.

void
 gst_rtsp_client_set_send_func (GstRTSPClient *client,
                                GstRTSPClientSendFunc func,
-                               gpointer user_data,
-                               GDestroyNotify notify);
+ gpointer user_data, + GDestroyNotify notify);

Set func as the callback that will be called when a new message needs to be sent to the client. user_data @@ -883,7 +883,7 @@ gst_rtsp_client_send_message (GstRTSPMessage *message);

Send a message message to the remote end. message must be a -GST_RTSP_MESSAGE_REQUEST or a GST_RTSP_MESSAGE_RESPONSE.

+GST_RTSP_MESSAGE_REQUEST or a GST_RTSP_MESSAGE_RESPONSE.

Parameters

@@ -901,7 +901,7 @@ gst_rtsp_client_send_message (

session

+the message to or NULL.

@@ -919,7 +919,7 @@ the message to or GstRTSPFilterResult (*GstRTSPClientSessionFilterFunc) (GstRTSPClient *client, GstRTSPSession *sess, - gpointer user_data); + gpointer user_data);

This function will be called by the gst_rtsp_client_session_filter(). An implementation should return a value of GstRTSPFilterResult.

When this function returns GST_RTSP_FILTER_REMOVE, sess @@ -931,7 +931,7 @@ from client client .

A value of GST_RTSP_FILTER_REF will add sess - to the result GList of + to the result GList of gst_rtsp_client_session_filter().

Parameters

@@ -970,10 +970,10 @@ from client

gst_rtsp_client_session_filter ()

-
GList *
+
GList *
 gst_rtsp_client_session_filter (GstRTSPClient *client,
                                 GstRTSPClientSessionFilterFunc func,
-                                gpointer user_data);
+ gpointer user_data);

Call func for each session managed by client . The result value of func @@ -994,10 +994,10 @@ locked so no further actions on client

If func returns GST_RTSP_FILTER_REF, the session will remain in client but -will also be added with an additional ref to the result GList of this +will also be added with an additional ref to the result GList of this function..

When func - is NULL, GST_RTSP_FILTER_REF will be assumed for each session.

+ is NULL, GST_RTSP_FILTER_REF will be assumed for each session.

Parameters

a GstRTSPSession to send -the message to or NULL.

[allow-none][transfer none]
@@ -1028,10 +1028,10 @@ function..

Returns

-

a GList with all +

a GList with all sessions for which func returned GST_RTSP_FILTER_REF. After usage, each -element in the GList should be unreffed before the list is freed.

+element in the GList should be unreffed before the list is freed.

[element-type GstRTSPSession][transfer full]

@@ -1088,7 +1088,7 @@ element in the

GObjectClass parent_class;

+
@@ -1197,7 +1197,7 @@ be sent for a tunneled connection. The response can be modified. Since 1.4

Property Details

The “drop-backlog” property

-
  “drop-backlog”             gboolean
+
  “drop-backlog”             gboolean

Drop data when the backlog queue is full.

Flags: Read / Write

Default value: TRUE

@@ -1223,7 +1223,7 @@ be sent for a tunneled connection. The response can be modified. Since 1.4

The “closed” signal

void
 user_function (GstRTSPClient *gstrtspclient,
-               gpointer       user_data)
+ gpointer user_data)

Flags: Run Last


@@ -1232,7 +1232,7 @@ user_function (<
void
 user_function (GstRTSPClient  *gstrtspclient,
                GstRTSPContext *arg1,
-               gpointer        user_data)
+ gpointer user_data)

Flags: Run Last


@@ -1241,7 +1241,7 @@ user_function (<
void
 user_function (GstRTSPClient  *gstrtspclient,
                GstRTSPContext *arg1,
-               gpointer        user_data)
+ gpointer user_data)

Flags: Run Last


@@ -1250,7 +1250,7 @@ user_function (<
void
 user_function (GstRTSPClient  *gstrtspclient,
                GstRTSPContext *arg1,
-               gpointer        user_data)
+ gpointer user_data)

Flags: Run Last


@@ -1259,7 +1259,7 @@ user_function (<
void
 user_function (GstRTSPClient  *gstrtspclient,
                GstRTSPSession *arg1,
-               gpointer        user_data)
+ gpointer user_data)

Flags: Run Last


@@ -1268,7 +1268,7 @@ user_function (<
void
 user_function (GstRTSPClient  *gstrtspclient,
                GstRTSPContext *arg1,
-               gpointer        user_data)
+ gpointer user_data)

Flags: Run Last


@@ -1277,7 +1277,7 @@ user_function (<
void
 user_function (GstRTSPClient  *gstrtspclient,
                GstRTSPContext *arg1,
-               gpointer        user_data)
+ gpointer user_data)

Flags: Run Last


@@ -1286,7 +1286,7 @@ user_function (<
void
 user_function (GstRTSPClient  *gstrtspclient,
                GstRTSPContext *arg1,
-               gpointer        user_data)
+ gpointer user_data)

Flags: Run Last


@@ -1295,8 +1295,8 @@ user_function (<
void
 user_function (GstRTSPClient  *client,
                GstRTSPContext *session,
-               gpointer        message,
-               gpointer        user_data)
+ gpointer message, + gpointer user_data)

Parameters

GObjectClass parent_class;

   
@@ -1337,7 +1337,7 @@ user_function (<
void
 user_function (GstRTSPClient  *gstrtspclient,
                GstRTSPContext *arg1,
-               gpointer        user_data)
+ gpointer user_data)

Flags: Run Last


@@ -1346,7 +1346,7 @@ user_function (<
void
 user_function (GstRTSPClient  *gstrtspclient,
                GstRTSPContext *arg1,
-               gpointer        user_data)
+ gpointer user_data)

Flags: Run Last


@@ -1355,7 +1355,7 @@ user_function (<
void
 user_function (GstRTSPClient  *gstrtspclient,
                GstRTSPContext *arg1,
-               gpointer        user_data)
+ gpointer user_data)

Flags: Run Last

diff --git a/docs/libs/html/GstRTSPMedia.html b/docs/libs/html/GstRTSPMedia.html index 83c5721..7005873 100644 --- a/docs/libs/html/GstRTSPMedia.html +++ b/docs/libs/html/GstRTSPMedia.html @@ -92,7 +92,7 @@
- + @@ -394,7 +394,7 @@ - + @@ -409,12 +409,12 @@ - + - + @@ -424,7 +424,7 @@ - + @@ -502,7 +502,7 @@

Object Hierarchy

-
    GObject
+
    GObject
     ╰── GstRTSPMedia
 
@@ -698,11 +698,11 @@ gst_rtsp_media_get_permissions (

gst_rtsp_media_set_shared ()

void
 gst_rtsp_media_set_shared (GstRTSPMedia *media,
-                           gboolean shared);
+ gboolean shared);

Set or unset if the pipeline for media can be shared will multiple clients. When shared - is TRUE, client requests for this media will share the media + is TRUE, client requests for this media will share the media pipeline.

Parameters

@@ -730,7 +730,7 @@ pipeline.


gst_rtsp_media_is_shared ()

-
gboolean
+
gboolean
 gst_rtsp_media_is_shared (GstRTSPMedia *media);

Check if the pipeline for media can be shared between multiple clients.

@@ -751,7 +751,7 @@ gst_rtsp_media_is_shared (

Returns

-

TRUE if the media can be shared between clients.

+

TRUE if the media can be shared between clients.

@@ -760,7 +760,7 @@ gst_rtsp_media_is_shared (

gst_rtsp_media_set_reusable ()

void
 gst_rtsp_media_set_reusable (GstRTSPMedia *media,
-                             gboolean reusable);
+ gboolean reusable);

Set or unset if the pipeline for media can be reused after the pipeline has been unprepared.

@@ -790,7 +790,7 @@ been unprepared.


gst_rtsp_media_is_reusable ()

-
gboolean
+
gboolean
 gst_rtsp_media_is_reusable (GstRTSPMedia *media);

Check if the pipeline for media can be reused after an unprepare.

@@ -811,7 +811,7 @@ gst_rtsp_media_is_reusable (

Returns

-

TRUE if the media can be reused

+

TRUE if the media can be reused

@@ -938,7 +938,7 @@ gst_rtsp_media_get_protocols (

gst_rtsp_media_set_eos_shutdown ()

void
 gst_rtsp_media_set_eos_shutdown (GstRTSPMedia *media,
-                                 gboolean eos_shutdown);
+ gboolean eos_shutdown);

Set or unset if an EOS event will be sent to the pipeline for media before it is unprepared.

@@ -968,7 +968,7 @@ it is unprepared.


gst_rtsp_media_is_eos_shutdown ()

-
gboolean
+
gboolean
 gst_rtsp_media_is_eos_shutdown (GstRTSPMedia *media);

Check if the pipeline for media will send an EOS down the pipeline before @@ -990,7 +990,7 @@ unpreparing.

Returns

-

TRUE if the media will send EOS before unpreparing.

+

TRUE if the media will send EOS before unpreparing.

@@ -1051,7 +1051,7 @@ gst_rtsp_media_get_address_pool (

Returns

the GstRTSPAddressPool of media -. g_object_unref() after +. g_object_unref() after usage.

[transfer full]

@@ -1061,7 +1061,7 @@ usage.

gst_rtsp_media_set_buffer_size ()

void
 gst_rtsp_media_set_buffer_size (GstRTSPMedia *media,
-                                guint size);
+ guint size);

Set the kernel UDP buffer size.

Parameters

@@ -1089,7 +1089,7 @@ gst_rtsp_media_set_buffer_size (

gst_rtsp_media_get_buffer_size ()

-
guint
+
guint
 gst_rtsp_media_get_buffer_size (GstRTSPMedia *media);

Get the kernel UDP buffer size.

@@ -1116,7 +1116,7 @@ gst_rtsp_media_get_buffer_size (

gst_rtsp_media_setup_sdp ()

-
gboolean
+
gboolean
 gst_rtsp_media_setup_sdp (GstRTSPMedia *media,
                           GstSDPMessage *sdp,
                           GstSDPInfo *info);
@@ -1161,7 +1161,7 @@ information in the SDP.


gst_rtsp_media_prepare ()

-
gboolean
+
gboolean
 gst_rtsp_media_prepare (GstRTSPMedia *media,
                         GstRTSPThread *thread);

Prepare media @@ -1188,7 +1188,7 @@ such as the duration.

+bus handler or NULL.

@@ -1196,14 +1196,14 @@ bus handler or

Returns

-

TRUE on success.

+

TRUE on success.


gst_rtsp_media_unprepare ()

-
gboolean
+
gboolean
 gst_rtsp_media_unprepare (GstRTSPMedia *media);

Unprepare media . After this call, the media should be prepared again before @@ -1226,7 +1226,7 @@ must be created.

Returns

-

TRUE on success.

+

TRUE on success.

@@ -1325,7 +1325,7 @@ gst_rtsp_media_get_suspend_mode (

gst_rtsp_media_suspend ()

-
gboolean
+
gboolean
 gst_rtsp_media_suspend (GstRTSPMedia *media);

Suspend media . The state of the pipeline managed by media @@ -1352,14 +1352,14 @@ with

Returns

-

TRUE on success.

+

TRUE on success.


gst_rtsp_media_unsuspend ()

-
gboolean
+
gboolean
 gst_rtsp_media_unsuspend (GstRTSPMedia *media);

Unsuspend media if it was in a suspended state. This method does nothing @@ -1381,7 +1381,7 @@ when the media was not in the suspended state.

Returns

-

TRUE on success.

+

TRUE on success.

@@ -1462,7 +1462,7 @@ exists.


gst_rtsp_media_n_streams ()

-
guint
+
guint
 gst_rtsp_media_n_streams (GstRTSPMedia *media);

Get the number of streams in this media.

@@ -1491,7 +1491,7 @@ gst_rtsp_media_n_streams (

gst_rtsp_media_get_stream ()

GstRTSPStream *
 gst_rtsp_media_get_stream (GstRTSPMedia *media,
-                           guint idx);
+ guint idx);

Retrieve the stream with index idx from media .

@@ -1521,7 +1521,7 @@ gst_rtsp_media_get_stream (

Returns

the GstRTSPStream at index idx -or NULL when a stream with that index did not exist.

+or NULL when a stream with that index did not exist.

[nullable][transfer none]

@@ -1530,7 +1530,7 @@ or

gst_rtsp_media_find_stream ()

GstRTSPStream *
 gst_rtsp_media_find_stream (GstRTSPMedia *media,
-                            const gchar *control);
+ const gchar *control);

Find a stream in media with control as the control uri.

@@ -1560,7 +1560,7 @@ gst_rtsp_media_find_stream (

Returns

the GstRTSPStream with control uri control -or NULL when a stream with that control did +or NULL when a stream with that control did not exist.

[nullable][transfer none]

@@ -1568,7 +1568,7 @@ not exist.


gst_rtsp_media_seek ()

-
gboolean
+
gboolean
 gst_rtsp_media_seek (GstRTSPMedia *media,
                      GstRTSPTimeRange *range);

Seek the pipeline of media @@ -1600,16 +1600,16 @@ gst_rtsp_media_seek (

Returns

-

TRUE on success.

+

TRUE on success.


gst_rtsp_media_get_range_string ()

-
gchar *
+
gchar *
 gst_rtsp_media_get_range_string (GstRTSPMedia *media,
-                                 gboolean play,
+                                 gboolean play,
                                  GstRTSPRangeUnit unit);

Get the current range as a string. media must be prepared with @@ -1643,17 +1643,17 @@ gst_rtsp_media_get_range_string (

Returns

-

The range as a string, g_free() after usage.

+

The range as a string, g_free() after usage.

[transfer full]


gst_rtsp_media_set_state ()

-
gboolean
+
gboolean
 gst_rtsp_media_set_state (GstRTSPMedia *media,
                           GstState state,
-                          GPtrArray *transports);
+ GPtrArray *transports);

Set the state of media to state and for the transports in transports @@ -1681,7 +1681,7 @@ gst_rtsp_media_set_state (

transports

-
+ @@ -1689,7 +1689,7 @@ gst_rtsp_media_set_state (

Returns

-

TRUE on success.

+

TRUE on success.

@@ -1792,7 +1792,7 @@ gst_rtsp_media_get_base_time (

gst_rtsp_media_use_time_provider ()

void
 gst_rtsp_media_use_time_provider (GstRTSPMedia *media,
-                                  gboolean time_provider);
+ gboolean time_provider);

Set media to provide a GstNetTimeProvider.

@@ -1821,7 +1821,7 @@ gst_rtsp_media_use_time_provider (

gst_rtsp_media_is_time_provider ()

-
gboolean
+
gboolean
 gst_rtsp_media_is_time_provider (GstRTSPMedia *media);

Check if media can provide a GstNetTimeProvider for its pipeline clock.

@@ -1843,7 +1843,7 @@ gst_rtsp_media_is_time_provider (

Returns

-

TRUE if media +

TRUE if media can provide a GstNetTimeProvider.

@@ -1853,7 +1853,7 @@ can provide a

gst_rtsp_media_get_time_provider ()

GstNetTimeProvider *
 gst_rtsp_media_get_time_provider (GstRTSPMedia *media,
-                                  const gchar *address,
+                                  const gchar *address,
                                   guint16 port);

Get the GstNetTimeProvider for the clock used by media . The time provider @@ -1876,7 +1876,7 @@ will listen on address

- + @@ -1946,7 +1946,7 @@ will listen on address - + @@ -2150,7 +2150,7 @@ after creating the SDP and when the client performs a PAUSED request.

Property Details

The “buffer-size” property

-
  “buffer-size”              guint
+
  “buffer-size”              guint

The kernel UDP buffer size to use.

Flags: Read / Write

Default value: 524288

@@ -2165,7 +2165,7 @@ after creating the SDP and when the client performs a PAUSED request.


The “eos-shutdown” property

-
  “eos-shutdown”             gboolean
+
  “eos-shutdown”             gboolean

Send an EOS event to the pipeline before unpreparing.

Flags: Read / Write

Default value: FALSE

@@ -2189,7 +2189,7 @@ after creating the SDP and when the client performs a PAUSED request.


The “reusable” property

-
  “reusable”                 gboolean
+
  “reusable”                 gboolean

If this media pipeline can be reused after an unprepare.

Flags: Read / Write

Default value: FALSE

@@ -2197,7 +2197,7 @@ after creating the SDP and when the client performs a PAUSED request.


The “shared” property

-
  “shared”                   gboolean
+
  “shared”                   gboolean

If this media pipeline can be shared.

Flags: Read / Write

Default value: FALSE

@@ -2213,7 +2213,7 @@ after creating the SDP and when the client performs a PAUSED request.


The “time-provider” property

-
  “time-provider”            gboolean
+
  “time-provider”            gboolean

Use a NetTimeProvider for clients.

Flags: Read / Write

Default value: FALSE

@@ -2225,8 +2225,8 @@ after creating the SDP and when the client performs a PAUSED request.

The “new-state” signal

void
 user_function (GstRTSPMedia *gstrtspmedia,
-               gint          arg1,
-               gpointer      user_data)
+ gint arg1, + gpointer user_data)

Flags: Run Last


@@ -2235,7 +2235,7 @@ user_function (void user_function (GstRTSPMedia *gstrtspmedia, GstRTSPStream *arg1, - gpointer user_data) + gpointer user_data)

Flags: Run Last


@@ -2243,7 +2243,7 @@ user_function (

The “prepared” signal

void
 user_function (GstRTSPMedia *gstrtspmedia,
-               gpointer      user_data)
+ gpointer user_data)

Flags: Run Last


@@ -2252,7 +2252,7 @@ user_function (void user_function (GstRTSPMedia *gstrtspmedia, GstRTSPStream *arg1, - gpointer user_data) + gpointer user_data)

Flags: Run Last


@@ -2260,8 +2260,8 @@ user_function (

The “target-state” signal

void
 user_function (GstRTSPMedia *gstrtspmedia,
-               gint          arg1,
-               gpointer      user_data)
+ gint arg1, + gpointer user_data)

Flags: Run Last


@@ -2269,7 +2269,7 @@ user_function (

The “unprepared” signal

void
 user_function (GstRTSPMedia *gstrtspmedia,
-               gpointer      user_data)
+ gpointer user_data)

Flags: Run Last

diff --git a/docs/libs/html/GstRTSPMediaFactory.html b/docs/libs/html/GstRTSPMediaFactory.html index 8ea1709..703b800 100644 --- a/docs/libs/html/GstRTSPMediaFactory.html +++ b/docs/libs/html/GstRTSPMediaFactory.html @@ -52,7 +52,7 @@
- + - + +gchar * @@ -257,7 +257,7 @@ - + @@ -312,7 +312,7 @@

Object Hierarchy

-
    GObject
+
    GObject
     ╰── GstRTSPMediaFactory
 
@@ -345,7 +345,7 @@ gst_rtsp_media_factory_new (void<

gst_rtsp_media_factory_get_launch ()

-
gchar *
+
gchar *
 gst_rtsp_media_factory_get_launch (GstRTSPMediaFactory *factory);

Get the gst_parse_launch() pipeline description that will be used in the default prepare vmethod.

@@ -366,7 +366,7 @@ default prepare vmethod.

Returns

-

the configured launch description. g_free() after +

the configured launch description. g_free() after usage.

[transfer full]

@@ -376,7 +376,7 @@ usage.

gst_rtsp_media_factory_set_launch ()

void
 gst_rtsp_media_factory_set_launch (GstRTSPMediaFactory *factory,
-                                   const gchar *launch);
+ const gchar *launch);

The gst_parse_launch() line to use for constructing the pipeline in the default prepare vmethod.

The pipeline description should return a GstBin as the toplevel element @@ -474,8 +474,8 @@ gst_rtsp_media_factory_set_permissions

gst_rtsp_media_factory_add_role ()

void
 gst_rtsp_media_factory_add_role (GstRTSPMediaFactory *factory,
-                                 const gchar *role,
-                                 const gchar *fieldname,
+                                 const gchar *role,
+                                 const gchar *fieldname,
                                  ...);

A convenience method to add role with fieldname @@ -522,7 +522,7 @@ will be created and the role will be added to it.

gst_rtsp_media_factory_set_shared ()

void
 gst_rtsp_media_factory_set_shared (GstRTSPMediaFactory *factory,
-                                   gboolean shared);
+ gboolean shared);

Configure if media created from this factory can be shared between clients.

Parameters

@@ -550,7 +550,7 @@ gst_rtsp_media_factory_set_shared (

gst_rtsp_media_factory_is_shared ()

-
gboolean
+
gboolean
 gst_rtsp_media_factory_is_shared (GstRTSPMediaFactory *factory);

Get if media created from this factory can be shared between clients.

@@ -570,14 +570,14 @@ gst_rtsp_media_factory_is_shared (

Returns

-

TRUE if the media will be shared between clients.

+

TRUE if the media will be shared between clients.


gst_rtsp_media_factory_is_eos_shutdown ()

-
gboolean
+
gboolean
 gst_rtsp_media_factory_is_eos_shutdown
                                (GstRTSPMediaFactory *factory);

Get if media created from this factory will have an EOS event sent to the @@ -599,7 +599,7 @@ pipeline before shutdown.

Returns

-

TRUE if the media will receive EOS before shutdown.

+

TRUE if the media will receive EOS before shutdown.

@@ -609,7 +609,7 @@ pipeline before shutdown.

void
 gst_rtsp_media_factory_set_eos_shutdown
                                (GstRTSPMediaFactory *factory,
-                                gboolean eos_shutdown);
+ gboolean eos_shutdown);

Configure if media created from this factory will have an EOS sent to the pipeline before shutdown.

@@ -779,7 +779,7 @@ gst_rtsp_media_factory_get_address_pool

Returns

the GstRTSPAddressPool of factory -. g_object_unref() after +. g_object_unref() after usage.

[transfer full]

@@ -820,7 +820,7 @@ gst_rtsp_media_factory_set_address_pool

gst_rtsp_media_factory_get_buffer_size ()

-
guint
+
guint
 gst_rtsp_media_factory_get_buffer_size
                                (GstRTSPMediaFactory *factory);

Get the kernel UDP buffer size.

@@ -851,7 +851,7 @@ gst_rtsp_media_factory_get_buffer_size
void
 gst_rtsp_media_factory_set_buffer_size
                                (GstRTSPMediaFactory *factory,
-                                guint size);
+ guint size);

Set the kernel UDP buffer size.

Parameters

@@ -1053,7 +1053,7 @@ can contain multiple streams like audio and video.

- + @@ -1115,7 +1115,7 @@ implementation will configure the 'shared' property of the media.

Property Details

The “buffer-size” property

-
  “buffer-size”              guint
+
  “buffer-size”              guint

The kernel UDP buffer size to use.

Flags: Read / Write

Default value: 524288

@@ -1123,7 +1123,7 @@ implementation will configure the 'shared' property of the media.


The “eos-shutdown” property

-
  “eos-shutdown”             gboolean
+
  “eos-shutdown”             gboolean

Send EOS down the pipeline before shutting down.

Flags: Read / Write

Default value: FALSE

@@ -1131,7 +1131,7 @@ implementation will configure the 'shared' property of the media.


The “launch” property

-
  “launch”                   gchar *
+
  “launch”                   gchar *

A launch description of the pipeline.

Flags: Read / Write

Default value: NULL

@@ -1155,7 +1155,7 @@ implementation will configure the 'shared' property of the media.


The “shared” property

-
  “shared”                   gboolean
+
  “shared”                   gboolean

If media from this factory is shared.

Flags: Read / Write

Default value: FALSE

@@ -1176,7 +1176,7 @@ implementation will configure the 'shared' property of the media.

void
 user_function (GstRTSPMediaFactory *gstrtspmediafactory,
                GstRTSPMedia        *arg1,
-               gpointer             user_data)
+ gpointer user_data)

Flags: Run Last


@@ -1185,7 +1185,7 @@ user_function (void user_function (GstRTSPMediaFactory *gstrtspmediafactory, GstRTSPMedia *arg1, - gpointer user_data) + gpointer user_data)

Flags: Run Last

diff --git a/docs/libs/html/GstRTSPMountPoints.html b/docs/libs/html/GstRTSPMountPoints.html index 838066e..a685b7b 100644 --- a/docs/libs/html/GstRTSPMountPoints.html +++ b/docs/libs/html/GstRTSPMountPoints.html @@ -74,7 +74,7 @@

Returns

the GstRTSPMediaFactory for path . -g_object_unref() after usage.

+g_object_unref() after usage.

[transfer full]


gst_rtsp_mount_points_make_path ()

-
gchar *
+
gchar *
 gst_rtsp_mount_points_make_path (GstRTSPMountPoints *mounts,
                                  const GstRTSPUrl *url);

Make a path string from url @@ -294,7 +294,7 @@ gst_rtsp_mount_points_make_path (

Returns

a path string for url -, g_free() after usage.

+, g_free() after usage.

[transfer full]

@@ -327,7 +327,7 @@ gst_rtsp_mount_points_make_path (
- + diff --git a/docs/libs/html/GstRTSPServer.html b/docs/libs/html/GstRTSPServer.html index 435205c..e9547e9 100644 --- a/docs/libs/html/GstRTSPServer.html +++ b/docs/libs/html/GstRTSPServer.html @@ -52,7 +52,7 @@ +gchar * - + - + @@ -262,7 +262,7 @@ +gchar * @@ -311,7 +311,7 @@

Object Hierarchy

-
    GObject
+
    GObject
     ╰── GstRTSPServer
 
@@ -327,8 +327,8 @@ network (0.0.0.0) and port 8554.

The server will require an SSL connection when a TLS certificate has been set in the auth object with gst_rtsp_auth_set_tls_certificate().

To start the server, use gst_rtsp_server_attach() to attach it to a -GMainContext. For more control, gst_rtsp_server_create_source() and -gst_rtsp_server_create_socket() can be used to get a GSource and GSocket +GMainContext. For more control, gst_rtsp_server_create_source() and +gst_rtsp_server_create_socket() can be used to get a GSource and GSocket respectively.

gst_rtsp_server_transfer_connection() can be used to transfer an existing socket to the RTSP server, for example from an HTTP server.

@@ -357,7 +357,7 @@ gst_rtsp_server_new (void<

gst_rtsp_server_get_address ()

-
gchar *
+
gchar *
 gst_rtsp_server_get_address (GstRTSPServer *server);

Get the address on which the server will accept connections.

@@ -377,7 +377,7 @@ gst_rtsp_server_get_address (

Returns

-

the server address. g_free() after usage.

+

the server address. g_free() after usage.

[transfer full]

@@ -386,7 +386,7 @@ gst_rtsp_server_get_address (

gst_rtsp_server_set_address ()

void
 gst_rtsp_server_set_address (GstRTSPServer *server,
-                             const gchar *address);
+ const gchar *address);

Configure server to accept connections on the given address.

This function must be called before the server is bound.

@@ -416,7 +416,7 @@ gst_rtsp_server_set_address (

gst_rtsp_server_get_service ()

-
gchar *
+
gchar *
 gst_rtsp_server_get_service (GstRTSPServer *server);

Get the service on which the server will accept connections.

@@ -436,7 +436,7 @@ gst_rtsp_server_get_service (

Returns

-

the service. use g_free() after usage.

+

the service. use g_free() after usage.

[transfer full]

@@ -445,7 +445,7 @@ gst_rtsp_server_get_service (

gst_rtsp_server_set_service ()

void
 gst_rtsp_server_set_service (GstRTSPServer *server,
-                             const gchar *service);
+ const gchar *service);

Configure server to accept connections on the given service. service @@ -482,7 +482,7 @@ port. The actual used port can be retrieved with


gst_rtsp_server_get_backlog ()

-
gint
+
gint
 gst_rtsp_server_get_backlog (GstRTSPServer *server);

The maximum amount of queued requests for the server.

@@ -511,7 +511,7 @@ gst_rtsp_server_get_backlog (

gst_rtsp_server_set_backlog ()

void
 gst_rtsp_server_set_backlog (GstRTSPServer *server,
-                             gint backlog);
+ gint backlog);

configure the maximum amount of requests that may be queued for the server.

This function must be called before the server is bound.

@@ -590,7 +590,7 @@ gst_rtsp_server_get_mount_points (

Returns

the GstRTSPMountPoints of server -. g_object_unref() after +. g_object_unref() after usage.

[transfer full]

@@ -651,7 +651,7 @@ gst_rtsp_server_get_session_pool (

Returns

-

the GstRTSPSessionPool used for sessions. g_object_unref() after +

the GstRTSPSessionPool used for sessions. g_object_unref() after usage.

[transfer full]

@@ -713,7 +713,7 @@ gst_rtsp_server_get_thread_pool (

Returns

the GstRTSPThreadPool of server -. g_object_unref() after +. g_object_unref() after usage.

[transfer full]

@@ -775,7 +775,7 @@ gst_rtsp_server_get_auth (

Returns

the GstRTSPAuth of server -. g_object_unref() after +. g_object_unref() after usage.

[transfer full]

@@ -815,12 +815,12 @@ gst_rtsp_server_set_auth (

gst_rtsp_server_transfer_connection ()

-
gboolean
+
gboolean
 gst_rtsp_server_transfer_connection (GstRTSPServer *server,
-                                     GSocket *socket,
-                                     const gchar *ip,
-                                     gint port,
-                                     const gchar *initial_buffer);
+ GSocket *socket, + const gchar *ip, + gint port, + const gchar *initial_buffer);

Take an existing network socket and use it for an RTSP connection. This is used when transferring a socket from an HTTP server which should be used as an RTSP over HTTP tunnel. The initial_buffer @@ -872,11 +872,11 @@ that the HTTP server read from the socket while parsing the HTTP header.


gst_rtsp_server_io_func ()

-
gboolean
-gst_rtsp_server_io_func (GSocket *socket,
-                         GIOCondition condition,
+
gboolean
+gst_rtsp_server_io_func (GSocket *socket,
+                         GIOCondition condition,
                          GstRTSPServer *server);
-

A default GSocketSourceFunc that creates a new GstRTSPClient to accept and handle a +

A default GSocketSourceFunc that creates a new GstRTSPClient to accept and handle a new connection on socket or server .

@@ -891,7 +891,7 @@ new connection on socket
- + @@ -917,11 +917,11 @@ new connection on socket

gst_rtsp_server_create_socket ()

-
GSocket *
+
GSocket *
 gst_rtsp_server_create_socket (GstRTSPServer *server,
-                               GCancellable *cancellable,
-                               GError **error);
-

Create a GSocket for server + GCancellable *cancellable, + GError **error);

+

Create a GSocket for server . The socket will listen on the configured service.

@@ -940,12 +940,12 @@ configured service.

- + - + @@ -953,8 +953,8 @@ configured service.

Returns

-

the GSocket for server -or NULL when an error +

the GSocket for server +or NULL when an error occurred.

[transfer full]

@@ -962,18 +962,18 @@ occurred.


gst_rtsp_server_create_source ()

-
GSource *
+
GSource *
 gst_rtsp_server_create_source (GstRTSPServer *server,
-                               GCancellable *cancellable,
-                               GError **error);
-

Create a GSource for server + GCancellable *cancellable, + GError **error);

+

Create a GSource for server . The new source will have a default -GSocketSourceFunc of gst_rtsp_server_io_func().

+GSocketSourceFunc of gst_rtsp_server_io_func().

cancellable - if not NULL can be used to cancel the source, which will cause + if not NULL can be used to cancel the source, which will cause the source to trigger, reporting the current condition (which is likely 0 unless cancellation happened at the same time as a condition change). You can -check for this in the callback using g_cancellable_is_cancelled().

+check for this in the callback using g_cancellable_is_cancelled().

Parameters

-gboolean +gboolean gst_rtsp_media_is_shared () @@ -108,7 +108,7 @@
-gboolean +gboolean gst_rtsp_media_is_reusable () @@ -156,7 +156,7 @@
-gboolean +gboolean gst_rtsp_media_is_eos_shutdown () @@ -188,7 +188,7 @@
-guint +guint gst_rtsp_media_get_buffer_size () @@ -196,7 +196,7 @@
-gboolean +gboolean gst_rtsp_media_setup_sdp () @@ -204,7 +204,7 @@
-gboolean +gboolean gst_rtsp_media_prepare () @@ -212,7 +212,7 @@
-gboolean +gboolean gst_rtsp_media_unprepare () @@ -244,7 +244,7 @@
-gboolean +gboolean gst_rtsp_media_suspend () @@ -252,7 +252,7 @@
-gboolean +gboolean gst_rtsp_media_unsuspend () @@ -276,7 +276,7 @@
-guint +guint gst_rtsp_media_n_streams () @@ -300,7 +300,7 @@
-gboolean +gboolean gst_rtsp_media_seek () @@ -308,7 +308,7 @@
-gchar * +gchar * gst_rtsp_media_get_range_string () @@ -316,7 +316,7 @@
-gboolean +gboolean gst_rtsp_media_set_state () @@ -356,7 +356,7 @@
-gboolean +gboolean gst_rtsp_media_is_time_provider () @@ -383,7 +383,7 @@
guintguint buffer-size Read / Write
Read / Write / Construct Only
gbooleangboolean eos-shutdown Read / Write
Read / Write
gbooleangboolean reusable Read / Write
gbooleangboolean shared Read / Write
Read / Write
gbooleangboolean time-provider Read / Write

thread

a GstRTSPThread to run the -bus handler or NULL.

[transfer full][allow-none]

a GPtrArray of GstRTSPStreamTransport pointers.

a GPtrArray of GstRTSPStreamTransport pointers.

[transfer none][element-type GstRtspServer.RTSPStreamTransport]

address

an address or NULL.

an address or NULL.

[allow-none]

GObjectClass parent_class;

GObjectClass parent_class;

   
-gchar * +gchar * gst_rtsp_media_factory_get_launch () @@ -100,7 +100,7 @@
-gboolean +gboolean gst_rtsp_media_factory_is_shared () @@ -108,7 +108,7 @@
-gboolean +gboolean gst_rtsp_media_factory_is_eos_shutdown () @@ -172,7 +172,7 @@
-guint +guint gst_rtsp_media_factory_get_buffer_size () @@ -231,18 +231,18 @@
guintguint buffer-size Read / Write
gbooleangboolean eos-shutdown Read / Write
-gchar *launch Read / Write
Read / Write
gbooleangboolean shared Read / Write

GObjectClass parent_class;

GObjectClass parent_class;

   
-gchar * +gchar * gst_rtsp_mount_points_make_path () @@ -104,7 +104,7 @@

Object Hierarchy

-
    GObject
+
    GObject
     ╰── GstRTSPMountPoints
 
@@ -138,7 +138,7 @@ gst_rtsp_mount_points_new (void

gst_rtsp_mount_points_add_factory ()

void
 gst_rtsp_mount_points_add_factory (GstRTSPMountPoints *mounts,
-                                   const gchar *path,
+                                   const gchar *path,
                                    GstRTSPMediaFactory *factory);

Attach factory to the mount point path @@ -183,7 +183,7 @@ used after calling this function.

gst_rtsp_mount_points_remove_factory ()

void
 gst_rtsp_mount_points_remove_factory (GstRTSPMountPoints *mounts,
-                                      const gchar *path);
+ const gchar *path);

Remove the GstRTSPMediaFactory associated with path in mounts .

@@ -215,13 +215,13 @@ gst_rtsp_mount_points_remove_factory (

gst_rtsp_mount_points_match ()

GstRTSPMediaFactory *
 gst_rtsp_mount_points_match (GstRTSPMountPoints *mounts,
-                             const gchar *path,
-                             gint *matched);
+ const gchar *path, + gint *matched);

Find the factory in mounts that has the longest match with path .

If matched - is NULL, path + is NULL, path will match the factory exactly otherwise the amount of characters that matched is returned in matched .

@@ -257,14 +257,14 @@ matched.

GObjectClass parent_class;

GObjectClass parent_class;

   
-gchar * +gchar * gst_rtsp_server_get_address () @@ -68,7 +68,7 @@
-gchar * +gchar * gst_rtsp_server_get_service () @@ -84,7 +84,7 @@
-gint +gint gst_rtsp_server_get_backlog () @@ -172,7 +172,7 @@
-gboolean +gboolean gst_rtsp_server_transfer_connection () @@ -180,7 +180,7 @@
-gboolean +gboolean gst_rtsp_server_io_func () @@ -188,7 +188,7 @@
-GSocket * +GSocket * gst_rtsp_server_create_socket () @@ -196,7 +196,7 @@
-GSource * +GSource * gst_rtsp_server_create_source () @@ -204,7 +204,7 @@
-guint +guint gst_rtsp_server_attach () @@ -220,7 +220,7 @@
-GList * +GList * gst_rtsp_server_client_filter () @@ -240,17 +240,17 @@
-gchar *address Read / Write
gintgint backlog Read / Write
gintgint bound-port Read
-gchar *service Read / Write

socket

a GSocket

a GSocket

 

cancellable

a GCancellable.

a GCancellable.

[allow-none]

error

a GError.

a GError.

[out]
@@ -990,12 +990,12 @@ check for this in the callback using

cancellable

-
+ - + @@ -1003,24 +1003,24 @@ check for this in the callback using

Returns

-

the GSource for server -or NULL when an error -occurred. Free with g_source_unref().

+

the GSource for server +or NULL when an error +occurred. Free with g_source_unref().

[transfer full]


gst_rtsp_server_attach ()

-
guint
+
guint
 gst_rtsp_server_attach (GstRTSPServer *server,
-                        GMainContext *context);
+ GMainContext *context);

Attaches server to context . When the mainloop for context is run, the server will be dispatched. When context - is NULL, the default context will be + is NULL, the default context will be used).

This function should be called when the server properties and urls are fully configured and the server is ready to start.

@@ -1040,7 +1040,7 @@ configured and the server is ready to start.

- + @@ -1058,7 +1058,7 @@ configured and the server is ready to start.

GstRTSPFilterResult
 (*GstRTSPServerClientFilterFunc) (GstRTSPServer *server,
                                   GstRTSPClient *client,
-                                  gpointer user_data);
+ gpointer user_data);

This function will be called by the gst_rtsp_server_client_filter(). An implementation should return a value of GstRTSPFilterResult.

When this function returns GST_RTSP_FILTER_REMOVE, client @@ -1070,7 +1070,7 @@ from server server .

A value of GST_RTSP_FILTER_REF will add client - to the result GList of + to the result GList of gst_rtsp_server_client_filter().

Parameters

@@ -1109,10 +1109,10 @@ from server

gst_rtsp_server_client_filter ()

-
GList *
+
GList *
 gst_rtsp_server_client_filter (GstRTSPServer *server,
                                GstRTSPServerClientFilterFunc func,
-                               gpointer user_data);
+ gpointer user_data);

Call func for each client managed by server . The result value of func @@ -1133,10 +1133,10 @@ locked so no further actions on server

If func returns GST_RTSP_FILTER_REF, the client will remain in server but -will also be added with an additional ref to the result GList of this +will also be added with an additional ref to the result GList of this function..

When func - is NULL, GST_RTSP_FILTER_REF will be assumed for each client.

+ is NULL, GST_RTSP_FILTER_REF will be assumed for each client.

Parameters

a GCancellable or NULL.

a GCancellable or NULL.

[allow-none]

error

a GError.

a GError.

[out]

context

a GMainContext.

a GMainContext.

[allow-none]
@@ -1167,10 +1167,10 @@ function..

Returns

-

a GList with all +

a GList with all clients for which func returned GST_RTSP_FILTER_REF. After usage, each -element in the GList should be unreffed before the list is freed.

+element in the GList should be unreffed before the list is freed.

[element-type GstRTSPClient][transfer full]

@@ -1206,7 +1206,7 @@ it.

- + @@ -1233,7 +1233,7 @@ mount-points, auth, session-pool and thread-pool on the client.

Property Details

The “address” property

-
  “address”                  gchar *
+
  “address”                  gchar *

The address the server uses to listen on.

Flags: Read / Write

Default value: "0.0.0.0"

@@ -1241,7 +1241,7 @@ mount-points, auth, session-pool and thread-pool on the client.


The “backlog” property

-
  “backlog”                  gint
+
  “backlog”                  gint

The maximum length to which the queue of pending connections may grow.

Flags: Read / Write

Allowed values: >= 0

@@ -1250,7 +1250,7 @@ mount-points, auth, session-pool and thread-pool on the client.


The “bound-port” property

-
  “bound-port”               gint
+
  “bound-port”               gint

The port number the server is listening on.

Flags: Read

Allowed values: [-1,65535]

@@ -1266,7 +1266,7 @@ mount-points, auth, session-pool and thread-pool on the client.


The “service” property

-
  “service”                  gchar *
+
  “service”                  gchar *

The service or port number the server uses to listen on.

Flags: Read / Write

Default value: "8554"

@@ -1286,7 +1286,7 @@ mount-points, auth, session-pool and thread-pool on the client.

void
 user_function (GstRTSPServer *gstrtspserver,
                GstRTSPClient *arg1,
-               gpointer       user_data)
+ gpointer user_data)

Flags: Run Last

diff --git a/docs/libs/html/GstRTSPSession.html b/docs/libs/html/GstRTSPSession.html index e61e4a9..38cc654 100644 --- a/docs/libs/html/GstRTSPSession.html +++ b/docs/libs/html/GstRTSPSession.html @@ -50,7 +50,7 @@
- +gchar * - + - + @@ -216,7 +216,7 @@

Object Hierarchy

-
    GObject
+
    GObject
     ╰── GstRTSPSession
 
@@ -244,7 +244,7 @@ with a url. Use

gst_rtsp_session_new ()

GstRTSPSession *
-gst_rtsp_session_new (const gchar *sessionid);
+gst_rtsp_session_new (const gchar *sessionid);

Create a new GstRTSPSession instance with sessionid .

@@ -271,7 +271,7 @@ gst_rtsp_session_new (const

gst_rtsp_session_get_sessionid ()

-
const gchar *
+
const gchar *
 gst_rtsp_session_get_sessionid (GstRTSPSession *session);

Get the sessionid of session .

@@ -302,7 +302,7 @@ is alive.


gst_rtsp_session_get_header ()

-
gchar *
+
gchar *
 gst_rtsp_session_get_header (GstRTSPSession *session);

Get the string that can be placed in the Session header field.

@@ -323,7 +323,7 @@ gst_rtsp_session_get_header (

Returns

the Session header of session -. g_free() after usage.

+. g_free() after usage.

[transfer full]

@@ -332,7 +332,7 @@ gst_rtsp_session_get_header (

gst_rtsp_session_set_timeout ()

void
 gst_rtsp_session_set_timeout (GstRTSPSession *session,
-                              guint timeout);
+ guint timeout);

Configure session for a timeout of timeout seconds. The session will be @@ -364,7 +364,7 @@ cleaned up when there is no activity for timeout

gst_rtsp_session_get_timeout ()

-
guint
+
guint
 gst_rtsp_session_get_timeout (GstRTSPSession *session);

Get the timeout value of session .

@@ -462,9 +462,9 @@ amount of time as

gst_rtsp_session_next_timeout ()

-
gint
+
gint
 gst_rtsp_session_next_timeout (GstRTSPSession *session,
-                               GTimeVal *now);
+ GTimeVal *now);

Get the amount of milliseconds till the session will expire.

Parameters

@@ -497,9 +497,9 @@ gst_rtsp_session_next_timeout (

gst_rtsp_session_is_expired ()

-
gboolean
+
gboolean
 gst_rtsp_session_is_expired (GstRTSPSession *session,
-                             GTimeVal *now);
+ GTimeVal *now);

Check if session timeout out.

@@ -526,7 +526,7 @@ gst_rtsp_session_is_expired (

Returns

-

TRUE if session +

TRUE if session timed out

@@ -536,7 +536,7 @@ timed out

gst_rtsp_session_manage_media ()

GstRTSPSessionMedia *
 gst_rtsp_session_manage_media (GstRTSPSession *sess,
-                               const gchar *path,
+                               const gchar *path,
                                GstRTSPMedia *media);

Manage the media object obj in sess @@ -582,7 +582,7 @@ object.


gst_rtsp_session_release_media ()

-
gboolean
+
gboolean
 gst_rtsp_session_release_media (GstRTSPSession *sess,
                                 GstRTSPSessionMedia *media);

Release the managed media @@ -612,7 +612,7 @@ gst_rtsp_session_release_media (

Returns

-

TRUE if there are more media session left in sess +

TRUE if there are more media session left in sess .

@@ -622,8 +622,8 @@ gst_rtsp_session_release_media (

gst_rtsp_session_get_media ()

GstRTSPSessionMedia *
 gst_rtsp_session_get_media (GstRTSPSession *sess,
-                            const gchar *path,
-                            gint *matched);
+ const gchar *path, + gint *matched);

Get the session media for path . matched will contain the number of matched @@ -670,7 +670,7 @@ in sess

GstRTSPFilterResult
 (*GstRTSPSessionFilterFunc) (GstRTSPSession *sess,
                              GstRTSPSessionMedia *media,
-                             gpointer user_data);
+ gpointer user_data);

This function will be called by the gst_rtsp_session_filter(). An implementation should return a value of GstRTSPFilterResult.

When this function returns GST_RTSP_FILTER_REMOVE, media @@ -682,7 +682,7 @@ from sess sess .

A value of GST_RTSP_FILTER_REF will add media - to the result GList of + to the result GList of gst_rtsp_session_filter().

Parameters

@@ -721,10 +721,10 @@ from sess

gst_rtsp_session_filter ()

-
GList *
+
GList *
 gst_rtsp_session_filter (GstRTSPSession *sess,
                          GstRTSPSessionFilterFunc func,
-                         gpointer user_data);
+ gpointer user_data);

Call func for each media in sess . The result value of func @@ -745,10 +745,10 @@ locked so no further actions on sess

If func returns GST_RTSP_FILTER_REF, the media will remain in sess but -will also be added with an additional ref to the result GList of this +will also be added with an additional ref to the result GList of this function..

When func - is NULL, GST_RTSP_FILTER_REF will be assumed for all media.

+ is NULL, GST_RTSP_FILTER_REF will be assumed for all media.

Parameters

GObjectClass parent_class;

GObjectClass parent_class;

   
const gchar * +const gchar * gst_rtsp_session_get_sessionid () @@ -58,7 +58,7 @@
-gchar * +gchar * gst_rtsp_session_get_header () @@ -74,7 +74,7 @@
-guint +guint gst_rtsp_session_get_timeout () @@ -106,7 +106,7 @@
-gint +gint gst_rtsp_session_next_timeout () @@ -114,7 +114,7 @@
-gboolean +gboolean gst_rtsp_session_is_expired () @@ -130,7 +130,7 @@
-gboolean +gboolean gst_rtsp_session_release_media () @@ -154,7 +154,7 @@
-GList * +GList * gst_rtsp_session_filter () @@ -174,17 +174,17 @@
-gchar *sessionid Read / Write / Construct Only
guintguint timeout Read / Write
gbooleangboolean timeout-always-visible Read / Write
@@ -782,7 +782,7 @@ function..

a GList with all media for which func returned GST_RTSP_FILTER_REF. After usage, each -element in the GList should be unreffed before the list is freed.

+element in the GList should be unreffed before the list is freed.

[element-type GstRTSPSessionMedia][transfer full]

@@ -847,7 +847,7 @@ identified with the url of a media.

Property Details

The “sessionid” property

-
  “sessionid”                gchar *
+
  “sessionid”                gchar *

the session id.

Flags: Read / Write / Construct Only

Default value: NULL

@@ -855,7 +855,7 @@ identified with the url of a media.


The “timeout” property

-
  “timeout”                  guint
+
  “timeout”                  guint

the timeout of the session (0 = never).

Flags: Read / Write

Default value: 60

@@ -863,7 +863,7 @@ identified with the url of a media.


The “timeout-always-visible” property

-
  “timeout-always-visible”   gboolean
+
  “timeout-always-visible”   gboolean

timeout always visible in header.

Flags: Read / Write

Default value: FALSE

diff --git a/docs/libs/html/GstRTSPSessionPool.html b/docs/libs/html/GstRTSPSessionPool.html index a598a0c..718aef7 100644 --- a/docs/libs/html/GstRTSPSessionPool.html +++ b/docs/libs/html/GstRTSPSessionPool.html @@ -52,7 +52,7 @@
- + @@ -192,7 +192,7 @@

Object Hierarchy

-
    GObject
+
    GObject
     ╰── GstRTSPSessionPool
 
@@ -220,7 +220,7 @@ gst_rtsp_session_pool_new (voidCreate a new GstRTSPSessionPool instance.

Returns

-

A new GstRTSPSessionPool. g_object_unref() after +

A new GstRTSPSessionPool. g_object_unref() after usage.

[transfer full]

@@ -228,7 +228,7 @@ usage.


gst_rtsp_session_pool_get_max_sessions ()

-
guint
+
guint
 gst_rtsp_session_pool_get_max_sessions
                                (GstRTSPSessionPool *pool);

Get the maximum allowed number of sessions in pool @@ -261,7 +261,7 @@ amount of sessions.

void
 gst_rtsp_session_pool_set_max_sessions
                                (GstRTSPSessionPool *pool,
-                                guint max);
+ guint max);

Configure the maximum allowed number of sessions in pool to max . @@ -292,7 +292,7 @@ A value of 0 means an unlimited amount of sessions.


gst_rtsp_session_pool_get_n_sessions ()

-
guint
+
guint
 gst_rtsp_session_pool_get_n_sessions (GstRTSPSessionPool *pool);

Get the amount of active sessions in pool .

@@ -351,7 +351,7 @@ gst_rtsp_session_pool_create (

gst_rtsp_session_pool_find ()

GstRTSPSession *
 gst_rtsp_session_pool_find (GstRTSPSessionPool *pool,
-                            const gchar *sessionid);
+ const gchar *sessionid);

Find the session with sessionid in pool . The access time of the session @@ -381,14 +381,14 @@ will be updated with

Returns

the GstRTSPSession with sessionid -or NULL when the session did not exist. g_object_unref() after usage.

+or NULL when the session did not exist. g_object_unref() after usage.

[transfer full][nullable]


gst_rtsp_session_pool_remove ()

-
gboolean
+
gboolean
 gst_rtsp_session_pool_remove (GstRTSPSessionPool *pool,
                               GstRTSPSession *sess);

Remove sess @@ -419,14 +419,14 @@ gst_rtsp_session_pool_remove (

Returns

-

TRUE if the session was found and removed.

+

TRUE if the session was found and removed.


gst_rtsp_session_pool_cleanup ()

-
guint
+
guint
 gst_rtsp_session_pool_cleanup (GstRTSPSessionPool *pool);

Inspect all the sessions in pool and remove the sessions that are inactive @@ -455,9 +455,9 @@ for more than their timeout.


GstRTSPSessionPoolFunc ()

-
gboolean
+
gboolean
 (*GstRTSPSessionPoolFunc) (GstRTSPSessionPool *pool,
-                           gpointer user_data);
+ gpointer user_data);

The function that will be called from the GSource watch on the session pool.

The function will be called when the pool must be cleaned up because one or more sessions timed out.

@@ -485,16 +485,16 @@ more sessions timed out.

Returns

-

FALSE if the source should be removed.

+

FALSE if the source should be removed.


gst_rtsp_session_pool_create_watch ()

-
GSource *
+
GSource *
 gst_rtsp_session_pool_create_watch (GstRTSPSessionPool *pool);
-

Create a GSource that will be dispatched when the session should be cleaned +

Create a GSource that will be dispatched when the session should be cleaned up.

Parameters

@@ -513,7 +513,7 @@ up.

Returns

-

a GSource.

+

a GSource.

[transfer full]

@@ -523,7 +523,7 @@ up.

GstRTSPFilterResult
 (*GstRTSPSessionPoolFilterFunc) (GstRTSPSessionPool *pool,
                                  GstRTSPSession *session,
-                                 gpointer user_data);
+ gpointer user_data);

This function will be called by the gst_rtsp_session_pool_filter(). An implementation should return a value of GstRTSPFilterResult.

When this function returns GST_RTSP_FILTER_REMOVE, session @@ -535,7 +535,7 @@ from pool pool .

A value of GST_RTSP_FILTER_REF will add session - to the result GList of + to the result GList of gst_rtsp_session_pool_filter().

Parameters

@@ -574,10 +574,10 @@ from pool

gst_rtsp_session_pool_filter ()

-
GList *
+
GList *
 gst_rtsp_session_pool_filter (GstRTSPSessionPool *pool,
                               GstRTSPSessionPoolFilterFunc func,
-                              gpointer user_data);
+ gpointer user_data);

Call func for each session in pool . The result value of func @@ -601,7 +601,7 @@ expired state with gst_rtsp_session_set_expired() will also be added with an additional ref to the result GList of this function..

When func - is NULL, GST_RTSP_FILTER_REF will be assumed for all sessions.

+ is NULL, GST_RTSP_FILTER_REF will be assumed for all sessions.

Parameters

-guint +guint gst_rtsp_session_pool_get_max_sessions () @@ -68,7 +68,7 @@
-guint +guint gst_rtsp_session_pool_get_n_sessions () @@ -92,7 +92,7 @@
-gboolean +gboolean gst_rtsp_session_pool_remove () @@ -100,7 +100,7 @@
-guint +guint gst_rtsp_session_pool_cleanup () @@ -108,7 +108,7 @@
-gboolean +gboolean (*GstRTSPSessionPoolFunc) () @@ -116,7 +116,7 @@
-GSource * +GSource * gst_rtsp_session_pool_create_watch () @@ -132,7 +132,7 @@
-GList * +GList * gst_rtsp_session_pool_filter () @@ -150,7 +150,7 @@
guintguint max-sessions Read / Write
@@ -672,7 +672,7 @@ attached to a - + @@ -701,7 +701,7 @@ custom session ids and should not check if the session exists.

Property Details

The “max-sessions” property

-
  “max-sessions”             guint
+
  “max-sessions”             guint

the maximum amount of sessions (0 = unlimited).

Flags: Read / Write

Default value: 0

@@ -714,7 +714,7 @@ custom session ids and should not check if the session exists.

void
 user_function (GstRTSPSessionPool *gstrtspsessionpool,
                GstRTSPSession     *arg1,
-               gpointer            user_data)
+ gpointer user_data)

Flags: Run Last

diff --git a/docs/libs/html/GstRTSPStream.html b/docs/libs/html/GstRTSPStream.html index fcbe74c..fee8a7d 100644 --- a/docs/libs/html/GstRTSPStream.html +++ b/docs/libs/html/GstRTSPStream.html @@ -50,7 +50,7 @@

GObjectClass parent_class;

GObjectClass parent_class;

   
-guint +guint gst_rtsp_stream_get_index () @@ -66,7 +66,7 @@
-gchar * +gchar * gst_rtsp_stream_get_control () @@ -82,7 +82,7 @@
-gboolean +gboolean gst_rtsp_stream_has_control () @@ -90,7 +90,7 @@
-guint +guint gst_rtsp_stream_get_mtu () @@ -106,7 +106,7 @@
-gint +gint gst_rtsp_stream_get_dscp_qos () @@ -154,7 +154,7 @@
-gboolean +gboolean gst_rtsp_stream_is_transport_supported () @@ -186,7 +186,7 @@
-gboolean +gboolean gst_rtsp_stream_join_bin () @@ -194,7 +194,7 @@
-gboolean +gboolean gst_rtsp_stream_leave_bin () @@ -218,7 +218,7 @@
-GObject * +GObject * gst_rtsp_stream_get_rtpsession () @@ -234,7 +234,7 @@
-gboolean +gboolean gst_rtsp_stream_get_rtpinfo () @@ -250,7 +250,7 @@
-guint +guint gst_rtsp_stream_get_pt () @@ -274,7 +274,7 @@
-gboolean +gboolean gst_rtsp_stream_add_transport () @@ -282,7 +282,7 @@
-gboolean +gboolean gst_rtsp_stream_remove_transport () @@ -290,7 +290,7 @@
-GSocket * +GSocket * gst_rtsp_stream_get_rtp_socket () @@ -298,7 +298,7 @@
-GSocket * +GSocket * gst_rtsp_stream_get_rtcp_socket () @@ -306,7 +306,7 @@
-gboolean +gboolean gst_rtsp_stream_set_blocked () @@ -314,7 +314,7 @@
-gboolean +gboolean gst_rtsp_stream_is_blocking () @@ -322,7 +322,7 @@
-gboolean +gboolean gst_rtsp_stream_update_crypto () @@ -338,7 +338,7 @@
-GList * +GList * gst_rtsp_stream_transport_filter () @@ -368,7 +368,7 @@

Object Hierarchy

-
    GObject
+
    GObject
     ╰── GstRTSPStream
 
@@ -396,7 +396,7 @@ the destination again.

gst_rtsp_stream_new ()

GstRTSPStream *
-gst_rtsp_stream_new (guint idx,
+gst_rtsp_stream_new (guint idx,
                      GstElement *payloader,
                      GstPad *srcpad);

Create a new media stream with index idx @@ -440,7 +440,7 @@ gst_rtsp_stream_new (

gst_rtsp_stream_get_index ()

-
guint
+
guint
 gst_rtsp_stream_get_index (GstRTSPStream *stream);

Get the stream index.

Return: the stream index.

@@ -491,7 +491,7 @@ gst_rtsp_stream_get_srcpad (

gst_rtsp_stream_get_control ()

-
gchar *
+
gchar *
 gst_rtsp_stream_get_control (GstRTSPStream *stream);

Get the control string to identify this stream.

@@ -511,7 +511,7 @@ gst_rtsp_stream_get_control (

Returns

-

the control string. g_free() after usage.

+

the control string. g_free() after usage.

[transfer full]

@@ -520,7 +520,7 @@ gst_rtsp_stream_get_control (

gst_rtsp_stream_set_control ()

void
 gst_rtsp_stream_set_control (GstRTSPStream *stream,
-                             const gchar *control);
+ const gchar *control);

Set the control string in stream .

@@ -549,9 +549,9 @@ gst_rtsp_stream_set_control (

gst_rtsp_stream_has_control ()

-
gboolean
+
gboolean
 gst_rtsp_stream_has_control (GstRTSPStream *stream,
-                             const gchar *control);
+ const gchar *control);

Check if stream has the control string control .

@@ -579,7 +579,7 @@ gst_rtsp_stream_has_control (

Returns

-

TRUE is stream +

TRUE is stream has control as the control string

@@ -588,7 +588,7 @@ as the control string


gst_rtsp_stream_get_mtu ()

-
guint
+
guint
 gst_rtsp_stream_get_mtu (GstRTSPStream *stream);

Get the configured MTU in the payloader of stream .

@@ -618,7 +618,7 @@ gst_rtsp_stream_get_mtu (

gst_rtsp_stream_set_mtu ()

void
 gst_rtsp_stream_set_mtu (GstRTSPStream *stream,
-                         guint mtu);
+ guint mtu);

Configure the mtu in the payloader of stream to mtu .

@@ -648,7 +648,7 @@ gst_rtsp_stream_set_mtu (

gst_rtsp_stream_get_dscp_qos ()

-
gint
+
gint
 gst_rtsp_stream_get_dscp_qos (GstRTSPStream *stream);

Get the configured DSCP QoS in of the outgoing sockets.

@@ -677,7 +677,7 @@ gst_rtsp_stream_get_dscp_qos (

gst_rtsp_stream_set_dscp_qos ()

void
 gst_rtsp_stream_set_dscp_qos (GstRTSPStream *stream,
-                              gint dscp_qos);
+ gint dscp_qos);

Configure the dscp qos of the outgoing sockets to dscp_qos .

@@ -824,7 +824,7 @@ gst_rtsp_stream_set_protocols (

gst_rtsp_stream_is_transport_supported ()

-
gboolean
+
gboolean
 gst_rtsp_stream_is_transport_supported
                                (GstRTSPStream *stream,
                                 GstRTSPTransport *transport);
@@ -854,7 +854,7 @@ gst_rtsp_stream_is_transport_supported

Returns

-

TRUE if transport +

TRUE if transport can be handled by stream .

@@ -885,7 +885,7 @@ gst_rtsp_stream_get_address_pool (

Returns

the GstRTSPAddressPool of stream -. g_object_unref() after +. g_object_unref() after usage.

[transfer full]

@@ -927,10 +927,10 @@ gst_rtsp_stream_set_address_pool (

gst_rtsp_stream_reserve_address ()

GstRTSPAddress *
 gst_rtsp_stream_reserve_address (GstRTSPStream *stream,
-                                 const gchar *address,
-                                 guint port,
-                                 guint n_ports,
-                                 guint ttl);
+ const gchar *address, + guint port, + guint n_ports, + guint ttl);

Reserve address and port as the address and port of stream @@ -975,7 +975,7 @@ gst_rtsp_stream_reserve_address (

Returns

the GstRTSPAddress of stream -or NULL when +or NULL when the address could be reserved. gst_rtsp_address_free() after usage.

[nullable]

@@ -983,7 +983,7 @@ the address could be reserved.

gst_rtsp_stream_join_bin ()

-
gboolean
+
gboolean
 gst_rtsp_stream_join_bin (GstRTSPStream *stream,
                           GstBin *bin,
                           GstElement *rtpbin,
@@ -1033,21 +1033,21 @@ added to bin
 

Returns

-

TRUE on success.

+

TRUE on success.


gst_rtsp_stream_leave_bin ()

-
gboolean
+
gboolean
 gst_rtsp_stream_leave_bin (GstRTSPStream *stream,
                            GstBin *bin,
                            GstElement *rtpbin);

Remove the elements of stream from bin .

-

Return: TRUE on success.

+

Return: TRUE on success.

Parameters

@@ -1082,7 +1082,7 @@ gst_rtsp_stream_leave_bin (void gst_rtsp_stream_get_server_port (GstRTSPStream *stream, GstRTSPRange *server_port, - GSocketFamily family); + GSocketFamily family);

Fill server_port with the port pair used by the server. This function can only be called when stream @@ -1120,7 +1120,7 @@ only be called when stream

gst_rtsp_stream_get_multicast_address ()

GstRTSPAddress *
 gst_rtsp_stream_get_multicast_address (GstRTSPStream *stream,
-                                       GSocketFamily family);
+ GSocketFamily family);

Get the multicast address of stream for family .

@@ -1140,7 +1140,7 @@ gst_rtsp_stream_get_multicast_address (

family

-
+ @@ -1149,7 +1149,7 @@ gst_rtsp_stream_get_multicast_address (

Returns

the GstRTSPAddress of stream -or NULL when no address could be allocated. gst_rtsp_address_free() +or NULL when no address could be allocated. gst_rtsp_address_free() after usage.

[transfer full][nullable]

@@ -1157,7 +1157,7 @@ after usage.


gst_rtsp_stream_get_rtpsession ()

-
GObject *
+
GObject *
 gst_rtsp_stream_get_rtpsession (GstRTSPStream *stream);

Get the RTP session of this stream.

@@ -1186,7 +1186,7 @@ gst_rtsp_stream_get_rtpsession (

gst_rtsp_stream_get_ssrc ()

void
 gst_rtsp_stream_get_ssrc (GstRTSPStream *stream,
-                          guint *ssrc);
+ guint *ssrc);

Get the SSRC used by the RTP session of this stream. This function can only be called when stream has been joined.

@@ -1216,11 +1216,11 @@ be called when stream

gst_rtsp_stream_get_rtpinfo ()

-
gboolean
+
gboolean
 gst_rtsp_stream_get_rtpinfo (GstRTSPStream *stream,
-                             guint *rtptime,
-                             guint *seq,
-                             guint *clock_rate,
+                             guint *rtptime,
+                             guint *seq,
+                             guint *clock_rate,
                              GstClockTime *running_time);

Retrieve the current rtptime, seq and running-time. This is used to construct a RTPInfo reply header.

@@ -1263,7 +1263,7 @@ construct a RTPInfo reply header.

Returns

-

TRUE when rtptime, seq and running-time could be determined.

+

TRUE when rtptime, seq and running-time could be determined.

@@ -1300,7 +1300,7 @@ after usage.


gst_rtsp_stream_get_pt ()

-
guint
+
guint
 gst_rtsp_stream_get_pt (GstRTSPStream *stream);

Get the stream payload type.

Return: the stream payload type.

@@ -1399,7 +1399,7 @@ message has been received from a client using the TCP transport.


gst_rtsp_stream_add_transport ()

-
gboolean
+
gboolean
 gst_rtsp_stream_add_transport (GstRTSPStream *stream,
                                GstRTSPStreamTransport *trans);

Add the transport in trans @@ -1436,7 +1436,7 @@ then also be send to the values configured in trans<

Returns

-

TRUE if trans +

TRUE if trans was added

@@ -1444,7 +1444,7 @@ was added


gst_rtsp_stream_remove_transport ()

-
gboolean
+
gboolean
 gst_rtsp_stream_remove_transport (GstRTSPStream *stream,
                                   GstRTSPStreamTransport *trans);

Remove the transport in trans @@ -1481,7 +1481,7 @@ not be sent to the values configured in trans

Returns

-

TRUE if trans +

TRUE if trans was removed

@@ -1489,9 +1489,9 @@ was removed


gst_rtsp_stream_get_rtp_socket ()

-
GSocket *
+
GSocket *
 gst_rtsp_stream_get_rtp_socket (GstRTSPStream *stream,
-                                GSocketFamily family);
+ GSocketFamily family);

Get the RTP socket from stream for a family .

@@ -1521,7 +1521,7 @@ gst_rtsp_stream_get_rtp_socket (

Returns

-

the RTP socket or NULL if no +

the RTP socket or NULL if no socket could be allocated for family . Unref after usage.

[transfer full][nullable]

@@ -1530,9 +1530,9 @@ socket could be allocated for family

gst_rtsp_stream_get_rtcp_socket ()

-
GSocket *
+
GSocket *
 gst_rtsp_stream_get_rtcp_socket (GstRTSPStream *stream,
-                                 GSocketFamily family);
+ GSocketFamily family);

Get the RTCP socket from stream for a family .

@@ -1562,7 +1562,7 @@ gst_rtsp_stream_get_rtcp_socket (

Returns

-

the RTCP socket or NULL if no +

the RTCP socket or NULL if no socket could be allocated for family . Unref after usage.

[transfer full][nullable]

@@ -1571,9 +1571,9 @@ socket could be allocated for family

gst_rtsp_stream_set_blocked ()

-
gboolean
+
gboolean
 gst_rtsp_stream_set_blocked (GstRTSPStream *stream,
-                             gboolean blocked);
+ gboolean blocked);

Blocks or unblocks the dataflow on stream .

@@ -1600,14 +1600,14 @@ gst_rtsp_stream_set_blocked (

Returns

-

TRUE on success

+

TRUE on success


gst_rtsp_stream_is_blocking ()

-
gboolean
+
gboolean
 gst_rtsp_stream_is_blocking (GstRTSPStream *stream);

Check if stream is blocking on a GstBuffer.

@@ -1628,7 +1628,7 @@ gst_rtsp_stream_is_blocking (

Returns

-

TRUE if stream +

TRUE if stream is blocking

@@ -1636,9 +1636,9 @@ is blocking


gst_rtsp_stream_update_crypto ()

-
gboolean
+
gboolean
 gst_rtsp_stream_update_crypto (GstRTSPStream *stream,
-                               guint ssrc,
+                               guint ssrc,
                                GstCaps *crypto);

Update the new crypto information for ssrc in stream @@ -1647,7 +1647,7 @@ for ssrc did not exist, it will be added. If information for ssrc existed, it will be replaced. If crypto - is NULL, it will + is NULL, it will be removed from stream .

@@ -1679,7 +1679,7 @@ be removed from stream

Returns

-

TRUE if crypto +

TRUE if crypto could be updated

@@ -1690,7 +1690,7 @@ could be updated

GstRTSPFilterResult
 (*GstRTSPStreamTransportFilterFunc) (GstRTSPStream *stream,
                                      GstRTSPStreamTransport *trans,
-                                     gpointer user_data);
+ gpointer user_data);

This function will be called by the gst_rtsp_stream_transport_filter(). An implementation should return a value of GstRTSPFilterResult.

When this function returns GST_RTSP_FILTER_REMOVE, trans @@ -1702,7 +1702,7 @@ from stream stream .

A value of GST_RTSP_FILTER_REF will add trans - to the result GList of + to the result GList of gst_rtsp_stream_transport_filter().

Parameters

@@ -1741,10 +1741,10 @@ from stream

gst_rtsp_stream_transport_filter ()

-
GList *
+
GList *
 gst_rtsp_stream_transport_filter (GstRTSPStream *stream,
                                   GstRTSPStreamTransportFilterFunc func,
-                                  gpointer user_data);
+ gpointer user_data);

Call func for each transport managed by stream . The result value of func @@ -1765,10 +1765,10 @@ locked so no further actions on stream

If func returns GST_RTSP_FILTER_REF, the transport will remain in stream but -will also be added with an additional ref to the result GList of this +will also be added with an additional ref to the result GList of this function..

When func - is NULL, GST_RTSP_FILTER_REF will be assumed for each transport.

+ is NULL, GST_RTSP_FILTER_REF will be assumed for each transport.

Parameters

the GSocketFamily

the GSocketFamily

 
@@ -1799,10 +1799,10 @@ function..

Returns

-

a GList with all +

a GList with all transports for which func returned GST_RTSP_FILTER_REF. After usage, each -element in the GList should be unreffed before the list is freed.

+element in the GList should be unreffed before the list is freed.

[element-type GstRTSPStreamTransport][transfer full]

diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPAddressPool.html b/docs/libs/html/gst-rtsp-server-GstRTSPAddressPool.html index 2ba729e..aec2ed1 100644 --- a/docs/libs/html/gst-rtsp-server-GstRTSPAddressPool.html +++ b/docs/libs/html/gst-rtsp-server-GstRTSPAddressPool.html @@ -81,7 +81,7 @@
- + @@ -564,7 +564,7 @@ IPv6 addresses

- + @@ -653,7 +653,7 @@ IPv6 addresses

- + diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPContext.html b/docs/libs/html/gst-rtsp-server-GstRTSPContext.html index 05b6d41..00c9702 100644 --- a/docs/libs/html/gst-rtsp-server-GstRTSPContext.html +++ b/docs/libs/html/gst-rtsp-server-GstRTSPContext.html @@ -212,7 +212,7 @@ is on the top of the stack).

- + @@ -222,27 +222,27 @@ is on the top of the stack).

- + - + - + - + - + diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPMediaFactoryURI.html b/docs/libs/html/gst-rtsp-server-GstRTSPMediaFactoryURI.html index cf5778e..ba6ee82 100644 --- a/docs/libs/html/gst-rtsp-server-GstRTSPMediaFactoryURI.html +++ b/docs/libs/html/gst-rtsp-server-GstRTSPMediaFactoryURI.html @@ -57,7 +57,7 @@ - + diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPThreadPool.html b/docs/libs/html/gst-rtsp-server-GstRTSPThreadPool.html index 4ce53af..f793fe9 100644 --- a/docs/libs/html/gst-rtsp-server-GstRTSPThreadPool.html +++ b/docs/libs/html/gst-rtsp-server-GstRTSPThreadPool.html @@ -65,7 +65,7 @@ - - + + - - + + @@ -544,13 +544,13 @@ structures.

- + - - + + diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPToken.html b/docs/libs/html/gst-rtsp-server-GstRTSPToken.html index 8279c79..9bd5be3 100644 --- a/docs/libs/html/gst-rtsp-server-GstRTSPToken.html +++ b/docs/libs/html/gst-rtsp-server-GstRTSPToken.html @@ -95,7 +95,7 @@ -
-gboolean +gboolean gst_rtsp_address_pool_add_range () @@ -89,7 +89,7 @@
-gboolean +gboolean gst_rtsp_address_pool_has_unicast_addresses () @@ -282,10 +282,10 @@ gst_rtsp_address_pool_dump (

gst_rtsp_address_pool_add_range ()

-
gboolean
+
gboolean
 gst_rtsp_address_pool_add_range (GstRTSPAddressPool *pool,
-                                 const gchar *min_address,
-                                 const gchar *max_address,
+                                 const gchar *min_address,
+                                 const gchar *max_address,
                                  guint16 min_port,
                                  guint16 max_port,
                                  guint8 ttl);
@@ -354,14 +354,14 @@ to all available IPv4 or IPv6 addresses.

Returns

-

TRUE if the addresses could be added.

+

TRUE if the addresses could be added.


gst_rtsp_address_pool_has_unicast_addresses ()

-
gboolean
+
gboolean
 gst_rtsp_address_pool_has_unicast_addresses
                                (GstRTSPAddressPool *pool);

Used to know if the pool includes any unicast addresses.

@@ -382,7 +382,7 @@ gst_rtsp_address_pool_has_unicast_addresses

Returns

-

TRUE if the pool includes any unicast addresses, FALSE otherwise

+

TRUE if the pool includes any unicast addresses, FALSE otherwise

@@ -392,7 +392,7 @@ gst_rtsp_address_pool_has_unicast_addresses
GstRTSPAddress *
 gst_rtsp_address_pool_acquire_address (GstRTSPAddressPool *pool,
                                        GstRTSPAddressFlags flags,
-                                       gint n_ports);
+ gint n_ports);

Take an address and ports from pool . flags can be used to control the @@ -430,7 +430,7 @@ one can be found in port

Returns

a GstRTSPAddress that should be freed with -gst_rtsp_address_free after use or NULL when no address could be +gst_rtsp_address_free after use or NULL when no address could be acquired.

[nullable]

@@ -440,10 +440,10 @@ acquired.

gst_rtsp_address_pool_reserve_address ()

GstRTSPAddressPoolResult
 gst_rtsp_address_pool_reserve_address (GstRTSPAddressPool *pool,
-                                       const gchar *ip_address,
-                                       guint port,
-                                       guint n_ports,
-                                       guint ttl,
+                                       const gchar *ip_address,
+                                       guint port,
+                                       guint n_ports,
+                                       guint ttl,
                                        GstRTSPAddress **address);

Take a specific address and ports from pool . n_ports @@ -554,7 +554,7 @@ IPv6 addresses

 

gchar *address;

gchar *address;

the address

 
 

gint n_ports;

gint n_ports;

number of ports

 

GObject parent;

GObject parent;

the parent GObject

 

GstRTSPAuth *auth;

the current auth object or NULL

the current auth object or NULL

 

GstRTSPSession *session;

the session, can be NULL

the session, can be NULL

 

GstRTSPSessionMedia *sessmedia;

the session media for the url can be NULL

the session media for the url can be NULL

 

GstRTSPMediaFactory *factory;

the media factory for the url, can be NULL

the media factory for the url, can be NULL

 

GstRTSPMedia *media;

the media for the url can be NULL

the media for the url can be NULL

 

GstRTSPStream *stream;

the stream for the url can be NULL

the stream for the url can be NULL

 
-gchar * +gchar * gst_rtsp_media_factory_uri_get_uri () @@ -111,7 +111,7 @@ gst_rtsp_media_factory_uri_new (v

gst_rtsp_media_factory_uri_set_uri ()

void
 gst_rtsp_media_factory_uri_set_uri (GstRTSPMediaFactoryURI *factory,
-                                    const gchar *uri);
+ const gchar *uri);

Set the URI of the resource that will be streamed by this factory.

Parameters

@@ -139,7 +139,7 @@ gst_rtsp_media_factory_uri_set_uri (

gst_rtsp_media_factory_uri_get_uri ()

-
gchar *
+
gchar *
 gst_rtsp_media_factory_uri_get_uri (GstRTSPMediaFactoryURI *factory);

Get the URI that will provide media for this factory.

@@ -159,7 +159,7 @@ gst_rtsp_media_factory_uri_get_uri (

Returns

-

the configured URI. g_free() after usage.

+

the configured URI. g_free() after usage.

[transfer full]

diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPPermissions.html b/docs/libs/html/gst-rtsp-server-GstRTSPPermissions.html index 37fb587..d6cfc0f 100644 --- a/docs/libs/html/gst-rtsp-server-GstRTSPPermissions.html +++ b/docs/libs/html/gst-rtsp-server-GstRTSPPermissions.html @@ -96,7 +96,7 @@
-gboolean +gboolean gst_rtsp_permissions_is_allowed () @@ -129,7 +129,7 @@ object that performs the checks on the permissions and the current GstRTSPToken.

As a convenience function, gst_rtsp_permissions_is_allowed() can be used to check if the permissions contains a role that contains the boolean value -TRUE for the the given key.

+TRUE for the the given key.

Last reviewed on 2013-07-15 (1.0.0)

@@ -200,8 +200,8 @@ gst_rtsp_permissions_unref (

gst_rtsp_permissions_add_role ()

void
 gst_rtsp_permissions_add_role (GstRTSPPermissions *permissions,
-                               const gchar *role,
-                               const gchar *fieldname,
+                               const gchar *role,
+                               const gchar *fieldname,
                                ...);

Add a new role to permissions @@ -245,8 +245,8 @@ are the same layout as

gst_rtsp_permissions_add_role_valist ()

void
 gst_rtsp_permissions_add_role_valist (GstRTSPPermissions *permissions,
-                                      const gchar *role,
-                                      const gchar *fieldname,
+                                      const gchar *role,
+                                      const gchar *fieldname,
                                       va_list var_args);

Add a new role to permissions @@ -290,7 +290,7 @@ are set according to the varargs in a manner similar to

gst_rtsp_permissions_remove_role ()

void
 gst_rtsp_permissions_remove_role (GstRTSPPermissions *permissions,
-                                  const gchar *role);
+ const gchar *role);

Remove all permissions for role in permissions .

@@ -322,7 +322,7 @@ gst_rtsp_permissions_remove_role (

gst_rtsp_permissions_get_role ()

const GstStructure *
 gst_rtsp_permissions_get_role (GstRTSPPermissions *permissions,
-                               const gchar *role);
+ const gchar *role);

Get all permissions for role in permissions .

@@ -360,10 +360,10 @@ is valid.


gst_rtsp_permissions_is_allowed ()

-
gboolean
+
gboolean
 gst_rtsp_permissions_is_allowed (GstRTSPPermissions *permissions,
-                                 const gchar *role,
-                                 const gchar *permission);
+ const gchar *role, + const gchar *permission);

Check if role in permissions is given permission for permission @@ -397,7 +397,7 @@ gst_rtsp_permissions_is_allowed (

Returns

-

TRUE if role +

TRUE if role is allowed permission .

diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPSdp.html b/docs/libs/html/gst-rtsp-server-GstRTSPSdp.html index 00d6db7..88f0d70 100644 --- a/docs/libs/html/gst-rtsp-server-GstRTSPSdp.html +++ b/docs/libs/html/gst-rtsp-server-GstRTSPSdp.html @@ -40,7 +40,7 @@
-gboolean +gboolean gst_rtsp_sdp_from_media () @@ -69,7 +69,7 @@

Functions

gst_rtsp_sdp_from_media ()

-
gboolean
+
gboolean
 gst_rtsp_sdp_from_media (GstSDPMessage *sdp,
                          GstSDPInfo *info,
                          GstRTSPMedia *media);
diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPSessionMedia.html b/docs/libs/html/gst-rtsp-server-GstRTSPSessionMedia.html index da892d7..f36b686 100644 --- a/docs/libs/html/gst-rtsp-server-GstRTSPSessionMedia.html +++ b/docs/libs/html/gst-rtsp-server-GstRTSPSessionMedia.html @@ -49,7 +49,7 @@
-gboolean +gboolean gst_rtsp_session_media_matches () @@ -73,7 +73,7 @@
-gchar * +gchar * gst_rtsp_session_media_get_rtpinfo () @@ -81,7 +81,7 @@
-gboolean +gboolean gst_rtsp_session_media_set_state () @@ -121,7 +121,7 @@
-gboolean +gboolean gst_rtsp_session_media_alloc_channels () @@ -164,7 +164,7 @@ transports.

gst_rtsp_session_media_new ()

GstRTSPSessionMedia *
-gst_rtsp_session_media_new (const gchar *path,
+gst_rtsp_session_media_new (const gchar *path,
                             GstRTSPMedia *media);

Create a new GstRTSPSessionMedia that manages the streams in media @@ -204,10 +204,10 @@ in media


gst_rtsp_session_media_matches ()

-
gboolean
+
gboolean
 gst_rtsp_session_media_matches (GstRTSPSessionMedia *media,
-                                const gchar *path,
-                                gint *matched);
+ const gchar *path, + gint *matched);

Check if the path of media matches path . It path @@ -244,7 +244,7 @@ matched characters is returned in matched

Returns

-

TRUE when path +

TRUE when path matches the path of media .

@@ -312,7 +312,7 @@ gst_rtsp_session_media_get_base_time (

gst_rtsp_session_media_get_rtpinfo ()

-
gchar *
+
gchar *
 gst_rtsp_session_media_get_rtpinfo (GstRTSPSessionMedia *media);

Retrieve the RTP-Info header string for all streams in media @@ -335,14 +335,14 @@ with configured transports.

Returns

The RTP-Info as a string or -NULL when no RTP-Info could be generated, g_free() after usage.

+NULL when no RTP-Info could be generated, g_free() after usage.

[transfer full][nullable]


gst_rtsp_session_media_set_state ()

-
gboolean
+
gboolean
 gst_rtsp_session_media_set_state (GstRTSPSessionMedia *media,
                                   GstState state);

Tell the media object media @@ -372,7 +372,7 @@ gst_rtsp_session_media_set_state (

Returns

-

TRUE on success.

+

TRUE on success.

@@ -442,7 +442,7 @@ gst_rtsp_session_media_set_rtsp_state (

gst_rtsp_session_media_get_transport ()

GstRTSPStreamTransport *
 gst_rtsp_session_media_get_transport (GstRTSPSessionMedia *media,
-                                      guint idx);
+ guint idx);

Get a previously created GstRTSPStreamTransport for the stream at idx .

@@ -523,7 +523,7 @@ gst_rtsp_session_media_set_transport (

gst_rtsp_session_media_alloc_channels ()

-
gboolean
+
gboolean
 gst_rtsp_session_media_alloc_channels (GstRTSPSessionMedia *media,
                                        GstRTSPRange *range);

Fill range @@ -553,7 +553,7 @@ interleaved transport.

Returns

-

TRUE on success.

+

TRUE on success.

diff --git a/docs/libs/html/gst-rtsp-server-GstRTSPStreamTransport.html b/docs/libs/html/gst-rtsp-server-GstRTSPStreamTransport.html index e065a93..6ae49fe 100644 --- a/docs/libs/html/gst-rtsp-server-GstRTSPStreamTransport.html +++ b/docs/libs/html/gst-rtsp-server-GstRTSPStreamTransport.html @@ -87,7 +87,7 @@
-gchar * +gchar * gst_rtsp_stream_transport_get_rtpinfo () @@ -95,7 +95,7 @@
-gboolean +gboolean (*GstRTSPSendFunc) () @@ -135,7 +135,7 @@
-gboolean +gboolean gst_rtsp_stream_transport_set_active () @@ -151,7 +151,7 @@
-gboolean +gboolean gst_rtsp_stream_transport_is_timed_out () @@ -159,7 +159,7 @@
-gboolean +gboolean gst_rtsp_stream_transport_send_rtcp () @@ -167,7 +167,7 @@
-gboolean +gboolean gst_rtsp_stream_transport_send_rtp () @@ -408,7 +408,7 @@ gst_rtsp_stream_transport_set_url (

gst_rtsp_stream_transport_get_rtpinfo ()

-
gchar *
+
gchar *
 gst_rtsp_stream_transport_get_rtpinfo (GstRTSPStreamTransport *trans,
                                        GstClockTime start_time);

Get the RTP-Info string for trans @@ -440,18 +440,18 @@ gst_rtsp_stream_transport_get_rtpinfo (

Returns

the RTPInfo string for trans and start_time -or NULL when the RTP-Info could not be -determined. g_free() after usage.

+or NULL when the RTP-Info could not be +determined. g_free() after usage.

[transfer full][nullable]


GstRTSPSendFunc ()

-
gboolean
+
gboolean
 (*GstRTSPSendFunc) (GstBuffer *buffer,
                     guint8 channel,
-                    gpointer user_data);
+ gpointer user_data);

Function registered with gst_rtsp_stream_transport_set_callbacks() and called when buffer must be sent on channel @@ -485,7 +485,7 @@ called when buffer

Returns

-

TRUE on success

+

TRUE on success

@@ -497,8 +497,8 @@ gst_rtsp_stream_transport_set_callbacks (GstRTSPStreamTransport *trans, GstRTSPSendFunc send_rtp, GstRTSPSendFunc send_rtcp, - gpointer user_data, - GDestroyNotify notify); + gpointer user_data, + GDestroyNotify notify);

Install callbacks that will be called when data for a stream should be sent to a client. This is usually used when sending RTP/RTCP over TCP.

@@ -543,7 +543,7 @@ to a client. This is usually used when sending RTP/RTCP over TCP.

GstRTSPKeepAliveFunc ()

void
-(*GstRTSPKeepAliveFunc) (gpointer user_data);
+(*GstRTSPKeepAliveFunc) (gpointer user_data);

Function registered with gst_rtsp_stream_transport_set_keepalive() and called when the stream is active.

@@ -569,8 +569,8 @@ when the stream is active.

gst_rtsp_stream_transport_set_keepalive (GstRTSPStreamTransport *trans, GstRTSPKeepAliveFunc keep_alive, - gpointer user_data, - GDestroyNotify notify); + gpointer user_data, + GDestroyNotify notify);

Install callbacks that will be called when RTCP packets are received from the receiver of trans .

@@ -633,9 +633,9 @@ gst_rtsp_stream_transport_keep_alive (

gst_rtsp_stream_transport_set_active ()

-
gboolean
+
gboolean
 gst_rtsp_stream_transport_set_active (GstRTSPStreamTransport *trans,
-                                      gboolean active);
+ gboolean active);

Activate or deactivate datatransfer configured in trans .

@@ -663,7 +663,7 @@ gst_rtsp_stream_transport_set_active (

Returns

-

TRUE when the state was changed.

+

TRUE when the state was changed.

@@ -673,7 +673,7 @@ gst_rtsp_stream_transport_set_active (void gst_rtsp_stream_transport_set_timed_out (GstRTSPStreamTransport *trans, - gboolean timedout); + gboolean timedout);

Set the timed out state of trans to timedout

@@ -703,7 +703,7 @@ gst_rtsp_stream_transport_set_timed_out

gst_rtsp_stream_transport_is_timed_out ()

-
gboolean
+
gboolean
 gst_rtsp_stream_transport_is_timed_out
                                (GstRTSPStreamTransport *trans);

Check if trans @@ -725,7 +725,7 @@ gst_rtsp_stream_transport_is_timed_out

Returns

-

TRUE if trans +

TRUE if trans timed out.

@@ -733,7 +733,7 @@ timed out.


gst_rtsp_stream_transport_send_rtcp ()

-
gboolean
+
gboolean
 gst_rtsp_stream_transport_send_rtcp (GstRTSPStreamTransport *trans,
                                      GstBuffer *buffer);

Send buffer @@ -763,14 +763,14 @@ gst_rtsp_stream_transport_send_rtcp (

Returns

-

TRUE on success

+

TRUE on success


gst_rtsp_stream_transport_send_rtp ()

-
gboolean
+
gboolean
 gst_rtsp_stream_transport_send_rtp (GstRTSPStreamTransport *trans,
                                     GstBuffer *buffer);

Send buffer @@ -800,7 +800,7 @@ gst_rtsp_stream_transport_send_rtp (

Returns

-

TRUE on success

+

TRUE on success

@@ -823,7 +823,7 @@ gst_rtsp_stream_transport_send_rtp (

GObject parent;

GObject parent;

parent instance

 
-gboolean +gboolean gst_rtsp_thread_reuse () @@ -89,7 +89,7 @@
-gint +gint gst_rtsp_thread_pool_get_max_threads () @@ -251,7 +251,7 @@ gst_rtsp_thread_unref (

gst_rtsp_thread_reuse ()

-
gboolean
+
gboolean
 gst_rtsp_thread_reuse (GstRTSPThread *thread);

Reuse the mainloop of thread

@@ -272,7 +272,7 @@ gst_rtsp_thread_reuse (

Returns

-

TRUE if the mainloop could be reused

+

TRUE if the mainloop could be reused

@@ -316,7 +316,7 @@ gst_rtsp_thread_pool_new (void

gst_rtsp_thread_pool_get_max_threads ()

-
gint
+
gint
 gst_rtsp_thread_pool_get_max_threads (GstRTSPThreadPool *pool);

Get the maximum number of threads used for client connections. See gst_rtsp_thread_pool_set_max_threads().

@@ -346,7 +346,7 @@ See

gst_rtsp_thread_pool_set_max_threads ()

void
 gst_rtsp_thread_pool_set_max_threads (GstRTSPThreadPool *pool,
-                                      gint max_threads);
+ gint max_threads);

Set the maximum threads used by the pool to handle client requests. A value of 0 will use the pool mainloop, a value of -1 will use an unlimited number of threads.

@@ -490,13 +490,13 @@ structures.

 

GMainContext *context;

a GMainContext

GMainContext *context;

a GMainContext

 

GMainLoop *loop;

a GMainLoop

GMainLoop *loop;

a GMainLoop

 

GObjectClass parent_class;

GObjectClass parent_class;

   

GThreadPool *pool;

a GThreadPool used internally

GThreadPool *pool;

a GThreadPool used internally

 
const gchar * +const gchar * gst_rtsp_token_get_string () @@ -103,7 +103,7 @@
-gboolean +gboolean gst_rtsp_token_is_allowed () @@ -155,7 +155,7 @@ gst_rtsp_token_new_empty (void

gst_rtsp_token_new ()

GstRTSPToken *
-gst_rtsp_token_new (const gchar *firstfield,
+gst_rtsp_token_new (const gchar *firstfield,
                     ...);

Create a new Authorization token with the given fieldnames and values. Arguments are given similar to gst_structure_new().

@@ -191,7 +191,7 @@ Arguments are given similar to

gst_rtsp_token_new_valist ()

GstRTSPToken *
-gst_rtsp_token_new_valist (const gchar *firstfield,
+gst_rtsp_token_new_valist (const gchar *firstfield,
                            va_list var_args);

Create a new Authorization token with the given fieldnames and values. Arguments are given similar to gst_structure_new_valist().

@@ -330,7 +330,7 @@ gst_rtsp_token_writable_structure (token -is writable and will never return NULL.

+is writable and will never return NULL.

MT safe.

[transfer none]

@@ -338,9 +338,9 @@ is writable and will never return

gst_rtsp_token_get_string ()

-
const gchar *
+
const gchar *
 gst_rtsp_token_get_string (GstRTSPToken *token,
-                           const gchar *field);
+ const gchar *field);

Get the string value of field in token .

@@ -371,7 +371,7 @@ gst_rtsp_token_get_string (field in token -or NULL when field +or NULL when field is not defined in token . The string becomes invalid when you free token @@ -382,12 +382,12 @@ becomes invalid when you free token

gst_rtsp_token_is_allowed ()

-
gboolean
+
gboolean
 gst_rtsp_token_is_allowed (GstRTSPToken *token,
-                           const gchar *field);
+ const gchar *field);

Check if token has a boolean field - and if it is set to TRUE.

+ and if it is set to TRUE.

Parameters

@@ -412,9 +412,9 @@ gst_rtsp_token_is_allowed (

Returns

-

TRUE if token +

TRUE if token has a boolean field named field -set to TRUE.

+set to TRUE.

diff --git a/docs/libs/html/index.html b/docs/libs/html/index.html index ad0e2e2..d6b8af9 100644 --- a/docs/libs/html/index.html +++ b/docs/libs/html/index.html @@ -15,7 +15,7 @@

- for GStreamer RTSP Server 1.4.1 + for GStreamer RTSP Server 1.4.5


diff --git a/docs/libs/html/rtsp-server-hierarchy.html b/docs/libs/html/rtsp-server-hierarchy.html index f4d68b7..4d752f2 100644 --- a/docs/libs/html/rtsp-server-hierarchy.html +++ b/docs/libs/html/rtsp-server-hierarchy.html @@ -23,7 +23,7 @@

Object Hierarchy

-    GObject
+    GObject
     ├── GstRTSPAuth
     ├── GstRTSPMountPoints
     ├── GstRTSPMediaFactory
diff --git a/gst-rtsp-server.doap b/gst-rtsp-server.doap
index a549266..8dfa661 100644
--- a/gst-rtsp-server.doap
+++ b/gst-rtsp-server.doap
@@ -32,6 +32,46 @@ RTSP server library based on GStreamer
 
  
   
+   1.4.5
+   1.4
+   
+   2014-12-18
+   
+  
+ 
+
+ 
+  
+   1.4.4
+   1.4
+   
+   2014-11-06
+   
+  
+ 
+
+ 
+  
+   1.4.3
+   1.4
+   
+   2014-09-24
+   
+  
+ 
+
+ 
+  
+   1.4.2
+   1.4
+   
+   2014-09-19
+   
+  
+ 
+
+ 
+  
    1.4.1
    1.4
    
diff --git a/gst/rtsp-server/from_upstream.diff b/gst/rtsp-server/from_upstream.diff
deleted file mode 100644
index 99065f5..0000000
--- a/gst/rtsp-server/from_upstream.diff
+++ /dev/null
@@ -1,255 +0,0 @@
-diff -urN /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/Makefile.am ./Makefile.am
---- /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/Makefile.am	2014-01-13 01:50:54.000000000 +0900
-+++ ./Makefile.am	2015-01-15 16:49:47.091243189 +0900
-@@ -7,6 +7,7 @@
- 		rtsp-thread-pool.h \
- 		rtsp-media.h \
- 		rtsp-media-factory.h \
-+		rtsp-media-factory-wfd.h \
- 		rtsp-media-factory-uri.h \
- 		rtsp-mount-points.h \
- 		rtsp-permissions.h \
-@@ -16,8 +17,11 @@
- 		rtsp-session-media.h \
- 		rtsp-session-pool.h \
- 		rtsp-token.h \
-+		rtsp-client-wfd.h \
- 		rtsp-client.h \
--		rtsp-server.h
-+		rtsp-server-wfd.h \
-+		rtsp-server.h \
-+		gstwfdmessage.h
- 
- c_sources = \
- 	rtsp-auth.c \
-@@ -28,6 +32,7 @@
- 	rtsp-thread-pool.c \
- 	rtsp-media.c \
- 	rtsp-media-factory.c \
-+	rtsp-media-factory-wfd.c \
- 	rtsp-media-factory-uri.c \
- 	rtsp-mount-points.c \
- 	rtsp-permissions.c \
-@@ -37,7 +42,10 @@
- 	rtsp-session-media.c \
- 	rtsp-session-pool.c \
- 	rtsp-token.c \
-+	gstwfdmessage.c \
-+	rtsp-client-wfd.c \
- 	rtsp-client.c \
-+	rtsp-server-wfd.c \
- 	rtsp-server.c
- 
- noinst_HEADERS = 
-diff -urN /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-client.c ./rtsp-client.c
---- /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-client.c	2014-02-10 21:43:30.000000000 +0900
-+++ ./rtsp-client.c	2015-02-23 16:33:37.059801061 +0900
-@@ -137,6 +137,12 @@
-     GstRTSPContext * ctx);
- static gchar *default_make_path_from_uri (GstRTSPClient * client,
-     const GstRTSPUrl * uri);
-+static gboolean default_handle_options_request (GstRTSPClient * client,
-+    GstRTSPContext * ctx);
-+static gboolean default_handle_set_param_request (GstRTSPClient * client,
-+    GstRTSPContext * ctx);
-+static gboolean default_handle_get_param_request (GstRTSPClient * client,
-+    GstRTSPContext * ctx);
- 
- G_DEFINE_TYPE (GstRTSPClient, gst_rtsp_client, G_TYPE_OBJECT);
- 
-@@ -159,6 +165,9 @@
-   klass->params_set = default_params_set;
-   klass->params_get = default_params_get;
-   klass->make_path_from_uri = default_make_path_from_uri;
-+  klass->handle_options_request = default_handle_options_request;
-+  klass->handle_set_param_request = default_handle_set_param_request;
-+  klass->handle_get_param_request = default_handle_get_param_request;
- 
-   g_object_class_install_property (gobject_class, PROP_SESSION_POOL,
-       g_param_spec_object ("session-pool", "Session Pool",
-@@ -869,7 +878,7 @@
- }
- 
- static gboolean
--handle_get_param_request (GstRTSPClient * client, GstRTSPContext * ctx)
-+default_handle_get_param_request (GstRTSPClient * client, GstRTSPContext * ctx)
- {
-   GstRTSPResult res;
-   guint8 *data;
-@@ -906,7 +915,7 @@
- }
- 
- static gboolean
--handle_set_param_request (GstRTSPClient * client, GstRTSPContext * ctx)
-+default_handle_set_param_request (GstRTSPClient * client, GstRTSPContext * ctx)
- {
-   GstRTSPResult res;
-   guint8 *data;
-@@ -1462,6 +1471,8 @@
-   if (media == NULL)
-     goto media_not_found_no_reply;
- 
-+  /* FIXME-WFD : wfd url problem */
-+#if 0
-   if (path[matched] == '\0')
-     goto control_not_found;
- 
-@@ -1469,6 +1480,9 @@
-   path[matched] = '\0';
-   /* control is remainder */
-   control = &path[matched + 1];
-+#else
-+  control = g_strdup ("stream=0");
-+#endif
- 
-   /* find the stream now using the control part */
-   stream = gst_rtsp_media_find_stream (media, control);
-@@ -1534,6 +1548,10 @@
-   /* create and serialize the server transport */
-   st = make_server_transport (client, ctx, ct);
-   trans_str = gst_rtsp_transport_as_text (st);
-+
-+  /* FIXME-WFD : Temporarily force to set profile string */
-+  trans_str = g_strjoinv ("RTP/AVP/UDP", g_strsplit (trans_str, "RTP/AVP", -1));
-+
-   gst_rtsp_transport_free (st);
- 
-   /* construct the response now */
-@@ -1820,7 +1838,7 @@
- }
- 
- static gboolean
--handle_options_request (GstRTSPClient * client, GstRTSPContext * ctx)
-+default_handle_options_request (GstRTSPClient * client, GstRTSPContext * ctx)
- {
-   GstRTSPMethod options;
-   gchar *str;
-@@ -1906,6 +1924,9 @@
-   GstRTSPContext sctx = { NULL }, *ctx;
-   GstRTSPMessage response = { 0 };
-   gchar *sessid;
-+  GstRTSPClientClass *klass;
-+
-+  klass = GST_RTSP_CLIENT_GET_CLASS (client);
- 
-   if (!(ctx = gst_rtsp_context_get_current ())) {
-     ctx = &sctx;
-@@ -1995,7 +2016,7 @@
-   /* now see what is asked and dispatch to a dedicated handler */
-   switch (method) {
-     case GST_RTSP_OPTIONS:
--      handle_options_request (client, ctx);
-+      klass->handle_options_request (client, ctx);
-       break;
-     case GST_RTSP_DESCRIBE:
-       handle_describe_request (client, ctx);
-@@ -2013,10 +2034,10 @@
-       handle_teardown_request (client, ctx);
-       break;
-     case GST_RTSP_SET_PARAMETER:
--      handle_set_param_request (client, ctx);
-+      klass->handle_set_param_request (client, ctx);
-       break;
-     case GST_RTSP_GET_PARAMETER:
--      handle_get_param_request (client, ctx);
-+      klass->handle_get_param_request (client, ctx);
-       break;
-     case GST_RTSP_ANNOUNCE:
-     case GST_RTSP_RECORD:
-diff -urN /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-client.h ./rtsp-client.h
---- /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-client.h	2014-01-13 01:50:54.000000000 +0900
-+++ ./rtsp-client.h	2015-02-17 15:57:28.047757756 +0900
-@@ -102,6 +102,10 @@
-   GstRTSPResult   (*params_get) (GstRTSPClient *client, GstRTSPContext *ctx);
-   gchar *         (*make_path_from_uri) (GstRTSPClient *client, const GstRTSPUrl *uri);
- 
-+  gboolean        (*handle_options_request) (GstRTSPClient * client, GstRTSPContext * ctx);
-+  gboolean        (*handle_set_param_request) (GstRTSPClient * client, GstRTSPContext * ctx);
-+  gboolean        (*handle_get_param_request) (GstRTSPClient * client, GstRTSPContext * ctx);
-+
-   /* signals */
-   void     (*closed)                  (GstRTSPClient *client);
-   void     (*new_session)             (GstRTSPClient *client, GstRTSPSession *session);
-@@ -177,7 +181,7 @@
-                                                                 GstRTSPSession *sess,
-                                                                 gpointer user_data);
- 
--GList *                gst_rtsp_client_session_filter    (GstRTSPClient *client,
-+GList *               gst_rtsp_client_session_filter    (GstRTSPClient *client,
-                                                           GstRTSPClientSessionFilterFunc func,
-                                                           gpointer user_data);
- 
-diff -urN /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-media.c ./rtsp-media.c
---- /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-media.c	2014-02-22 00:11:11.000000000 +0900
-+++ ./rtsp-media.c	2015-02-17 15:57:25.483757666 +0900
-@@ -241,10 +241,12 @@
-           "If this media pipeline can be reused after an unprepare",
-           DEFAULT_REUSABLE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
- 
-+#ifdef GST_TYPE_RTSP_PROFILE
-   g_object_class_install_property (gobject_class, PROP_PROFILES,
-       g_param_spec_flags ("profiles", "Profiles",
-           "Allowed transfer profiles", GST_TYPE_RTSP_PROFILE,
-           DEFAULT_PROFILES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-+#endif
- 
-   g_object_class_install_property (gobject_class, PROP_PROTOCOLS,
-       g_param_spec_flags ("protocols", "Protocols",
-diff -urN /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-stream.c ./rtsp-stream.c
---- /home/zzoon.ko/opensrc/tarball/gst-rtsp-server-1.2.3/gst/rtsp-server/rtsp-stream.c	2014-02-22 00:11:11.000000000 +0900
-+++ ./rtsp-stream.c	2015-02-17 15:57:25.527757667 +0900
-@@ -173,10 +173,12 @@
-           "The control string for this stream", DEFAULT_CONTROL,
-           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
- 
-+#ifdef GST_TYPE_RTSP_PROFILE
-   g_object_class_install_property (gobject_class, PROP_PROFILES,
-       g_param_spec_flags ("profiles", "Profiles",
-           "Allowed transfer profiles", GST_TYPE_RTSP_PROFILE,
-           DEFAULT_PROFILES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-+#endif
- 
-   g_object_class_install_property (gobject_class, PROP_PROTOCOLS,
-       g_param_spec_flags ("protocols", "Protocols",
-@@ -1001,6 +1003,9 @@
-       inetaddr = g_inet_address_new_any (family);
-   }
- 
-+  /* FIXME-WFD : Force to set 19000 as port number */
-+  tmp_rtp = 19000;
-+
-   rtp_sockaddr = g_inet_socket_address_new (inetaddr, tmp_rtp);
-   if (!g_socket_bind (rtp_socket, rtp_sockaddr, FALSE, NULL)) {
-     g_object_unref (rtp_sockaddr);
-@@ -1171,9 +1176,14 @@
-       G_SOCKET_FAMILY_IPV4, priv->udpsrc_v4, priv->udpsink,
-       &priv->server_port_v4, &priv->server_addr_v4);
- 
-+  /* FIXME-WFD : force to disable ipv6 mode in WFD mode */
-+#if 0
-   priv->have_ipv6 = alloc_ports_one_family (priv->pool, priv->buffer_size,
-       G_SOCKET_FAMILY_IPV6, priv->udpsrc_v6, priv->udpsink,
-       &priv->server_port_v6, &priv->server_addr_v6);
-+#else
-+  priv->have_ipv6 = FALSE;
-+#endif
- 
-   return priv->have_ipv4 || priv->have_ipv6;
- }
-@@ -1552,6 +1562,8 @@
- 
-   /* get the session */
-   g_signal_emit_by_name (rtpbin, "get-internal-session", idx, &priv->session);
-+  GST_DEBUG("zzoon unref internal session");
-+  g_object_unref(priv->session);
- 
-   g_signal_connect (priv->session, "on-new-ssrc", (GCallback) on_new_ssrc,
-       stream);
-@@ -1841,6 +1853,7 @@
-   gst_object_unref (priv->send_src[1]);
-   priv->send_src[1] = NULL;
- 
-+  GST_DEBUG("Unref rtp session");
-   g_object_unref (priv->session);
-   priv->session = NULL;
-   if (priv->caps)
diff --git a/gst/rtsp-server/rtsp-client-wfd.c b/gst/rtsp-server/rtsp-client-wfd.c
index 27607ef..267fcfa 100644
--- a/gst/rtsp-server/rtsp-client-wfd.c
+++ b/gst/rtsp-server/rtsp-client-wfd.c
@@ -46,7 +46,6 @@
 #include "rtsp-media-factory-wfd.h"
 #include "rtsp-sdp.h"
 #include "rtsp-params.h"
-#include "gstwfdmessage.h"
 
 #define GST_RTSP_WFD_CLIENT_GET_PRIVATE(obj)  \
    (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_WFD_CLIENT, GstRTSPWFDClientPrivate))
@@ -2086,6 +2085,18 @@ gst_rtsp_wfd_client_set_video_supported_resolution (GstRTSPWFDClient * client,
   return res;
 }
 
+GstRTSPResult
+gst_rtsp_wfd_client_set_video_native_resolution (GstRTSPWFDClient * client,
+    guint64 native_reso)
+{
+  GstRTSPResult res = GST_RTSP_OK;
+  GstRTSPWFDClientPrivate *priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client);
+  priv->video_native_resolution = native_reso;
+  GST_DEBUG ("Native Resolution : %"G_GUINT64_FORMAT, native_reso);
+
+  return res;
+}
+
 static gboolean
 wfd_ckeck_keep_alive_response (gpointer userdata)
 {
diff --git a/gst/rtsp-server/rtsp-client-wfd.h b/gst/rtsp-server/rtsp-client-wfd.h
index 4300181..5f429e3 100644
--- a/gst/rtsp-server/rtsp-client-wfd.h
+++ b/gst/rtsp-server/rtsp-client-wfd.h
@@ -34,6 +34,7 @@ typedef struct _GstRTSPWFDClientPrivate GstRTSPWFDClientPrivate;
 #include "rtsp-sdp.h"
 #include "rtsp-auth.h"
 #include "rtsp-client.h"
+#include "gstwfdmessage.h"
 
 #define GST_TYPE_RTSP_WFD_CLIENT              (gst_rtsp_wfd_client_get_type ())
 #define GST_IS_RTSP_WFD_CLIENT(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_WFD_CLIENT))
@@ -122,7 +123,8 @@ GstRTSPResult         gst_rtsp_wfd_client_trigger_request (
 
 GstRTSPResult         gst_rtsp_wfd_client_set_video_supported_resolution (
                           GstRTSPWFDClient * client, guint64 supported_reso);
-
+GstRTSPResult         gst_rtsp_wfd_client_set_video_native_resolution (
+		                      GstRTSPWFDClient * client, guint64 native_reso);
 /**
  * GstRTSPWFDClientSessionFilterFunc:
  * @client: a #GstRTSPWFDClient object
diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c
index 45abd90..ac1ce96 100644
--- a/gst/rtsp-server/rtsp-client.c
+++ b/gst/rtsp-server/rtsp-client.c
@@ -59,6 +59,7 @@ struct _GstRTSPClientPrivate
 {
   GMutex lock;                  /* protects everything else */
   GMutex send_lock;
+  GMutex watch_lock;
   GstRTSPConnection *connection;
   GstRTSPWatch *watch;
   GMainContext *watch_context;
@@ -287,6 +288,7 @@ gst_rtsp_client_init (GstRTSPClient * client)
 
   g_mutex_init (&priv->lock);
   g_mutex_init (&priv->send_lock);
+  g_mutex_init (&priv->watch_lock);
   priv->close_seq = 0;
   priv->drop_backlog = DEFAULT_DROP_BACKLOG;
 }
@@ -415,6 +417,7 @@ gst_rtsp_client_finalize (GObject * obj)
   g_free (priv->server_ip);
   g_mutex_clear (&priv->lock);
   g_mutex_clear (&priv->send_lock);
+  g_mutex_clear (&priv->watch_lock);
 
   G_OBJECT_CLASS (gst_rtsp_client_parent_class)->finalize (obj);
 }
@@ -1703,6 +1706,7 @@ handle_mikey_data (GstRTSPClient * client, GstRTSPContext * ctx,
     gst_caps_unref (caps);
   }
   gst_mikey_message_unref (msg);
+  gst_buffer_unref (key);
 
   return TRUE;
 
@@ -1790,7 +1794,9 @@ handle_keymgmt (GstRTSPClient * client, GstRTSPContext * ctx, gchar * keymgmt)
         handle_mikey_data (client, ctx, data, size);
       }
     }
+    g_strfreev (split);
   }
+  g_strfreev (specs);
   return TRUE;
 }
 
@@ -3188,7 +3194,9 @@ closed (GstRTSPWatch * watch, gpointer user_data)
   }
 
   gst_rtsp_watch_set_flushing (watch, TRUE);
+  g_mutex_lock (&priv->watch_lock);
   gst_rtsp_client_set_send_func (client, NULL, NULL, NULL);
+  g_mutex_unlock (&priv->watch_lock);
 
   return GST_RTSP_OK;
 }
@@ -3308,6 +3316,7 @@ handle_tunnel (GstRTSPClient * client)
 
     opriv = oclient->priv;
 
+    g_mutex_lock (&opriv->watch_lock);
     if (opriv->watch == NULL)
       goto tunnel_closed;
 
@@ -3317,6 +3326,7 @@ handle_tunnel (GstRTSPClient * client)
     gst_rtsp_connection_do_tunnel (opriv->connection, priv->connection);
     gst_rtsp_watch_reset (priv->watch);
     gst_rtsp_watch_reset (opriv->watch);
+    g_mutex_unlock (&opriv->watch_lock);
     g_object_unref (oclient);
 
     /* the old client owns the tunnel now, the new one will be freed */
@@ -3336,6 +3346,7 @@ no_tunnelid:
 tunnel_closed:
   {
     GST_ERROR ("client %p: tunnel session %s was closed", client, tunnelid);
+    g_mutex_unlock (&opriv->watch_lock);
     g_object_unref (oclient);
     return FALSE;
   }
diff --git a/gst/rtsp-server/rtsp-media-factory-wfd.c b/gst/rtsp-server/rtsp-media-factory-wfd.c
index 137930a..c0f50f2 100644
--- a/gst/rtsp-server/rtsp-media-factory-wfd.c
+++ b/gst/rtsp-server/rtsp-media-factory-wfd.c
@@ -717,6 +717,7 @@ _rtsp_media_factory_wfd_create_xvcapture_bin (GstRTSPMediaFactoryWFD * factory,
   GstElement *vcaps = NULL;
   gchar *vcodec = NULL;
   GstElement *venc = NULL;
+  GstElement *vparse = NULL;
   GstElement *vqueue = NULL;
   GstRTSPMediaFactoryWFDPrivate *priv = NULL;
 
@@ -763,14 +764,21 @@ _rtsp_media_factory_wfd_create_xvcapture_bin (GstRTSPMediaFactoryWFD * factory,
   g_object_set (venc, "idr-period", 120, NULL);
   g_object_set (venc, "skip-inbuf", priv->video_enc_skip_inbuf_value, NULL);
 
+  vparse = gst_element_factory_make ("h264parse", "videoparse");
+  if (NULL == vparse) {
+    GST_ERROR_OBJECT (factory, "failed to create h264 parse element");
+    goto create_error;
+  }
+  g_object_set (vparse, "config-interval", 1, NULL);
+
   vqueue = gst_element_factory_make ("queue", "video-queue");
   if (!vqueue) {
     GST_ERROR_OBJECT (factory, "failed to create video queue element");
     goto create_error;
   }
 
-  gst_bin_add_many (srcbin, videosrc, vcaps, venc, vqueue, NULL);
-  if (!gst_element_link_many (videosrc, vcaps, venc, vqueue, NULL)) {
+  gst_bin_add_many (srcbin, videosrc, vcaps, venc, vparse, vqueue, NULL);
+  if (!gst_element_link_many (videosrc, vcaps, venc, vparse, vqueue, NULL)) {
     GST_ERROR_OBJECT (factory, "Failed to link video src elements...");
     goto create_error;
   }
diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c
index 48868f5..6b81e25 100644
--- a/gst/rtsp-server/rtsp-media.c
+++ b/gst/rtsp-server/rtsp-media.c
@@ -2713,6 +2713,14 @@ no_setup_sdp:
   }
 }
 
+static void
+do_set_seqnum (GstRTSPStream * stream)
+{
+  guint16 seq_num;
+  seq_num = gst_rtsp_stream_get_current_seqnum (stream);
+  gst_rtsp_stream_set_seqnum_offset (stream, seq_num + 1);
+}
+
 /* call with state_lock */
 gboolean
 default_suspend (GstRTSPMedia * media)
@@ -2735,6 +2743,12 @@ default_suspend (GstRTSPMedia * media)
       ret = set_target_state (media, GST_STATE_NULL, TRUE);
       if (ret == GST_STATE_CHANGE_FAILURE)
         goto state_failed;
+      /* Because payloader needs to set the sequence number as
+       * monotonic, we need to preserve the sequence number
+       * after pause. (otherwise going from pause to play,  which
+       * is actually from NULL to PLAY will create a new sequence
+       * number. */
+      g_ptr_array_foreach (priv->streams, (GFunc) do_set_seqnum, NULL);
       break;
     default:
       break;
diff --git a/gst/rtsp-server/rtsp-server-wfd.c b/gst/rtsp-server/rtsp-server-wfd.c
index 8e14f97..eb56e53 100644
--- a/gst/rtsp-server/rtsp-server-wfd.c
+++ b/gst/rtsp-server/rtsp-server-wfd.c
@@ -71,6 +71,7 @@ struct _GstRTSPWFDServerPrivate
 
   /* the clients that are connected */
   GList *clients;
+  guint64 native_resolution;
   guint64 supported_resolution;
 };
 
@@ -118,6 +119,7 @@ gst_rtsp_wfd_server_init (GstRTSPWFDServer * server)
   GstRTSPWFDServerPrivate *priv = GST_RTSP_WFD_SERVER_GET_PRIVATE (server);
 
   server->priv = priv;
+  server->priv->native_resolution = 0;
   server->priv->supported_resolution = 1;
   GST_INFO_OBJECT (server, "New server is initialized");
 }
@@ -227,6 +229,9 @@ create_client_wfd (GstRTSPServer * server)
   gst_rtsp_wfd_client_set_video_supported_resolution (client,
         priv->supported_resolution);
 
+  gst_rtsp_wfd_client_set_video_native_resolution (client,
+        priv->native_resolution);
+
   GST_RTSP_WFD_SERVER_UNLOCK (server);
 
   return GST_RTSP_CLIENT (client);
@@ -279,3 +284,18 @@ gst_rtsp_wfd_server_set_supported_reso(GstRTSPWFDServer *server, guint64 support
   GST_RTSP_WFD_SERVER_UNLOCK (server);
   return res;
 }
+GstRTSPResult
+gst_rtsp_wfd_server_set_video_native_reso (GstRTSPWFDServer *server, guint64 native_reso)
+{
+	  GstRTSPResult res = GST_RTSP_OK;
+	  GstRTSPWFDServerPrivate *priv = GST_RTSP_WFD_SERVER_GET_PRIVATE(server);
+
+	  g_return_val_if_fail (GST_IS_RTSP_WFD_SERVER (server), GST_RTSP_ERROR);
+
+	  GST_RTSP_WFD_SERVER_LOCK (server);
+
+	  priv->native_resolution = native_reso;
+
+	  GST_RTSP_WFD_SERVER_UNLOCK (server);
+	  return res;
+}
diff --git a/gst/rtsp-server/rtsp-server-wfd.h b/gst/rtsp-server/rtsp-server-wfd.h
index 890a0fe..c1da877 100644
--- a/gst/rtsp-server/rtsp-server-wfd.h
+++ b/gst/rtsp-server/rtsp-server-wfd.h
@@ -78,7 +78,8 @@ GType                 gst_rtsp_wfd_server_get_type             (void);
 GstRTSPWFDServer *    gst_rtsp_wfd_server_new                  (void);
 GstRTSPResult         gst_rtsp_wfd_server_trigger_request      (GstRTSPServer *server, GstWFDTriggerType type);
 
-GstRTSPResult gst_rtsp_wfd_server_set_supported_reso(GstRTSPWFDServer *server, guint64 supported_reso);
+GstRTSPResult         gst_rtsp_wfd_server_set_supported_reso (GstRTSPWFDServer *server, guint64 supported_reso);
+GstRTSPResult         gst_rtsp_wfd_server_set_video_native_reso    (GstRTSPWFDServer *server, guint64 native_reso);
 
 #if 0
 void                  gst_rtsp_server_set_address          (GstRTSPServer *server, const gchar *address);
diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c
index b618f7c..862404b 100644
--- a/gst/rtsp-server/rtsp-stream.c
+++ b/gst/rtsp-server/rtsp-stream.c
@@ -1734,7 +1734,7 @@ gst_rtsp_stream_join_bin (GstRTSPStream * stream, GstBin * bin,
   priv->recv_sink[1] = gst_element_get_request_pad (rtpbin, name);
   g_free (name);
 
-  /* get the session, TODO-WFD: This session needs to be decrease ref count? */
+  /* get the session */
   g_signal_emit_by_name (rtpbin, "get-internal-session", idx, &priv->session);
 
   g_signal_connect (priv->session, "on-new-ssrc", (GCallback) on_new_ssrc,
@@ -2035,6 +2035,8 @@ gst_rtsp_stream_leave_bin (GstRTSPStream * stream, GstBin * bin,
 
   if (priv->srtpenc)
     gst_object_unref (priv->srtpenc);
+  if (priv->srtpdec)
+    gst_object_unref (priv->srtpdec);
 
   priv->is_joined = FALSE;
   g_mutex_unlock (&priv->lock);
@@ -2476,6 +2478,48 @@ gst_rtsp_stream_get_rtcp_socket (GstRTSPStream * stream, GSocketFamily family)
 }
 
 /**
+ * gst_rtsp_stream_set_seqnum:
+ * @stream: a #GstRTSPStream
+ * @seqnum: a new sequence number
+ *
+ * Configure the sequence number in the payloader of @stream to @seqnum.
+ */
+void
+gst_rtsp_stream_set_seqnum_offset (GstRTSPStream * stream, guint16 seqnum)
+{
+  GstRTSPStreamPrivate *priv;
+
+  g_return_if_fail (GST_IS_RTSP_STREAM (stream));
+
+  priv = stream->priv;
+
+  g_object_set (G_OBJECT (priv->payloader), "seqnum-offset", seqnum, NULL);
+}
+
+/**
+ * gst_rtsp_stream_get_seqnum:
+ * @stream: a #GstRTSPStream
+ *
+ * Get the configured sequence number in the payloader of @stream.
+ *
+ * Returns: the sequence number of the payloader.
+ */
+guint16
+gst_rtsp_stream_get_current_seqnum (GstRTSPStream * stream)
+{
+  GstRTSPStreamPrivate *priv;
+  guint seqnum;
+
+  g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), 0);
+
+  priv = stream->priv;
+
+  g_object_get (G_OBJECT (priv->payloader), "seqnum", &seqnum, NULL);
+
+  return seqnum;
+}
+
+/**
  * gst_rtsp_stream_transport_filter:
  * @stream: a #GstRTSPStream
  * @func: (scope call) (allow-none): a callback
diff --git a/gst/rtsp-server/rtsp-stream.h b/gst/rtsp-server/rtsp-stream.h
index 1dbfdf3..135689e 100644
--- a/gst/rtsp-server/rtsp-stream.h
+++ b/gst/rtsp-server/rtsp-stream.h
@@ -153,6 +153,9 @@ gboolean          gst_rtsp_stream_query_position   (GstRTSPStream * stream,
 gboolean          gst_rtsp_stream_query_stop       (GstRTSPStream * stream,
                                                     gint64 * stop);
 
+void              gst_rtsp_stream_set_seqnum_offset          (GstRTSPStream *stream, guint16 seqnum);
+guint16           gst_rtsp_stream_get_current_seqnum          (GstRTSPStream *stream);
+
 /**
  * GstRTSPStreamTransportFilterFunc:
  * @stream: a #GstRTSPStream object
diff --git a/ltmain.sh b/ltmain.sh
index 3fd54df..bffda54 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -70,7 +70,7 @@
 #         compiler:		$LTCC
 #         compiler flags:		$LTCFLAGS
 #         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.10
+#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.11
 #         automake:	$automake_version
 #         autoconf:	$autoconf_version
 #
@@ -80,7 +80,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.10"
+VERSION="2.4.2 Debian-2.4.2-1.11"
 TIMESTAMP=""
 package_revision=1.3337
 
diff --git a/packaging/gst-rtsp-server.spec b/packaging/gst-rtsp-server.spec
old mode 100755
new mode 100644
index 2a1edc5..30832e8
--- a/packaging/gst-rtsp-server.spec
+++ b/packaging/gst-rtsp-server.spec
@@ -1,6 +1,6 @@
 Name:       gst-rtsp-server
 Summary:    Multimedia Framework Library
-Version:    1.4.1
+Version:    1.4.5
 Release:    0
 Group:      System/Libraries
 License:    LGPLv2+
-- 
2.7.4