Commit graph

421 commits

Author SHA1 Message Date
Mathieu Duponchelle
aa6daaafc6 rtspconnection: do not duplicate authentication headers
rtsp_connection_send takes care of adding those already,
and some reverse proxies such as nginx will reject the request
altogether if the Authorization header is present twice,
even with the same value.

https://bugzilla.gnome.org/show_bug.cgi?id=797272
2018-10-11 15:35:56 +02:00
Tim-Philipp Müller
dc29bc4e13 libs: fix API export/import and 'inconsistent linkage' on MSVC
For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

While we're at it, add new GST_API_EXPORT in config.h and use
that for GST_*_API decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-24 08:45:34 +01:00
Nirbheek Chauhan
a9cab426d0 meson: Maintain macOS ABI through dylib versioning
Requires Meson 0.48, but the feature will be ignored on older versions
so it's safe to add it without bumping the requirement.

Documentation:
https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-manual.md#shared_library
2018-08-31 14:40:43 +05:30
Tim-Philipp Müller
ca15315565 gst-libs: include config.h in all source files
This will be needed later when we get our export define from config.h
2018-08-13 09:23:34 +01:00
Tim-Philipp Müller
f548546d41 pbutils, rtsp: fix deprecation guards
Function body must only be removed if compiling with
GST_REMOVE_DEPRECATED. Function declaration must not
be skipped if GST_DISABLE_DEPRECATED is defined, since
it contains our export decorator and we wouldn't export
the symbol as public API any more then since we compile
with GST_DISABLE_DEPRECATED.
2018-08-13 00:24:50 +01:00
Bastian Köcher
efa9bdccf9 meson: fix install dir for generated header files
Nixos installs into a non-standard includedir, so need
to take account of the 'includedir' option instead of
just hard-coding 'include' here.

https://bugzilla.gnome.org/show_bug.cgi?id=794856
2018-08-10 12:43:38 +01:00
Thibault Saunier
7757e07f68 rtsp: Include gstreamer-base gir dir in autotools 2018-08-06 14:18:12 -04:00
Nirbheek Chauhan
eadedc68f8 meson: Add feature options for all plugins
GL dependency detection is still automagic.

https://bugzilla.gnome.org/show_bug.cgi?id=795107
2018-07-27 18:42:11 +05:30
Tim-Philipp Müller
a3a9bcd468 meson: rtsp now also depends on libgstbase 2018-06-29 10:54:36 +01:00
Edward Hervey
017dd37f86 rtsp: Also use libgstbase for introspection module 2018-06-29 08:53:48 +02:00
Sebastian Dröge
a9e72b3b7f rtsp: Link to libgstbase for GstDataQueue 2018-06-29 08:08:46 +02:00
Sebastian Dröge
d4f607ef40 rtspconnection: Use GstQueueArray instead of GQueue for the queued messages 2018-06-29 07:38:20 +02:00
Mathieu Duponchelle
0304c63f00 rtspdefs: Add gst_rtsp_generate_digest_auth_response_from_md5
Passwords are usually not stored in clear text, usually
the A1 section of the response is stored as is in .htdigest
files.

https://bugzilla.gnome.org/show_bug.cgi?id=796636
2018-06-21 15:32:12 +02:00
Antoine Jacoutot
c765649505 libs: g-ir-scanner: do not hardcode libtool path
https://bugzilla.gnome.org/show_bug.cgi?id=726571
2018-05-18 13:41:25 +02:00
Mark Nauwelaerts
31061ada4e rtsp: fix some GIR annotations
Mostly related to out and array parameters.
2018-04-23 19:33:17 +02:00
Edward Hervey
22c9e5f7c1 libs: Documentation cleanup
* Fix wrong naming, wrong types and typos
* Add missing sections
* Add missing documentation for entries
* Explicitely mark private structure entries
* Remove items that never existed
2018-04-02 08:53:28 +02:00
Edward Hervey
d69fa0c78e libs: Add deprecation guard
Those functions have been marked as deprecated
2018-04-02 08:53:28 +02:00
Alessandro Decina
345aa2cd9e meson: libs: use gnome.mkenums_simple() to generate enumtypes files
This way we no longer need custom wrapper scripts or template files.
2018-03-22 13:15:35 +00:00
Tim-Philipp Müller
12b24fbba0 rtsp: GST_EXPORT -> GST_RTSP_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:16:42 +00:00
Sebastian Cote
9e77d9cacf rtspconnection: also add Content-Type to HTTP POST request when tunnelling
When the GstRTSPConnection class sends a RTSP over HTTP tunnelling
request, the HTTP Content-Type header is missing from the HTTP POST
request.

This isn't a problem with most servers, but there are servers that
rejects the request without there also being a Content-Type header.

RFC 1945:
Any HTTP/1.0 message containing an entity body should include a
Content-Type header field defining the media type of that body.

Apple Dispatch 28:
QuickTime Streaming uses the "application/x-rtsp-tunnelled" MIME
type in both the Content-Type and Accept headers. This reflects
the data type that is expected and delivered by the client and server.

https://bugzilla.gnome.org/show_bug.cgi?id=793110
2018-02-08 16:08:03 +00:00
Matt Staples
4b4f8d1a05 rtsp: Register GstRTSPMessage as a boxed type
Registering GstRTSPMessage as a boxed type allows it to be conveniently
used as an argument to signals, a-la GstSDPMessage, and general usage
from bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=762884
2017-12-06 10:40:55 +02:00
Sebastian Dröge
9c2d5e863e rtspconnection: Allow setting a custom accept-certificate function for manually checking a TLS certificate for validity
https://bugzilla.gnome.org/show_bug.cgi?id=785024
2017-11-01 13:41:42 +02:00
Thibault Saunier
6d4e17eee8 doc: Add some missing/malformed Since markers 2017-10-16 14:17:00 +02:00
Thibault Saunier
20fae3f1e0 rtsp: Start implementing support for RTSP 2.0
Properly handle protocol version in the connection

Add the following headers types:
  * Pipelined-Request
  * Media-Properties
  * Seek-Style
  * Accept-Ranges

https://bugzilla.gnome.org/show_bug.cgi?id=781446
2017-10-05 13:16:03 -03:00
Havard Graff
43985b363d meson: remove vs_module_defs
GST_EXPORT should handle it.
2017-10-05 13:53:14 +01:00
Reynaldo H. Verdejo Pinochet
e81c334ca9 Use proper GtkDoc notation for NULL/FALSE/TRUE 2017-10-03 14:31:18 -07:00
Sebastian Dröge
24fe473a01 libs: Export boxed type copy/free functions for the remaining types 2017-06-20 10:06:17 +03:00
Tim-Philipp Müller
587cf82fc1 rtsp: mark symbols explicitly for export with GST_EXPORT 2017-05-16 15:22:45 +01:00
Tim-Philipp Müller
60e9629860 g-i: no need to load registry in g-i scanner 2017-05-04 23:55:20 +01:00
Rico Tzschichholz
07a427b403 meson: Pass --c-include accordingly to GIR builds 2017-04-13 12:23:32 +01:00
Thibault Saunier
099ac9faf2 docs: Convert gtkdoc comments to markdown
Modernizing the documentation, making it simpler to read an
modify and allowing us to possibly switch to hotdoc in the
future.
2017-03-10 18:19:17 -03:00
Stuart Weaver
0cf08d90c0 rtsp-url: unescape special chars in user/pass part of URL
This way special characters such as '@' can be used in
usernames or passwords, e.g.

  rtsp://view:%40dm%4An@<IP-ADDR>/media/camera1

will now parse username and password into:

  User: view
  Pass: @dm:n

https://bugzilla.gnome.org/show_bug.cgi?id=758389
2016-12-25 12:08:45 +00:00
Tim-Philipp Müller
e0742b8759 rtsp: add boxed types for new authentication credential API
To make the structs usable in bindings, and fix

gstrtspmessage.c:1188: Warning: GstRtsp:
gst_rtsp_message_parse_auth_credentials: return value: Invalid
non-constant return of bare structure or union; register as
boxed type or (skip)

https://bugzilla.gnome.org/show_bug.cgi?id=774416
2016-12-13 22:45:02 +00:00
Edward Hervey
fb4856c839 rtsp: Don't leak authorization string 2016-11-28 16:51:23 +01:00
Sebastian Dröge
7e4697ec98 rtspdefs: Assert on the excepted MD5 digest string length
CID 1394494.
2016-11-23 18:26:29 +02:00
Sebastian Dröge
90b24d34b3 rtsp: Add gst_rtsp_message_parse_auth_credentials() to parse authentication credentials
https://bugzilla.gnome.org/show_bug.cgi?id=774416
2016-11-21 09:39:21 +02:00
Sebastian Dröge
828c8604dd rtsp: Add gst_rtsp_generate_digest_auth_response() to calculate digest auth response
https://bugzilla.gnome.org/show_bug.cgi?id=774416
2016-11-21 09:39:21 +02:00
Thibault Saunier
30b3055780 rtsp: Include GstSdp-1.0.gir when generating the gir
It is actually needed as we need some symbols. We do not link
to libgstsdp as the user of the lib should do it (same with
autotools build).

This reverts previous commit
2016-11-10 17:43:38 -03:00
Thibault Saunier
b42a9c0cde libs:rtsp: Remove wrong dependency on Sdp for the gir file 2016-11-10 16:40:56 -03:00
Thibault Saunier
de6f4f0c7f libs:rtsp: Remove wrong dependency on Sdp for the gir file 2016-11-10 16:37:39 -03:00
Thibault Saunier
6917cb629e meson: Generate girs
https://bugzilla.gnome.org/show_bug.cgi?id=773944
2016-11-09 18:06:19 -03:00
Nirbheek Chauhan
5c4f4ac1bd Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-20 11:09:51 +01:00
Sergio Torres Soldado
7960bc0380 rtspconnection: Fix potential deadlock caused by blocking read forever
Reset the connection "may_cancel" property to avoid a potential deadlock
if there is no data to read and the socket stays blocked forever.

https://bugzilla.gnome.org/show_bug.cgi?id=768249
2016-07-07 19:15:18 +03:00
Tim-Philipp Müller
d52a74f32e g-i: pass compiler env to g-ir-scanner
It's what introspection.mak does as well. Should
fix spurious build failures on gnome-continuous.
2016-05-24 00:44:21 +01:00
Xavier Claessens
429860e51f base: Add g_autoptr() support to all types
https://bugzilla.gnome.org/show_bug.cgi?id=754464
2015-12-14 13:39:43 -05:00
Sebastian Dröge
b0c834df1b rtspconnection: Properly initialize stack-allocated RTSP message to all-zeroes 2015-12-14 19:03:33 +01:00
Evan Callaway
5ac65d9e3a rtspconnection: Use relative URI for non-proxy tunneled requests
Match the section 5.1.2 of the HTTP/1.0 spec by using relative URIs unless we
are using a proxy server. Also, send Host header for compatability with
HTTP/1.1 and some HTTP/1.0 servers.

https://bugzilla.gnome.org/show_bug.cgi?id=758922
2015-12-14 18:21:10 +01:00
Evan Callaway
65c7bd7a2c rtspconnection: Support authentication during tunneling setup
gst_rtsp_connection_connect_with_response accepts a response pointer
which it fills with the response from setup_tunneling if the
connection is configured to be tunneled.  The motivation for this is to
allow the caller to inspect the response header to determine if
additional authentication is required so that the connection can be
retried with the appropriate authentication headers.

The function prototype of gst_rtsp_connection_connect has been
preserved for compatability with existing code and wraps
gst_rtsp_connection_connect_with_response.

https://bugzilla.gnome.org/show_bug.cgi?id=749596
2015-12-14 16:00:45 +01:00
Reynaldo H. Verdejo Pinochet
4ed7b0a0e6 Drop usage of deprecated g-ir-scanner --strip-prefix flag 2015-12-02 20:19:43 -08:00
Evan Callaway
e47643122c rtspconnection: Update capitalization of x-sessioncookie
Some servers incorrectly parse header names with strict case-sensitivity.  For
compatibility with these systems change X-Sessioncookie to x-sessioncookie.

https://bugzilla.gnome.org/show_bug.cgi?id=758921
2015-12-02 16:29:53 +02:00