diff --git a/Cargo.toml b/Cargo.toml index af971d672..b3c358272 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,9 @@ members = [ "gstreamer-base", "gstreamer-net", "gstreamer-player", + "gstreamer-rtsp", + "gstreamer-rtsp-server", + "gstreamer-sdp", "gstreamer-video", "examples", "tutorials", diff --git a/Gir_GstRtsp.toml b/Gir_GstRtsp.toml new file mode 100644 index 000000000..5dc80946b --- /dev/null +++ b/Gir_GstRtsp.toml @@ -0,0 +1,67 @@ +[options] +girs_dir = "gir-files" +library = "GstRtsp" +version = "1.0" +min_cfg_version = "1.8" +target_path = "gstreamer-rtsp" +work_mode = "normal" +concurrency = "send+sync" +generate_safety_asserts = true +doc_target_path = "docs/gstreamer-rtsp/docs.md" + +external_libraries = [ + "GLib", + "GObject", + "Gio", + "GstSdp" +] + +generate = [ + "GstRtsp.RTSPAuthMethod", + "GstRtsp.RTSPEvent", + "GstRtsp.RTSPFamily", + "GstRtsp.RTSPHeaderField", + "GstRtsp.RTSPLowerTrans", + "GstRtsp.RTSPMethod", + "GstRtsp.RTSPMsgType", + "GstRtsp.RTSPProfile", + "GstRtsp.RTSPRangeUnit", + "GstRtsp.RTSPResult", + "GstRtsp.RTSPState", + "GstRtsp.RTSPStatusCode", + "GstRtsp.RTSPTimeType", + "GstRtsp.RTSPTransMode" +] + +manual = [ + "GLib.MainContext", +] + +[[object]] +name = "GstRtsp.RTSPUrl" +status = "generate" +concurrency = "send" + + [[object.function]] + name = "get_port" + ignore = true + +[[object]] +name = "GstRtsp.RTSPAuthParam" +status = "generate" +concurrency="send" + +[[object]] +name = "Gst.ClockTime" +status = "manual" +conversion_type = "scalar" + +[[object]] +name = "Gst.Caps" +status = "manual" +ref_mode = "ref" + +[[object]] +name = "Gst.Structure" +status = "manual" +ref_mode = "ref-mut" diff --git a/Gir_GstRtspServer.toml b/Gir_GstRtspServer.toml new file mode 100644 index 000000000..45ce5355e --- /dev/null +++ b/Gir_GstRtspServer.toml @@ -0,0 +1,226 @@ +[options] +girs_dir = "gir-files" +library = "GstRtspServer" +version = "1.0" +min_cfg_version = "1.8" +target_path = "gstreamer-rtsp-server" +work_mode = "normal" +concurrency = "send+sync" +generate_safety_asserts = true +doc_target_path = "docs/gstreamer-rtsp-server/docs.md" + +external_libraries = [ + "GLib", + "GObject", + "Gio", + "Gst", + "GstNet", + "GstRtsp", + "GstSDP" +] + +generate = [ + "GstRtspServer.RTSPAddressFlags", + "GstRtspServer.RTSPAddressPoolResult", + "GstRtspServer.RTSPMediaFactory", + "GstRtspServer.RTSPMediaFactoryURI", + "GstRtspServer.RTSPMediaStatus", + "GstRtspServer.RTSPMountPoints", + "GstRtspServer.RTSPPublishClockMode", + "GstRtspServer.RTSPSession", + "GstRtspServer.RTSPSuspendMode", + "GstRtspServer.RTSPThreadPool", + "GstRtspServer.RTSPThreadType", + "GstRtspServer.RTSPTransportMode" +] + +manual = [ + "GLib.MainContext", + "GLib.IOCondition", + "GLib.Source", + "GLib.MainLoop", + "GLib.ThreadPool", + "GLib.Error", + "GObject.Object", + "Gio.TlsCertificateFlags", + "Gio.TlsCertificate", + "Gio.Socket", + "Gio.Cancellable", + "Gio.SocketFamily", + "Gst.Element", + "Gst.State", + "Gst.Clock", + "Gst.Pipeline", + "Gst.Pad", + "Gst.Bin", + "Gst.FlowReturn", + "GstRtsp.RTSPAuthMethod", + "GstRtsp.RTSPUrl", + "GstRtsp.RTSPResult", + "GstRtsp.RTSPStatusCode", + "GstRtsp.RTSPRangeUnit", + "GstRtsp.RTSPProfile", + "GstRtsp.RTSPLowerTrans" +] + +[[object]] +name = "Gst.Message" +status = "manual" +ref_mode = "ref" + +[[object]] +name = "Gst.Structure" +status = "manual" +ref_mode = "ref-mut" + +[[object]] +name = "Gst.Buffer" +status = "manual" +ref_mode = "ref" + +[[object]] +name = "Gst.Caps" +status = "manual" +ref_mode = "ref" + +[[object]] +name = "Gst.ClockTime" +status = "manual" +conversion_type = "scalar" + +[[object]] +name = "GstRtspServer.RTSPServer" +status = "generate" + + [[object.function]] + name = "attach" + ignore = true + +[[object]] +name = "GstRtspServer.RTSPClient" +status = "generate" + + [[object.function]] + name = "attach" + ignore = true + +[[object]] +name = "GstRtspServer.RTSPStream" +status = "generate" + + [[object.function]] + name = "query_position" + ignore = true + + [[object.function]] + name = "query_stop" + ignore = true + + [[object.function]] + name = "add_transport" + [object.function.return] + bool_return_is_error = "Failed to add transport" + + [[object.function]] + name = "remove_transport" + [object.function.return] + bool_return_is_error = "Failed to remove transport" + + [[object.function]] + name = "join_bin" + [object.function.return] + bool_return_is_error = "Failed to join bin" + + [[object.function]] + name = "leave_bin" + [object.function.return] + bool_return_is_error = "Failed to leave bin" + +[[object]] +name = "GstRtspServer.RTSPAddress" +status = "generate" +concurrency = "send" + +[[object]] +name = "GstRtspServer.RTSPStreamTransport" +status = "generate" +concurrency = "none" + + [[object.function]] + name = "send_rtcp" + [object.function.return] + bool_return_is_error = "Failed to send rtcp" + + [[object.function]] + name = "send_rtp" + [object.function.return] + bool_return_is_error = "Failed to send rtp" + + [[object.function]] + name = "set_active" + [object.function.return] + bool_return_is_error = "Failed to set active" + +[[object]] +name = "GstRtspServer.RTSPAddressPool" +status = "generate" + + [[object.function]] + name = "add_range" + [object.function.return] + bool_return_is_error = "Failed to add address range" + + [[object.function]] + name = "reserve_address" + ignore = true + +[[object]] +name = "GstRtspServer.RTSPMedia" +status = "generate" + + [[object.function]] + name = "suspend" + [object.function.return] + bool_return_is_error = "Failed to suspend media" + + [[object.function]] + name = "unprepare" + [object.function.return] + bool_return_is_error = "Failed to unprepare media" + + [[object.function]] + name = "unsuspend" + [object.function.return] + bool_return_is_error = "Failed to unsuspend media" + +[[object]] +name = "GstRtspServer.RTSPSessionMedia" +status = "generate" + + [[object.function]] + name = "set_state" + [object.function.return] + bool_return_is_error = "Failed to set state of session media" + +[[object]] +name = "GstRtspServer.RTSPSessionPool" +status = "generate" + + [[object.function]] + name = "remove" + [object.function.return] + bool_return_is_error = "Failed to remove session from pool" + + [[object.function]] + name = "create_watch" + # GSource return + ignore = true + +[[object]] +name="GstRtspServer.RTSPAuth" +status="generate" + + [[object.function]] + name = "make_basic" + [object.function.return] + nullable = false diff --git a/Gir_GstSdp.toml b/Gir_GstSdp.toml new file mode 100644 index 000000000..e8a589d82 --- /dev/null +++ b/Gir_GstSdp.toml @@ -0,0 +1,40 @@ +[options] +girs_dir = "gir-files" +library = "GstSdp" +version = "1.0" +min_cfg_version = "1.8" +target_path = "gstreamer-sdp" +work_mode = "normal" +concurrency = "send+sync" +generate_safety_asserts = true +doc_target_path = "docs/gstreamer-sdp/docs.md" + +external_libraries = [ + "GLib", + "GObject", + "Gst", +] + +generate = [ + "GstSdp.MIKEYCacheType", + "GstSdp.MIKEYEncAlg", + "GstSdp.MIKEYKVType", + "GstSdp.MIKEYKeyDataType", + "GstSdp.MIKEYMacAlg", + "GstSdp.MIKEYMapType", + "GstSdp.MIKEYPRFFunc", + "GstSdp.MIKEYPayloadType", + "GstSdp.MIKEYSecProto", + "GstSdp.MIKEYSecSRTP", + "GstSdp.MIKEYTSType", + "GstSdp.MIKEYType", + "GstSdp.SDPResult" +] + +manual = [ +] + +[[object]] +name = "Gst.Caps" +status = "manual" +ref_mode = "ref" diff --git a/docs/gstreamer-rtsp-server/docs.md b/docs/gstreamer-rtsp-server/docs.md new file mode 100644 index 000000000..c43da5ba1 --- /dev/null +++ b/docs/gstreamer-rtsp-server/docs.md @@ -0,0 +1,2539 @@ + + +An address + +Make a copy of `self`. + +# Returns + +a copy of `self`. + +Free `self` and releasing it back into the pool when owned by a +pool. + +An address pool, all member are private + +# Implements + +[`RTSPAddressPoolExt`](trait.RTSPAddressPoolExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPAddressPool` methods. + +# Implementors + +[`RTSPAddressPool`](struct.RTSPAddressPool.html) + +Make a new `RTSPAddressPool`. + +# Returns + +a new `RTSPAddressPool` + +Take an address and ports from `self`. `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`. +## `flags` +flags +## `n_ports` +the amount of ports + +# Returns + +a `RTSPAddress` that should be freed with +gst_rtsp_address_free after use or `None` when no address could be +acquired. + +Adds the addresses from `min_addess` to `max_address` (inclusive) +to `self`. 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. +## `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. + +Clear all addresses in `self`. There should be no outstanding +allocations. + +Dump the free and allocated addresses to stdout. + +Used to know if the pool includes any unicast addresses. + +# Returns + +`true` if the pool includes any unicast addresses, `false` otherwise + +Take a specific address and ports from `self`. `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. +## `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 `RTSPAddress` + +# Returns + +`RTSPAddressPoolResult::Ok` if an address was reserved. The address +is returned in `address` and should be freed with gst_rtsp_address_free +after use. + +Result codes from RTSP address pool functions. + +no error + +invalid arguments were provided to a function + +the addres has already been reserved + +the address is not in the pool + +last error + +The authentication structure. + +# Implements + +[`RTSPAuthExt`](trait.RTSPAuthExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPAuth` methods. + +# Implementors + +[`RTSPAuth`](struct.RTSPAuth.html) + +Create a new `RTSPAuth` instance. + +# Returns + +a new `RTSPAuth` + +Check if `check` is allowed in the current context. +## `check` +the item to check + +# Returns + +FALSE if check failed. + +Construct a Basic authorisation token from `user` and `pass`. +## `user` +a userid +## `pass` +a password + +# Returns + +the base64 encoding of the string `user`:`pass`. +`g_free` after usage. + +Add a basic token for the default authentication algorithm that +enables the client with privileges listed in `token`. +## `basic` +the basic token +## `token` +authorisation token + +Add a digest `user` and `pass` for the default authentication algorithm that +enables the client with privileges listed in `token`. + +Feature: `v1_12` + +## `user` +the digest user name +## `pass` +the digest password +## `token` +authorisation token + +Get the default token for `self`. This token will be used for unauthenticated +users. + +# Returns + +the `RTSPToken` of `self`. `gst_rtsp_token_unref` after +usage. + +Gets the supported authentication methods of `self`. + +Feature: `v1_12` + + +# Returns + +The supported authentication methods + +Get the `gio::TlsAuthenticationMode`. + +# Returns + +the `gio::TlsAuthenticationMode`. + +Get the `gio::TlsCertificate` used for negotiating TLS `self`. + +# Returns + +the `gio::TlsCertificate` of `self`. `gobject::ObjectExt::unref` after +usage. + +Get the `gio::TlsDatabase` used for verifying client certificate. + +# Returns + +the `gio::TlsDatabase` of `self`. `gobject::ObjectExt::unref` after +usage. + +Removes `basic` authentication token. +## `basic` +the basic token + +Removes a digest user. + +Feature: `v1_12` + +## `user` +the digest user name + +Set the default `RTSPToken` to `token` in `self`. The default token will +be used for unauthenticated users. +## `token` +a `RTSPToken` + +Sets the supported authentication `methods` for `self`. + +Feature: `v1_12` + +## `methods` +supported methods + +The `gio::TlsAuthenticationMode` to set on the underlying GTlsServerConnection. +When set to another value than `gio::TlsAuthenticationMode::None`, +`RTSPAuth::accept-certificate` signal will be emitted and must be handled. +## `mode` +a `gio::TlsAuthenticationMode` + +Set the TLS certificate for the auth. Client connections will only +be accepted when TLS is negotiated. +## `cert` +a `gio::TlsCertificate` + +Sets the certificate database that is used to verify peer certificates. +If set to `None` (the default), then peer certificate validation will always +set the `gio::TlsCertificateFlags::UnknownCa` error. + +Since 1.6 +## `database` +a `gio::TlsDatabase` + +Emitted during the TLS handshake after the client certificate has +been received. See also `RTSPAuthExt::set_tls_authentication_mode`. +## `connection` +a `gio::TlsConnection` +## `peer_cert` +the peer's `gio::TlsCertificate` +## `errors` +the problems with `peer_cert`. + +# Returns + +`true` to accept `peer_cert` (which will also +immediately end the signal emission). `false` to allow the signal +emission to continue, which will cause the handshake to fail if +no one else overrides it. + +The client object represents the connection and its state with a client. + +# Implements + +[`RTSPClientExt`](trait.RTSPClientExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPClient` methods. + +# Implementors + +[`RTSPClient`](struct.RTSPClient.html) + +Create a new `RTSPClient` instance. + +# Returns + +a new `RTSPClient` + +Attaches `self` to `context`. When the mainloop for `context` is run, the +client will be dispatched. When `context` is `None`, 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. +## `context` +a `glib::MainContext` + +# Returns + +the ID (greater than 0) for the source within the GMainContext. + +Close the connection of `self` and remove all media it was managing. + +Get the `RTSPAuth` used as the authentication manager of `self`. + +# Returns + +the `RTSPAuth` of `self`. +`gobject::ObjectExt::unref` after usage. + +Get the `gst_rtsp::RTSPConnection` of `self`. + +# Returns + +the `gst_rtsp::RTSPConnection` of `self`. +The connection object returned remains valid until the client is freed. + +Get the `RTSPMountPoints` object that `self` uses to manage its sessions. + +# Returns + +a `RTSPMountPoints`, unref after usage. + +Get the `RTSPSessionPool` object that `self` uses to manage its sessions. + +# Returns + +a `RTSPSessionPool`, unref after usage. + +Get the `RTSPThreadPool` used as the thread pool of `self`. + +# Returns + +the `RTSPThreadPool` of `self`. `gobject::ObjectExt::unref` after +usage. + +Let the client handle `message`. +## `message` +an `gst_rtsp::RTSPMessage` + +# Returns + +a `gst_rtsp::RTSPResult`. + +Send a message message to the remote end. `message` must be a +`gst_rtsp::RTSPMsgType::Request` or a `gst_rtsp::RTSPMsgType::Response`. +## `session` +a `RTSPSession` to send + the message to or `None` +## `message` +The `gst_rtsp::RTSPMessage` to send + +Call `func` for each session managed by `self`. The result value of `func` +determines what happens to the session. `func` will be called with `self` +locked so no further actions on `self` can be performed from `func`. + +If `func` returns `RTSPFilterResult::Remove`, the session will be removed from +`self`. + +If `func` returns `RTSPFilterResult::Keep`, the session will remain in `self`. + +If `func` returns `RTSPFilterResult::Ref`, the session will remain in `self` but +will also be added with an additional ref to the result `glib::List` of this +function.. + +When `func` is `None`, `RTSPFilterResult::Ref` will be assumed for each session. +## `func` +a callback +## `user_data` +user data passed to `func` + +# Returns + +a `glib::List` with all +sessions for which `func` returned `RTSPFilterResult::Ref`. After usage, each +element in the `glib::List` should be unreffed before the list is freed. + +configure `auth` to be used as the authentication manager of `self`. +## `auth` +a `RTSPAuth` + +Set the `gst_rtsp::RTSPConnection` of `self`. This function takes ownership of +`conn`. +## `conn` +a `gst_rtsp::RTSPConnection` + +# Returns + +`true` on success. + +Set `mounts` as the mount points for `self` 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. +## `mounts` +a `RTSPMountPoints` + +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 `gst_rtsp::RTSPConnection` that +was configured with `RTSPClient::attach` was called. +## `func` +a `GstRTSPClientSendFunc` +## `user_data` +user data passed to `func` +## `notify` +called when `user_data` is no longer in use + +Set `pool` as the sessionpool for `self` 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. +## `pool` +a `RTSPSessionPool` + +configure `pool` to be used as the thread pool of `self`. +## `pool` +a `RTSPThreadPool` + +## `ctx` +a `RTSPContext` + +## `ctx` +a `RTSPContext` +## `arr` +a NULL-terminated array of strings + +# Returns + +a newly allocated string with comma-separated list of + unsupported options. An empty string must be returned if + all options are supported. + +## `ctx` +a `RTSPContext` + +## `ctx` +a `RTSPContext` + +## `ctx` +a `RTSPContext` + +## `ctx` +a `RTSPContext` + +## `ctx` +a `RTSPContext` + +## `ctx` +a `RTSPContext` + + +Feature: `v1_12` + +## `ctx` +a `RTSPContext` + +# Returns + +a `gst_rtsp::RTSPStatusCode`, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + +Feature: `v1_12` + +## `ctx` +a `RTSPContext` + +# Returns + +a `gst_rtsp::RTSPStatusCode`, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + +Feature: `v1_12` + +## `ctx` +a `RTSPContext` + +# Returns + +a `gst_rtsp::RTSPStatusCode`, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + +Feature: `v1_12` + +## `ctx` +a `RTSPContext` + +# Returns + +a `gst_rtsp::RTSPStatusCode`, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + +Feature: `v1_12` + +## `ctx` +a `RTSPContext` + +# Returns + +a `gst_rtsp::RTSPStatusCode`, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + +Feature: `v1_12` + +## `ctx` +a `RTSPContext` + +# Returns + +a `gst_rtsp::RTSPStatusCode`, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + +Feature: `v1_12` + +## `ctx` +a `RTSPContext` + +# Returns + +a `gst_rtsp::RTSPStatusCode`, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + +Feature: `v1_12` + +## `ctx` +a `RTSPContext` + +# Returns + +a `gst_rtsp::RTSPStatusCode`, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + +Feature: `v1_12` + +## `ctx` +a `RTSPContext` + +# Returns + +a `gst_rtsp::RTSPStatusCode`, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + +Feature: `v1_12` + +## `ctx` +a `RTSPContext` + +# Returns + +a `gst_rtsp::RTSPStatusCode`, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + +## `ctx` +a `RTSPContext` + +## `session` +The session +## `message` +The message + +## `ctx` +a `RTSPContext` + +## `ctx` +a `RTSPContext` + +## `ctx` +a `RTSPContext` + +A class that contains the GStreamer element along with a list of +`RTSPStream` objects that can produce data. + +This object is usually created from a `RTSPMediaFactory`. + +# Implements + +[`RTSPMediaExt`](trait.RTSPMediaExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPMedia` methods. + +# Implementors + +[`RTSPMedia`](struct.RTSPMedia.html) + +Create a new `RTSPMedia` instance. `element` is the bin element that +provides the different streams. The `RTSPMedia` object contains the +element to produce RTP data for one or more related (audio/video/..) +streams. + +Ownership is taken of `element`. +## `element` +a `gst::Element` + +# Returns + +a new `RTSPMedia` object. + +Find all payloader elements, they should be named pay\%d in the +element of `self`, and create `GstRTSPStreams` for them. + +Collect all dynamic elements, named dynpay\%d, and add them to +the list of dynamic elements. + +Find all depayloader elements, they should be named depay\%d in the +element of `self`, and create `GstRTSPStreams` for them. + +Create a new stream in `self` that provides RTP data on `pad`. +`pad` should be a pad of an element inside `self`->element. +## `payloader` +a `gst::Element` +## `pad` +a `gst::Pad` + +# Returns + +a new `RTSPStream` that remains valid for as long +as `self` exists. + +Find a stream in `self` with `control` as the control uri. +## `control` +the control of the stream + +# Returns + +the `RTSPStream` with +control uri `control` or `None` when a stream with that control did +not exist. + +Get the `RTSPAddressPool` used as the address pool of `self`. + +# Returns + +the `RTSPAddressPool` of `self`. +`gobject::ObjectExt::unref` after usage. + +Get the base_time that is used by the pipeline in `self`. + +`self` must be prepared before this method returns a valid base_time. + +# Returns + +the base_time used by `self`. + +Get the kernel UDP buffer size. + +# Returns + +the kernel UDP buffer size. + +Get the clock that is used by the pipeline in `self`. + +`self` must be prepared before this method returns a valid clock object. + +# Returns + +the `gst::Clock` used by `self`. unref after usage. + +Get the element that was used when constructing `self`. + +# Returns + +a `gst::Element`. Unref after usage. + +Get the latency that is used for receiving media. + +# Returns + +latency in milliseconds + +Get the multicast interface used for `self`. + +# Returns + +the multicast interface for `self`. +`g_free` after usage. + +Get the permissions object from `self`. + +# Returns + +a `RTSPPermissions` object, unref after usage. + +Get the allowed profiles of `self`. + +# Returns + +a `gst_rtsp::RTSPProfile` + +Get the allowed protocols of `self`. + +# Returns + +a `gst_rtsp::RTSPLowerTrans` + +Gets if and how the media clock should be published according to RFC7273. + +# Returns + +The GstRTSPPublishClockMode + +Get the current range as a string. `self` must be prepared with +gst_rtsp_media_prepare (). +## `play` +for the PLAY request +## `unit` +the unit to use for the string + +# Returns + +The range as a string, `g_free` after usage. + +Get the amount of time to store retransmission data. + +# Returns + +the amount of time to store retransmission data. + +Get the status of `self`. When `self` is busy preparing, this function waits +until `self` is prepared or in error. + +# Returns + +the status of `self`. + +Retrieve the stream with index `idx` from `self`. +## `idx` +the stream index + +# Returns + +the `RTSPStream` at index +`idx` or `None` when a stream with that index did not exist. + +Get how `self` will be suspended. + +# Returns + +`RTSPSuspendMode`. + +Get the `gst_net::NetTimeProvider` for the clock used by `self`. The time provider +will listen on `address` and `port` for client time requests. +## `address` +an address or `None` +## `port` +a port or 0 + +# Returns + +the `gst_net::NetTimeProvider` of `self`. + +Check if the pipeline for `self` can be used for PLAY or RECORD methods. + +# Returns + +The transport mode. + +Configure an SDP on `self` for receiving streams +## `sdp` +a `gst_sdp::SDPMessage` + +# Returns + +TRUE on success. + +Check if the pipeline for `self` will send an EOS down the pipeline before +unpreparing. + +# Returns + +`true` if the media will send EOS before unpreparing. + +Check if the pipeline for `self` can be reused after an unprepare. + +# Returns + +`true` if the media can be reused + +Check if the pipeline for `self` can be shared between multiple clients. + +# Returns + +`true` if the media can be shared between clients. + +Check if the pipeline for `self` will be stopped when a client disconnects +without sending TEARDOWN. + +# Returns + +`true` if the media will be stopped when a client disconnects + without sending TEARDOWN. + +Check if `self` can provide a `gst_net::NetTimeProvider` for its pipeline clock. + +Use `RTSPMediaExt::get_time_provider` to get the network clock. + +# Returns + +`true` if `self` can provide a `gst_net::NetTimeProvider`. + +Get the number of streams in this media. + +# Returns + +The number of streams. + +Prepare `self` for streaming. This function will create the objects +to manage the streaming. A pipeline must have been set on `self` with +`RTSPMediaExt::take_pipeline`. + +It will preroll the pipeline and collect vital information about the streams +such as the duration. +## `thread` +a `RTSPThread` to run the + bus handler or `None` + +# Returns + +`true` on success. + +Seek the pipeline of `self` to `range`. `self` must be prepared with +`RTSPMediaExt::prepare`. +## `range` +a `gst_rtsp::RTSPTimeRange` + +# Returns + +`true` on success. + +configure `pool` to be used as the address pool of `self`. +## `pool` +a `RTSPAddressPool` + +Set the kernel UDP buffer size. +## `size` +the new value + +Configure the clock used for the media. +## `clock` +`gst::Clock` to be used + +Set or unset if an EOS event will be sent to the pipeline for `self` before +it is unprepared. +## `eos_shutdown` +the new value + +Configure the latency used for receiving media. +## `latency` +latency in milliseconds + +configure `multicast_iface` to be used for `self`. +## `multicast_iface` +a multicast interface name + +Set `permissions` on `self`. +## `permissions` +a `RTSPPermissions` + +Set the state of the pipeline managed by `self` to `state` +## `state` +the target state of the pipeline + +Configure the allowed lower transport for `self`. +## `profiles` +the new flags + +Configure the allowed lower transport for `self`. +## `protocols` +the new flags + +Sets if and how the media clock should be published according to RFC7273. +## `mode` +the clock publish mode + +Set the amount of time to store retransmission packets. +## `time` +the new value + +Set or unset if the pipeline for `self` can be reused after the pipeline has +been unprepared. +## `reusable` +the new value + +Set or unset if the pipeline for `self` can be shared will multiple clients. +When `shared` is `true`, client requests for this media will share the media +pipeline. +## `shared` +the new value + +Set the state of `self` to `state` and for the transports in `transports`. + +`self` must be prepared with `RTSPMediaExt::prepare`; +## `state` +the target state of the media +## `transports` + +a `glib::PtrArray` of `RTSPStreamTransport` pointers + +# Returns + +`true` on success. + +Set or unset if the pipeline for `self` should be stopped when a +client disconnects without sending TEARDOWN. +## `stop_on_disconnect` +the new value + +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. +## `mode` +the new `RTSPSuspendMode` + +Sets if the media pipeline can work in PLAY or RECORD mode +## `mode` +the new value + +Add `self` specific info to `sdp`. `info` is used to configure the connection +information in the SDP. +## `sdp` +a `gst_sdp::SDPMessage` +## `info` +a `SDPInfo` + +# Returns + +TRUE on success. + +Suspend `self`. The state of the pipeline managed by `self` is set to +GST_STATE_NULL but all streams are kept. `self` can be prepared again +with `RTSPMediaExt::unsuspend` + +`self` must be prepared with `RTSPMediaExt::prepare`; + +# Returns + +`true` on success. + +Set `pipeline` as the `gst::Pipeline` for `self`. Ownership is +taken of `pipeline`. +## `pipeline` +a `gst::Pipeline` + +Unprepare `self`. 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. + +Unsuspend `self` if it was in a suspended state. This method does nothing +when the media was not in the suspended state. + +# Returns + +`true` on success. + +Set `self` to provide a `gst_net::NetTimeProvider`. +## `time_provider` +if a `gst_net::NetTimeProvider` should be used + +The definition and logic for constructing the pipeline for a media. The media +can contain multiple streams like audio and video. + +# Implements + +[`RTSPMediaFactoryExt`](trait.RTSPMediaFactoryExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPMediaFactory` methods. + +# Implementors + +[`RTSPMediaFactoryURI`](struct.RTSPMediaFactoryURI.html), [`RTSPMediaFactory`](struct.RTSPMediaFactory.html) + +Create a new `RTSPMediaFactory` instance. + +# Returns + +a new `RTSPMediaFactory` object. + +A convenience method to add `role` with `fieldname` and additional arguments to +the permissions of `self`. If `self` had no permissions, new permissions +will be created and the role will be added to it. +## `role` +a role +## `fieldname` +the first field name + +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 (). +## `url` +the url used + +# Returns + +a new `RTSPMedia` if the media could be prepared. + +Construct and return a `gst::Element` that is a `gst::Bin` 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. +## `url` +the url used + +# Returns + +a new `gst::Element`. + +Get the `RTSPAddressPool` used as the address pool of `self`. + +# Returns + +the `RTSPAddressPool` of `self`. `gobject::ObjectExt::unref` after +usage. + +Get the kernel UDP buffer size. + +# Returns + +the kernel UDP buffer size. + +Returns the clock that is going to be used by the pipelines +of all medias created from this factory. + +# Returns + +The GstClock + +Get the latency that is used for receiving media + +# Returns + +latency in milliseconds + +Get the `gst_parse_launch` pipeline description that will be used in the +default prepare vmethod. + +# Returns + +the configured launch description. `g_free` after +usage. + +Return the GType of the GstRTSPMedia subclass this +factory will create. + +Get the multicast interface used for `self`. + +# Returns + +the multicast interface for `self`. `g_free` after +usage. + +Get the permissions object from `self`. + +# Returns + +a `RTSPPermissions` object, unref after usage. + +Get the allowed profiles of `self`. + +# Returns + +a `gst_rtsp::RTSPProfile` + +Get the allowed protocols of `self`. + +# Returns + +a `gst_rtsp::RTSPLowerTrans` + +Gets if and how the media clock should be published according to RFC7273. + +# Returns + +The GstRTSPPublishClockMode + +Get the time that is stored for retransmission purposes + +# Returns + +a `gst::ClockTime` + +Get how media created from this factory will be suspended. + +# Returns + +a `RTSPSuspendMode`. + +Get if media created from this factory can be used for PLAY or RECORD +methods. + +# Returns + +The supported transport modes. + +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. + +Get if media created from this factory can be shared between clients. + +# Returns + +`true` if the media will be shared between clients. + +configure `pool` to be used as the address pool of `self`. +## `pool` +a `RTSPAddressPool` + +Set the kernel UDP buffer size. +## `size` +the new value + +Configures a specific clock to be used by the pipelines +of all medias created from this factory. +## `clock` +the clock to be used by the media factory + +Configure if media created from this factory will have an EOS sent to the +pipeline before shutdown. +## `eos_shutdown` +the new value + +Configure the latency used for receiving media +## `latency` +latency in milliseconds + +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 description with brackets '(' +')'. + +The description should return a pipeline with payloaders named pay0, pay1, +etc.. Each of the payloaders will result in a stream. +## `launch` +the launch description + +Configure the GType of the GstRTSPMedia subclass to +create (by default, overridden construct vmethods +may of course do something different) +## `media_gtype` +the GType of the class to create + +configure `multicast_iface` to be used for `self`. +## `multicast_iface` +a multicast interface name + +Set `permissions` on `self`. +## `permissions` +a `RTSPPermissions` + +Configure the allowed profiles for `self`. +## `profiles` +the new flags + +Configure the allowed lower transport for `self`. +## `protocols` +the new flags + +Sets if and how the media clock should be published according to RFC7273. +## `mode` +the clock publish mode + +Configure the time to store for possible retransmission +## `time` +a `gst::ClockTime` + +Configure if media created from this factory can be shared between clients. +## `shared` +the new value + +Configure if media created from this factory should be stopped +when a client disconnects without sending TEARDOWN. +## `stop_on_disconnect` +the new value + +Configure how media created from this factory will be suspended. +## `mode` +the new `RTSPSuspendMode` + +Configure if this factory creates media for PLAY or RECORD modes. +## `mode` +the new value + +A media factory that creates a pipeline to play and uri. + +# Implements + +[`RTSPMediaFactoryURIExt`](trait.RTSPMediaFactoryURIExt.html), [`RTSPMediaFactoryExt`](trait.RTSPMediaFactoryExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPMediaFactoryURI` methods. + +# Implementors + +[`RTSPMediaFactoryURI`](struct.RTSPMediaFactoryURI.html) + +Create a new `RTSPMediaFactoryURI` instance. + +# Returns + +a new `RTSPMediaFactoryURI` object. + +Get the URI that will provide media for this factory. + +# Returns + +the configured URI. `g_free` after usage. + +Set the URI of the resource that will be streamed by this factory. +## `uri` +the uri the stream + +The state of the media pipeline. + +media pipeline not prerolled + +media pipeline is busy doing a clean + shutdown. + +media pipeline is prerolling + +media pipeline is prerolled + +media is suspended + +media pipeline is in error + +Creates a `RTSPMediaFactory` object for a given url. + +# Implements + +[`RTSPMountPointsExt`](trait.RTSPMountPointsExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPMountPoints` methods. + +# Implementors + +[`RTSPMountPoints`](struct.RTSPMountPoints.html) + +Make a new mount points object. + +# Returns + +a new `RTSPMountPoints` + +Attach `factory` to the mount point `path` in `self`. + +`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. +## `path` +a mount point +## `factory` +a `RTSPMediaFactory` + +Make a path string from `url`. +## `url` +a `gst_rtsp::RTSPUrl` + +# Returns + +a path string for `url`, `g_free` after usage. + +Find the factory in `self` that has the longest match with `path`. + +If `matched` is `None`, `path` will match the factory exactly otherwise +the amount of characters that matched is returned in `matched`. +## `path` +a mount point +## `matched` +the amount of `path` matched + +# Returns + +the `RTSPMediaFactory` for `path`. +`gobject::ObjectExt::unref` after usage. + +Remove the `RTSPMediaFactory` associated with `path` in `self`. +## `path` +a mount point + +Whether the clock and possibly RTP/clock offset should be published according to RFC7273. + +Publish nothing + +Publish the clock but not the offset + +Publish the clock and offset + +This object listens on a port, creates and manages the clients connected to +it. + +# Implements + +[`RTSPServerExt`](trait.RTSPServerExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPServer` methods. + +# Implementors + +[`RTSPServer`](struct.RTSPServer.html) + +Create a new `RTSPServer` instance. + +# Returns + +a new `RTSPServer` + +A default `GSocketSourceFunc` that creates a new `RTSPClient` to accept and handle a +new connection on `socket` or `server`. +## `socket` +a `gio::Socket` +## `condition` +the condition on `source` +## `server` +a `RTSPServer` + +# Returns + +TRUE if the source could be connected, FALSE if an error occurred. + +Attaches `self` to `context`. When the mainloop for `context` is run, the +server will be dispatched. When `context` is `None`, 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. + +This takes a reference on `self` until the source is destroyed. Note that +if `context` is not the default main context as returned by +`glib::MainContext::default` (or `None`), `glib::Source::remove` cannot be used to +destroy the source. In that case it is recommended to use +`RTSPServerExt::create_source` and attach it to `context` manually. +## `context` +a `glib::MainContext` + +# Returns + +the ID (greater than 0) for the source within the GMainContext. + +Call `func` for each client managed by `self`. The result value of `func` +determines what happens to the client. `func` will be called with `self` +locked so no further actions on `self` can be performed from `func`. + +If `func` returns `RTSPFilterResult::Remove`, the client will be removed from +`self`. + +If `func` returns `RTSPFilterResult::Keep`, the client will remain in `self`. + +If `func` returns `RTSPFilterResult::Ref`, the client will remain in `self` but +will also be added with an additional ref to the result `glib::List` of this +function.. + +When `func` is `None`, `RTSPFilterResult::Ref` will be assumed for each client. +## `func` +a callback +## `user_data` +user data passed to `func` + +# Returns + +a `glib::List` with all +clients for which `func` returned `RTSPFilterResult::Ref`. After usage, each +element in the `glib::List` should be unreffed before the list is freed. + +Create a `gio::Socket` for `self`. The socket will listen on the +configured service. +## `cancellable` +a `gio::Cancellable` + +# Returns + +the `gio::Socket` for `self` or `None` when an error +occurred. + +Create a `glib::Source` for `self`. The new source will have a default +`GSocketSourceFunc` of `RTSPServer::io_func`. + +`cancellable` if not `None` 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 `gio::CancellableExt::is_cancelled`. + +This takes a reference on `self` until `source` is destroyed. +## `cancellable` +a `gio::Cancellable` or `None`. + +# Returns + +the `glib::Source` for `self` or `None` when an error +occurred. Free with g_source_unref () + +Get the address on which the server will accept connections. + +# Returns + +the server address. `g_free` after usage. + +Get the `RTSPAuth` used as the authentication manager of `self`. + +# Returns + +the `RTSPAuth` of `self`. `gobject::ObjectExt::unref` after +usage. + +The maximum amount of queued requests for the server. + +# Returns + +the server backlog. + +Get the port number where the server was bound to. + +# Returns + +the port number + +Get the `RTSPMountPoints` used as the mount points of `self`. + +# Returns + +the `RTSPMountPoints` of `self`. `gobject::ObjectExt::unref` after +usage. + +Get the service on which the server will accept connections. + +# Returns + +the service. use `g_free` after usage. + +Get the `RTSPSessionPool` used as the session pool of `self`. + +# Returns + +the `RTSPSessionPool` used for sessions. `gobject::ObjectExt::unref` after +usage. + +Get the `RTSPThreadPool` used as the thread pool of `self`. + +# Returns + +the `RTSPThreadPool` of `self`. `gobject::ObjectExt::unref` after +usage. + +Configure `self` to accept connections on the given address. + +This function must be called before the server is bound. +## `address` +the address + +configure `auth` to be used as the authentication manager of `self`. +## `auth` +a `RTSPAuth` + +configure the maximum amount of requests that may be queued for the +server. + +This function must be called before the server is bound. +## `backlog` +the backlog + +configure `mounts` to be used as the mount points of `self`. +## `mounts` +a `RTSPMountPoints` + +Configure `self` 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 +`RTSPServerExt::get_bound_port`. + +This function must be called before the server is bound. +## `service` +the service + +configure `pool` to be used as the session pool of `self`. +## `pool` +a `RTSPSessionPool` + +configure `pool` to be used as the thread pool of `self`. +## `pool` +a `RTSPThreadPool` + +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. +## `socket` +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 + +# Returns + +TRUE if all was ok, FALSE if an error occurred. + +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. + +# Implements + +[`RTSPSessionExt`](trait.RTSPSessionExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPSession` methods. + +# Implementors + +[`RTSPSession`](struct.RTSPSession.html) + +Create a new `RTSPSession` instance with `sessionid`. +## `sessionid` +a session id + +# Returns + +a new `RTSPSession` + +Allow `self` to expire. This method must be called an equal +amount of time as `RTSPSessionExt::prevent_expire`. + +Call `func` for each media in `self`. The result value of `func` determines +what happens to the media. `func` will be called with `self` +locked so no further actions on `self` can be performed from `func`. + +If `func` returns `RTSPFilterResult::Remove`, the media will be removed from +`self`. + +If `func` returns `RTSPFilterResult::Keep`, the media will remain in `self`. + +If `func` returns `RTSPFilterResult::Ref`, the media will remain in `self` but +will also be added with an additional ref to the result `glib::List` of this +function.. + +When `func` is `None`, `RTSPFilterResult::Ref` will be assumed for all media. +## `func` +a callback +## `user_data` +user data passed to `func` + +# Returns + +a GList with all +media for which `func` returned `RTSPFilterResult::Ref`. After usage, each +element in the `glib::List` should be unreffed before the list is freed. + +Get the string that can be placed in the Session header field. + +# Returns + +the Session header of `self`. +`g_free` after usage. + +Get the session media for `path`. `matched` will contain the number of matched +characters of `path`. +## `path` +the path for the media +## `matched` +the amount of matched characters + +# Returns + +the configuration for `path` in `self`. + +Get the sessionid of `self`. + +# Returns + +the sessionid of `self`. +The value remains valid as long as `self` is alive. + +Get the timeout value of `self`. + +# Returns + +the timeout of `self` in seconds. + +Check if `self` timeout out. + +# Deprecated + +Use `RTSPSessionExt::is_expired_usec` instead. +## `now` +the current system time + +# Returns + +`true` if `self` timed out + +Check if `self` timeout out. +## `now` +the current monotonic time + +# Returns + +`true` if `self` timed out + +Manage the media object `obj` in `self`. `path` will be used to retrieve this +media from the session with `RTSPSessionExt::get_media`. + +Ownership is taken from `media`. +## `path` +the path for the media +## `media` +a `RTSPMedia` + +# Returns + +a new `RTSPSessionMedia` object. + +Get the amount of milliseconds till the session will expire. + +# Deprecated + +Use `RTSPSessionExt::next_timeout_usec` instead. +## `now` +the current system time + +# Returns + +the amount of milliseconds since the session will time out. + +Get the amount of milliseconds till the session will expire. +## `now` +the current monotonic time + +# Returns + +the amount of milliseconds since the session will time out. + +Prevent `self` from expiring. + +Release the managed `media` in `self`, freeing the memory allocated by it. +## `media` +a `RTSPMedia` + +# Returns + +`true` if there are more media session left in `self`. + +Configure `self` for a timeout of `timeout` seconds. The session will be +cleaned up when there is no activity for `timeout` seconds. +## `timeout` +the new timeout + +Update the last_access time of the session to the current time. + +State of a client session regarding a specific media identified by path. + +# Implements + +[`RTSPSessionMediaExt`](trait.RTSPSessionMediaExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPSessionMedia` methods. + +# Implementors + +[`RTSPSessionMedia`](struct.RTSPSessionMedia.html) + +Create a new `RTSPSessionMedia` that manages the streams +in `media` for `path`. `media` should be prepared. + +Ownership is taken of `media`. +## `path` +the path +## `media` +the `RTSPMedia` + +# Returns + +a new `RTSPSessionMedia`. + +Fill `range` with the next available min and max channels for +interleaved transport. +## `range` +a `gst_rtsp::RTSPRange` + +# Returns + +`true` on success. + +Get the base_time of the `RTSPMedia` in `self` + +# Returns + +the base_time of the media. + +Get the `RTSPMedia` that was used when constructing `self` + +# Returns + +the `RTSPMedia` of `self`. +Remains valid as long as `self` is valid. + +Retrieve the RTP-Info header string for all streams in `self` +with configured transports. + +# Returns + +The RTP-Info as a string or +`None` when no RTP-Info could be generated, `g_free` after usage. + +Get the current RTSP state of `self`. + +# Returns + +the current RTSP state of `self`. + +Get a previously created `RTSPStreamTransport` for the stream at `idx`. +## `idx` +the stream index + +# Returns + +a `RTSPStreamTransport` that is +valid until the session of `self` is unreffed. + +Check if the path of `self` matches `path`. It `path` matches, the amount of +matched characters is returned in `matched`. +## `path` +a path +## `matched` +the amount of matched characters of `path` + +# Returns + +`true` when `path` matches the path of `self`. + +Set the RTSP state of `self` to `state`. +## `state` +a `gst_rtsp::RTSPState` + +Tell the media object `self` to change to `state`. +## `state` +the new state + +# Returns + +`true` on success. + +Configure the transport for `stream` to `tr` in `self`. +## `stream` +a `RTSPStream` +## `tr` +a `gst_rtsp::RTSPTransport` + +# Returns + +the new or updated `RTSPStreamTransport` for `stream`. + +An object that keeps track of the active sessions. This object is usually +attached to a `RTSPServer` object to manage the sessions in that server. + +# Implements + +[`RTSPSessionPoolExt`](trait.RTSPSessionPoolExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPSessionPool` methods. + +# Implementors + +[`RTSPSessionPool`](struct.RTSPSessionPool.html) + +Create a new `RTSPSessionPool` instance. + +# Returns + +A new `RTSPSessionPool`. `gobject::ObjectExt::unref` after +usage. + +Inspect all the sessions in `self` and remove the sessions that are inactive +for more than their timeout. + +# Returns + +the amount of sessions that got removed. + +Create a new `RTSPSession` object in `self`. + +# Returns + +a new `RTSPSession`. + +Create a `glib::Source` that will be dispatched when the session should be cleaned +up. + +# Returns + +a `glib::Source` + +Call `func` for each session in `self`. 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 `self` can be performed from `func`. + +If `func` returns `RTSPFilterResult::Remove`, the session will be set to the +expired state with `gst_rtsp_session_set_expired` and removed from +`self`. + +If `func` returns `RTSPFilterResult::Keep`, the session will remain in `self`. + +If `func` returns `RTSPFilterResult::Ref`, the session will remain in `self` but +will also be added with an additional ref to the result GList of this +function.. + +When `func` is `None`, `RTSPFilterResult::Ref` will be assumed for all sessions. +## `func` +a callback +## `user_data` +user data passed to `func` + +# Returns + +a GList with all +sessions for which `func` returned `RTSPFilterResult::Ref`. After usage, each +element in the GList should be unreffed before the list is freed. + +Find the session with `sessionid` in `self`. The access time of the session +will be updated with `RTSPSessionExt::touch`. +## `sessionid` +the session id + +# Returns + +the `RTSPSession` with `sessionid` +or `None` when the session did not exist. `gobject::ObjectExt::unref` after usage. + +Get the maximum allowed number of sessions in `self`. 0 means an unlimited +amount of sessions. + +# Returns + +the maximum allowed number of sessions. + +Get the amount of active sessions in `self`. + +# Returns + +the amount of active sessions in `self`. + +Remove `sess` from `self`, releasing the ref that the pool has on `sess`. +## `sess` +a `RTSPSession` + +# Returns + +`true` if the session was found and removed. + +Configure the maximum allowed number of sessions in `self` to `max`. +A value of 0 means an unlimited amount of sessions. +## `max` +the maximum number of sessions + +The definition of a media stream. + +# Implements + +[`RTSPStreamExt`](trait.RTSPStreamExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPStream` methods. + +# Implementors + +[`RTSPStream`](struct.RTSPStream.html) + +Create a new media stream with index `idx` that handles RTP data on +`pad` and has a payloader element `payloader` if `pad` is a source pad +or a depayloader element `payloader` if `pad` is a sink pad. +## `idx` +an index +## `payloader` +a `gst::Element` +## `pad` +a `gst::Pad` + +# Returns + +a new `RTSPStream` + +Add the transport in `trans` to `self`. The media of `self` will +then also be send to the values configured in `trans`. + +`self` must be joined to a bin. + +`trans` must contain a valid `gst_rtsp::RTSPTransport`. +## `trans` +a `RTSPStreamTransport` + +# Returns + +`true` if `trans` was added + +Allocates RTP and RTCP ports. + +# Deprecated + +This function shouldn't have been made public +## `family` +protocol family +## `transport` +transport method +## `use_client_setttings` +Whether to use client settings or not + +# Returns + +`true` if the RTP and RTCP sockets have been succeccully allocated. + +Get the `RTSPAddressPool` used as the address pool of `self`. + +# Returns + +the `RTSPAddressPool` of `self`. +`gobject::ObjectExt::unref` after usage. + +Get the size of the UDP transmission buffer (in bytes) + +# Returns + +the size of the UDP TX buffer + +Retrieve the current caps of `self`. + +# Returns + +the `gst::Caps` of `self`. +use `gst_caps_unref` after usage. + +Get the control string to identify this stream. + +# Returns + +the control string. `g_free` after usage. + +Get the configured DSCP QoS in of the outgoing sockets. + +# Returns + +the DSCP QoS value of the outgoing sockets, or -1 if disbled. + +Get the stream index. + +# Returns + +the stream index. + +Get the previous joined bin with `RTSPStreamExt::join_bin` or NULL. + +# Returns + +the joined bin or NULL. + +Get the configured MTU in the payloader of `self`. + +# Returns + +the MTU of the payloader. + +Get the multicast address of `self` for `family`. The original +`RTSPAddress` is cached and copy is returned, so freeing the return value +won't release the address from the pool. +## `family` +the `gio::SocketFamily` + +# Returns + +the `RTSPAddress` of `self` +or `None` when no address could be allocated. `RTSPAddress::free` +after usage. + +Get the multicast interface used for `self`. + +# Returns + +the multicast interface for `self`. +`g_free` after usage. + +Get the allowed profiles of `self`. + +# Returns + +a `gst_rtsp::RTSPProfile` + +Get the allowed protocols of `self`. + +# Returns + +a `gst_rtsp::RTSPLowerTrans` + +Get the stream payload type. + +# Returns + +the stream payload type. + +Gets if and how the stream clock should be published according to RFC7273. + +# Returns + +The GstRTSPPublishClockMode + +Get the payload-type used for retransmission of this stream + +# Returns + +The retransmission PT. + +Get the amount of time to store retransmission data. + +# Returns + +the amount of time to store retransmission data. + +Get the RTCP socket from `self` for a `family`. + +`self` must be joined to a bin. +## `family` +the socket family + +# Returns + +the RTCP socket or `None` if no +socket could be allocated for `family`. Unref after usage + +Get the RTP socket from `self` for a `family`. + +`self` must be joined to a bin. +## `family` +the socket family + +# Returns + +the RTP socket or `None` if no +socket could be allocated for `family`. Unref after usage + +Retrieve the current rtptime, seq and running-time. This is used to +construct a RTPInfo reply header. +## `rtptime` +result RTP timestamp +## `seq` +result RTP seqnum +## `clock_rate` +the clock rate +## `running_time` +result running-time + +# Returns + +`true` when rtptime, seq and running-time could be determined. + +Get the RTP session of this stream. + +# Returns + +The RTP session of this stream. Unref after usage. + +Fill `server_port` with the port pair used by the server. This function can +only be called when `self` has been joined. +## `server_port` +result server port +## `family` +the port family to get + +Get the sinkpad associated with `self`. + +# Returns + +the sinkpad. Unref after usage. + +Get the srcpad associated with `self`. + +# Returns + +the srcpad. Unref after usage. + +Get the SRTP encoder for this stream. + +# Returns + +The SRTP encoder for this stream. Unref after usage. + +Get the SSRC used by the RTP session of this stream. This function can only +be called when `self` has been joined. +## `ssrc` +result ssrc + +Check if `self` has the control string `control`. +## `control` +a control string + +# Returns + +`true` is `self` has `control` as the control string + +Check if `self` is blocking on a `gst::Buffer`. + +# Returns + +`true` if `self` is blocking + +See `RTSPStreamExt::set_client_side` + +# Returns + +TRUE if this `RTSPStream` is client-side. + +Check if `transport` can be handled by stream +## `transport` +a `gst_rtsp::RTSPTransport` + +# Returns + +`true` if `transport` can be handled by `self`. + +Join the `gst::Bin` `bin` that contains the element `rtpbin`. + +`self` will link to `rtpbin`, which must be inside `bin`. The elements +added to `bin` will be set to the state given in `state`. +## `bin` +a `gst::Bin` to join +## `rtpbin` +a rtpbin element in `bin` +## `state` +the target state of the new elements + +# Returns + +`true` on success. + +Remove the elements of `self` from `bin`. +## `bin` +a `gst::Bin` +## `rtpbin` +a rtpbin `gst::Element` + +# Returns + +`true` on success. + +Query the position of the stream in `gst::Format::Time`. This only considers +the RTP parts of the pipeline and not the RTCP parts. +## `position` +current position of a `RTSPStream` + +# Returns + +`true` if the position could be queried + +Query the stop of the stream in `gst::Format::Time`. This only considers +the RTP parts of the pipeline and not the RTCP parts. +## `stop` +current stop of a `RTSPStream` + +# Returns + +`true` if the stop could be queried + +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`. +## `buffer` +a `gst::Buffer` + +# Returns + +a GstFlowReturn. + +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`. +## `buffer` +a `gst::Buffer` + +# Returns + +a GstFlowReturn. + +Remove the transport in `trans` from `self`. The media of `self` will +not be sent to the values configured in `trans`. + +`self` must be joined to a bin. + +`trans` must contain a valid `gst_rtsp::RTSPTransport`. +## `trans` +a `RTSPStreamTransport` + +# Returns + +`true` if `trans` was removed + +Creating a rtxsend bin +## `sessid` +the session id + +# Returns + +a `gst::Element`. + +Reserve `address` and `port` as the address and port of `self`. The original +`RTSPAddress` is cached and copy is returned, so freeing the return value +won't release the address from the pool. +## `address` +an address +## `port` +a port +## `n_ports` +n_ports +## `ttl` +a TTL + +# Returns + +the `RTSPAddress` of `self` or `None` when +the address could be reserved. `RTSPAddress::free` after usage. + +configure `pool` to be used as the address pool of `self`. +## `pool` +a `RTSPAddressPool` + +Blocks or unblocks the dataflow on `self`. +## `blocked` +boolean indicating we should block or unblock + +# Returns + +`true` on success + +Set the size of the UDP transmission buffer (in bytes) +Needs to be set before the stream is joined to a bin. +## `size` +the buffer size + +Sets the `RTSPStream` as a 'client side' stream - used for sending +streams to an RTSP server via RECORD. This has the practical effect +of changing which UDP port numbers are used when setting up the local +side of the stream sending to be either the 'server' or 'client' pair +of a configured UDP transport. +## `client_side` +TRUE if this `RTSPStream` is running on the 'client' side of +an RTSP connection. + +Set the control string in `self`. +## `control` +a control string + +Configure the dscp qos of the outgoing sockets to `dscp_qos`. +## `dscp_qos` +a new dscp qos value (0-63, or -1 to disable) + +Configure the mtu in the payloader of `self` to `mtu`. +## `mtu` +a new MTU + +configure `multicast_iface` to be used for `self`. +## `multicast_iface` +a multicast interface name + +Configure the allowed profiles for `self`. +## `profiles` +the new profiles + +Configure the allowed lower transport for `self`. +## `protocols` +the new flags + +Configure a pt map between `pt` and `caps`. +## `pt` +the pt +## `caps` +a `gst::Caps` + +Sets if and how the stream clock should be published according to RFC7273. +## `mode` +the clock publish mode + +Set the payload type (pt) for retransmission of this stream. +## `rtx_pt` +a `guint` + +Set the amount of time to store retransmission packets. +## `time` +a `gst::ClockTime` + +Call `func` for each transport managed by `self`. The result value of `func` +determines what happens to the transport. `func` will be called with `self` +locked so no further actions on `self` can be performed from `func`. + +If `func` returns `RTSPFilterResult::Remove`, the transport will be removed from +`self`. + +If `func` returns `RTSPFilterResult::Keep`, the transport will remain in `self`. + +If `func` returns `RTSPFilterResult::Ref`, the transport will remain in `self` but +will also be added with an additional ref to the result `glib::List` of this +function.. + +When `func` is `None`, `RTSPFilterResult::Ref` will be assumed for each transport. +## `func` +a callback +## `user_data` +user data passed to `func` + +# Returns + +a `glib::List` with all +transports for which `func` returned `RTSPFilterResult::Ref`. After usage, each +element in the `glib::List` should be unreffed before the list is freed. + +Update the new crypto information for `ssrc` in `self`. If information +for `ssrc` did not exist, it will be added. If information +for `ssrc` existed, it will be replaced. If `crypto` is `None`, it will +be removed from `self`. +## `ssrc` +the SSRC +## `crypto` +a `gst::Caps` with crypto info + +# Returns + +`true` if `crypto` could be updated + +A Transport description for a stream + +# Implements + +[`RTSPStreamTransportExt`](trait.RTSPStreamTransportExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPStreamTransport` methods. + +# Implementors + +[`RTSPStreamTransport`](struct.RTSPStreamTransport.html) + +Create a new `RTSPStreamTransport` that can be used to manage +`stream` with transport `tr`. +## `stream` +a `RTSPStream` +## `tr` +a GstRTSPTransport + +# Returns + +a new `RTSPStreamTransport` + +Get the RTP-Info string for `self` and `start_time`. +## `start_time` +a star time + +# Returns + +the RTPInfo string for `self` +and `start_time` or `None` when the RTP-Info could not be +determined. `g_free` after usage. + +Get the `RTSPStream` used when constructing `self`. + +# Returns + +the stream used when constructing `self`. + +Get the transport configured in `self`. + +# Returns + +the transport configured in `self`. It remains +valid for as long as `self` is valid. + +Get the url configured in `self`. + +# Returns + +the url configured in `self`. +It remains valid for as long as `self` is valid. + +Check if `self` is timed out. + +# Returns + +`true` if `self` timed out. + +Signal the installed keep_alive callback for `self`. + +Receive `buffer` on `channel` `self`. +## `channel` +a channel +## `buffer` +a `gst::Buffer` + +# Returns + +a `gst::FlowReturn`. Returns GST_FLOW_NOT_LINKED when `channel` is not + configured in the transport of `self`. + +Send `buffer` to the installed RTCP callback for `self`. +## `buffer` +a `gst::Buffer` + +# Returns + +`true` on success + +Send `buffer` to the installed RTP callback for `self`. +## `buffer` +a `gst::Buffer` + +# Returns + +`true` on success + +Activate or deactivate datatransfer configured in `self`. +## `active` +new state of `self` + +# Returns + +`true` when the state was changed. + +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. +## `send_rtp` +a callback called when RTP should be sent +## `send_rtcp` +a callback called when RTCP should be sent +## `user_data` +user data passed to callbacks +## `notify` +called with the user_data when no longer needed. + +Install callbacks that will be called when RTCP packets are received from the +receiver of `self`. +## `keep_alive` +a callback called when the receiver is active +## `user_data` +user data passed to callback +## `notify` +called with the user_data when no longer needed. + +Set the timed out state of `self` to `timedout` +## `timedout` +timed out value + +Set `tr` as the client transport. This function takes ownership of the +passed `tr`. +## `tr` +a client `gst_rtsp::RTSPTransport` + +Set `url` as the client url. +## `url` +a client `gst_rtsp::RTSPUrl` + +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. + +Media is not suspended + +Media is PAUSED in suspend + +The media is set to NULL when suspended + +The thread pool structure. + +# Implements + +[`RTSPThreadPoolExt`](trait.RTSPThreadPoolExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) + +Trait containing all `RTSPThreadPool` methods. + +# Implementors + +[`RTSPThreadPool`](struct.RTSPThreadPool.html) + +Create a new `RTSPThreadPool` instance. + +# Returns + +a new `RTSPThreadPool` + +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. + +Get the maximum number of threads used for client connections. +See `RTSPThreadPoolExt::set_max_threads`. + +# Returns + +the maximum number of threads. + +Get a new `RTSPThread` for `type_` and `ctx`. +## `type_` +the `RTSPThreadType` +## `ctx` +a `RTSPContext` + +# Returns + +a new `RTSPThread`, +`RTSPThread::stop` after usage + +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. +## `max_threads` +maximum threads + +Different thread types + +a thread to handle the client communication + +a thread to handle media diff --git a/docs/gstreamer-rtsp/docs.md b/docs/gstreamer-rtsp/docs.md new file mode 100644 index 000000000..4f18e3cc7 --- /dev/null +++ b/docs/gstreamer-rtsp/docs.md @@ -0,0 +1,172 @@ + + +Authentication methods, ordered by strength + +no authentication + +basic authentication + +digest authentication + + +The possible network families. + +unknown network family + +internet + +internet V6 + +Enumeration of rtsp header fields + +The type of a message. + +invalid message type + +RTSP request message + +RTSP response message + +HTTP request message. + +HTTP response message. + +data message + +Different possible time range units. + +SMPTE timecode + +29.97 frames per second + +25 frames per second + +Normal play time + +Absolute time expressed as ISO 8601 timestamps + +Result codes from the RTSP functions. + +no error + +some unspecified error occured + +invalid arguments were provided to a function + +an operation was canceled + +no memory was available for the operation + +a host resolve error occured + +function not implemented + +a system error occured, errno contains more details + +a persing error occured + +windows networking could not start + +windows networking stack has wrong version + +end-of-file was reached + +a network problem occured, h_errno contains more details + +the host is not an IP host + +a timeout occured + +the tunnel GET request has been performed + +the tunnel POST request has been performed + +last error + +The different RTSP states. + +invalid state + +initializing + +ready for operation + +seeking in progress + +playing + +recording + +Enumeration of rtsp status codes + +Possible time types. + +seconds + +now + +end + +frames and subframes + +UTC time + +Provides helper functions to handle RTSP urls. + +Make a copy of `self`. + +# Returns + +a copy of `self`. Free with gst_rtsp_url_free () after usage. + +Splits the path of `self` on '/' boundaries, decoding the resulting components, + +The decoding performed by this routine is "URI decoding", as defined in RFC +3986, commonly known as percent-decoding. For example, a string "foo\%2fbar" +will decode to "foo/bar" -- the \%2f being replaced by the corresponding byte +with hex value 0x2f. Note that there is no guarantee that the resulting byte +sequence is valid in any given encoding. As a special case, \%00 is not +unescaped to NUL, as that would prematurely terminate the string. + +Also note that since paths usually start with a slash, the first component +will usually be the empty string. + +# Returns + +`None`-terminated array of URL components. Free with +`g_strfreev` when no longer needed. + +Free the memory used by `self`. + +Get the port number of `self`. +## `port` +location to hold the port + +# Returns + +`RTSPResult::Ok`. + +Get a newly allocated string describing the request URI for `self`. + +# Returns + +a string with the request URI. `g_free` after usage. + +Set the port number in `self` to `port`. +## `port` +the port + +# Returns + +`RTSPResult::Ok`. + +Parse the RTSP `urlstr` into a newly allocated `RTSPUrl`. Free after usage +with `RTSPUrl::free`. +## `urlstr` +the url string to parse +## `url` +location to hold the result. + +# Returns + +a `RTSPResult`. diff --git a/docs/gstreamer-sdp/docs.md b/docs/gstreamer-sdp/docs.md new file mode 100644 index 000000000..19d475bf0 --- /dev/null +++ b/docs/gstreamer-sdp/docs.md @@ -0,0 +1,139 @@ + + +The different cache types + +The envelope key MUST NOT be cached + +The envelope key MUST be cached + +The envelope key MUST be cached, but only + to be used for the specific CSB. + +The encryption algorithm used to encrypt the Encr data field + +no encryption + +AES-CM using a 128-bit key + +AES Key Wrap using a 128-bit key + +The key validity type + +No specific usage rule + +The key is associated with the SPI/MKI + +The key has a start and expiration time + +The type of key. + +a TEK Generation Key + +Traffic-Encrypting Key + +Specifies the authentication algorithm used + +no authentication + +HMAC-SHA-1-160 + +Specifies the method of uniquely mapping Crypto Sessions to the security +protocol sessions. + +The PRF function that has been/will be used for key derivation + +MIKEY-1 PRF function + +Different MIKEY Payload types. + +Last payload + +Key data transport payload + +Envelope data payload + +DH data payload + +Signature payload + +Timestamp payload + +ID payload + +Certificate Payload + +Cert hash payload + +Verfication message payload + +Security Policy payload + +RAND payload + +Error payload + +Key data sub-payload + +General Extension Payload + +Specifies the security protocol + +This policy specifies the parameters for SRTP and SRTCP + +Encryption algorithm + +Session Encr. key length + +Authentication algorithm + +Session Auth. key length + +Session Salt key length + +SRTP Pseudo Random Function + +Key derivation rate + +SRTP encryption off/on, 0 if off, 1 if on + +SRTCP encryption off/on, 0 if off, 1 if on + +sender's FEC order + +SRTP authentication off/on, 0 if off, 1 if on + +Authentication tag length + +SRTP prefix length + +Specifies the timestamp type. + +an NTP time in UTC timezone + +an NTP time + +a counter + +Different MIKEY data types. + +Invalid type + +Initiator's pre-shared key message + +Verification message of a Pre-shared key message + +Initiator's public-key transport message + +Verification message of a public-key message + +Initiator's DH exchange message + +Responder's DH exchange message + +Error message + +Return values for the SDP functions. + +A successful return value + +a function was given invalid parameters diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 51e104589..dcacdd350 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -10,6 +10,7 @@ gstreamer-app = { path = "../gstreamer-app" } gstreamer-audio = { path = "../gstreamer-audio" } gstreamer-video = { path = "../gstreamer-video" } gstreamer-player = { path = "../gstreamer-player", optional = true } +gstreamer-rtsp-server = { path = "../gstreamer-rtsp-server", optional = true } gtk = { git = "https://github.com/gtk-rs/gtk", features = ["v3_6"], optional = true } gdk = { git = "https://github.com/gtk-rs/gdk", optional = true } gio = { git = "https://github.com/gtk-rs/gio", optional = true } @@ -27,6 +28,7 @@ gtkvideooverlay = ["gtk", "gdk", "gio"] gtkvideooverlay-x11 = ["gtkvideooverlay"] gtkvideooverlay-quartz = ["gtkvideooverlay"] tokio = ["gstreamer/futures", "futures", "tokio-core"] +gst-rtsp-server = ["gstreamer-rtsp-server"] default-features = [] v1_10 = ["gstreamer/v1_10"] diff --git a/examples/src/bin/rtsp-server.rs b/examples/src/bin/rtsp-server.rs new file mode 100644 index 000000000..6a40c6246 --- /dev/null +++ b/examples/src/bin/rtsp-server.rs @@ -0,0 +1,78 @@ +#[cfg(feature = "gst-rtsp-server")] +use std::env; + +extern crate gstreamer as gst; + +#[cfg(feature = "gst-rtsp-server")] +extern crate gstreamer_rtsp_server as gst_rtsp_server; +#[cfg(feature = "gst-rtsp-server")] +use gst_rtsp_server::prelude::*; + +extern crate glib; + +extern crate failure; +use failure::Error; + +#[cfg(feature = "gst-rtsp-server")] +#[macro_use] +extern crate failure_derive; + +#[path = "../examples-common.rs"] +mod examples_common; + +#[derive(Debug, Fail)] +#[fail(display = "Could not get mount points")] +#[cfg(feature = "gst-rtsp-server")] +struct NoMountPoints; + +#[derive(Debug, Fail)] +#[fail(display = "Usage: {} LAUNCH_LINE", _0)] +#[cfg(feature = "gst-rtsp-server")] +struct UsageError(String); + +#[cfg(feature = "gst-rtsp-server")] +fn main_loop() -> Result<(), Error> { + let args: Vec<_> = env::args().collect(); + + if args.len() != 2 { + return Err(Error::from(UsageError(args[0].clone()))); + } + + let main_loop = glib::MainLoop::new(None, false); + let server = gst_rtsp_server::RTSPServer::new(); + let factory = gst_rtsp_server::RTSPMediaFactory::new(); + let mounts = server.get_mount_points().ok_or(NoMountPoints)?; + + factory.set_launch(args[1].as_str()); + factory.set_shared(true); + + mounts.add_factory("/test", &factory); + + server.attach(None); + + println!("Stream ready at rtsp://127.0.0.1:{}/test", server.get_bound_port()); + + main_loop.run(); + + Ok(()) +} + +fn example_main() -> Result<(), Error> { + gst::init()?; + + #[cfg(not(feature = "gst-rtsp-server"))] + { + eprintln!("Feature gst-rtsp-server is required. Please rebuild with --features gst-rtsp-server"); + std::process::exit(-1) + } + + #[cfg(feature = "gst-rtsp-server")] + main_loop() +} + +fn main() { + match examples_common::run(example_main) { + Ok(r) => r, + Err(e) => eprintln!("Error! {}", e), + } +} diff --git a/gir-files/GstRtsp-1.0.gir b/gir-files/GstRtsp-1.0.gir new file mode 100644 index 000000000..af34b1dd5 --- /dev/null +++ b/gir-files/GstRtsp-1.0.gir @@ -0,0 +1,5018 @@ + + + + + + + + + + + + + + + + + + + + + + Authentication methods, ordered by strength + + no authentication + + + basic authentication + + + digest authentication + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This object manages the RTSP connection to the server. It provides function +to receive and send bytes and messages. + + Clear the list of authentication directives stored in @conn. + + + + + + a #GstRTSPConnection + + + + + + Close the connected @conn. After this call, the connection is in the same +state as when it was first created. + + #GST_RTSP_OK on success. + + + + + a #GstRTSPConnection + + + + + + Attempt to connect to the url of @conn made with +gst_rtsp_connection_create(). If @timeout is #NULL this function can block +forever. If @timeout contains a valid timeout, this function will return +#GST_RTSP_ETIMEOUT after the timeout expired. + +This function can be cancelled with gst_rtsp_connection_flush(). + + #GST_RTSP_OK when a connection could be made. + + + + + a #GstRTSPConnection + + + + a #GTimeVal timeout + + + + + + Attempt to connect to the url of @conn made with +gst_rtsp_connection_create(). If @timeout is #NULL this function can block +forever. If @timeout contains a valid timeout, this function will return +#GST_RTSP_ETIMEOUT after the timeout expired. If @conn is set to tunneled, +@response will contain a response to the tunneling request messages. + +This function can be cancelled with gst_rtsp_connection_flush(). + + #GST_RTSP_OK when a connection could be made. + +Since 1.8 + + + + + a #GstRTSPConnection + + + + a #GTimeVal timeout + + + + a #GstRTSPMessage + + + + + + If @conn received the first tunnel connection and @conn2 received +the second tunnel connection, link the two connections together so that +@conn manages the tunneled connection. + +After this call, @conn2 cannot be used anymore and must be freed with +gst_rtsp_connection_free(). + +If @conn2 is %NULL then only the base64 decoding context will be setup for +@conn. + + return GST_RTSP_OK on success. + + + + + a #GstRTSPConnection + + + + a #GstRTSPConnection or %NULL + + + + + + Start or stop the flushing action on @conn. When flushing, all current +and future actions on @conn will return #GST_RTSP_EINTR until the connection +is set to non-flushing mode again. + + #GST_RTSP_OK. + + + + + a #GstRTSPConnection + + + + start or stop the flush + + + + + + Close and free @conn. + + #GST_RTSP_OK on success. + + + + + a #GstRTSPConnection + + + + + + Retrieve the IP address of the other end of @conn. + + The IP address as a string. this value remains valid until the +connection is closed. + + + + + a #GstRTSPConnection + + + + + + Get the file descriptor for reading. + + the file descriptor used for reading or %NULL on +error. The file descriptor remains valid until the connection is closed. + + + + + a #GstRTSPConnection + + + + + + + %TRUE if the #GstRTSPConnection remembers the session id in the +last response to set it on any further request. + + + + + a #GstRTSPConnection + + + + + + Get the TLS connection of @conn. + +For client side this will return the #GTlsClientConnection when connected +over TLS. + +For server side connections, this function will create a GTlsServerConnection +when called the first time and will return that same connection on subsequent +calls. The server is then responsible for configuring the TLS connection. + + the TLS connection for @conn. + + + + + a #GstRTSPConnection + + + + + + Gets the anchor certificate authorities database that will be used +after a server certificate can't be verified with the default +certificate database. + + the anchor certificate authorities database, or NULL if no +database has been previously set. Use g_object_unref() to release the +certificate database. + + + + + a #GstRTSPConnection + + + + + + Gets a #GTlsInteraction object to be used when the connection or certificate +database need to interact with the user. This will be used to prompt the +user for passwords where necessary. + + a reference on the #GTlsInteraction. Use +g_object_unref() to release. + + + + + a #GstRTSPConnection + + + + + + Gets the TLS validation flags used to verify the peer certificate +when a TLS connection is established. + + the validationg flags. + + + + + a #GstRTSPConnection + + + + + + Get the tunnel session id the connection. + + returns a non-empty string if @conn is being tunneled over HTTP. + + + + + a #GstRTSPConnection + + + + + + Retrieve the URL of the other end of @conn. + + The URL. This value remains valid until the +connection is freed. + + + + + a #GstRTSPConnection + + + + + + Get the file descriptor for writing. + + the file descriptor used for writing or NULL on +error. The file descriptor remains valid until the connection is closed. + + + + + a #GstRTSPConnection + + + + + + Get the tunneling state of the connection. + + if @conn is using HTTP tunneling. + + + + + a #GstRTSPConnection + + + + + + Calculate the next timeout for @conn, storing the result in @timeout. + + #GST_RTSP_OK. + + + + + a #GstRTSPConnection + + + + a timeout + + + + + + Wait up to the specified @timeout for the connection to become available for +at least one of the operations specified in @events. When the function returns +with #GST_RTSP_OK, @revents will contain a bitmask of available operations on +@conn. + +@timeout can be #NULL, in which case this function might block forever. + +This function can be cancelled with gst_rtsp_connection_flush(). + + #GST_RTSP_OK on success. + + + + + a #GstRTSPConnection + + + + a bitmask of #GstRTSPEvent flags to check + + + + location for result flags + + + + a timeout + + + + + + Attempt to read @size bytes into @data from the connected @conn, blocking up to +the specified @timeout. @timeout can be #NULL, in which case this function +might block forever. + +This function can be cancelled with gst_rtsp_connection_flush(). + + #GST_RTSP_OK on success. + + + + + a #GstRTSPConnection + + + + the data to read + + + + the size of @data + + + + a timeout value or #NULL + + + + + + Attempt to read into @message from the connected @conn, blocking up to +the specified @timeout. @timeout can be #NULL, in which case this function +might block forever. + +This function can be cancelled with gst_rtsp_connection_flush(). + + #GST_RTSP_OK on success. + + + + + a #GstRTSPConnection + + + + the message to read + + + + a timeout value or #NULL + + + + + + Reset the timeout of @conn. + + #GST_RTSP_OK. + + + + + a #GstRTSPConnection + + + + + + Attempt to send @message to the connected @conn, blocking up to +the specified @timeout. @timeout can be #NULL, in which case this function +might block forever. + +This function can be cancelled with gst_rtsp_connection_flush(). + + #GST_RTSP_OK on success. + + + + + a #GstRTSPConnection + + + + the message to send + + + + a timeout value or #NULL + + + + + + Configure @conn for authentication mode @method with @user and @pass as the +user and password respectively. + + #GST_RTSP_OK. + + + + + a #GstRTSPConnection + + + + authentication method + + + + the user + + + + the password + + + + + + Setup @conn with authentication directives. This is not necesary for +methods #GST_RTSP_AUTH_NONE and #GST_RTSP_AUTH_BASIC. For +#GST_RTSP_AUTH_DIGEST, directives should be taken from the digest challenge +in the WWW-Authenticate response header and can include realm, domain, +nonce, opaque, stale, algorithm, qop as per RFC2617. + + + + + + a #GstRTSPConnection + + + + authentication directive + + + + value + + + + + + By setting the HTTP mode to %TRUE the message parsing will support HTTP +messages in addition to the RTSP messages. It will also disable the +automatic handling of setting up an HTTP tunnel. + + + + + + a #GstRTSPConnection + + + + %TRUE to enable manual HTTP mode + + + + + + Set the IP address of the server. + + + + + + a #GstRTSPConnection + + + + an ip address + + + + + + Set the proxy host and port. + + #GST_RTSP_OK. + + + + + a #GstRTSPConnection + + + + the proxy host + + + + the proxy port + + + + + + Configure @conn to use the specified DSCP value. + + #GST_RTSP_OK on success. + + + + + a #GstRTSPConnection + + + + DSCP value + + + + + + Sets if the #GstRTSPConnection should remember the session id from the last +response received and force it onto any further requests. + +The default value is %TRUE + + + + + + a #GstRTSPConnection + + + + %TRUE if the connection should remember the session id + + + + + + Sets the anchor certificate authorities database. This certificate +database will be used to verify the server's certificate in case it +can't be verified with the default certificate database first. + + + + + + a #GstRTSPConnection + + + + a #GTlsDatabase + + + + + + Sets a #GTlsInteraction object to be used when the connection or certificate +database need to interact with the user. This will be used to prompt the +user for passwords where necessary. + + + + + + a #GstRTSPConnection + + + + a #GTlsInteraction + + + + + + Sets the TLS validation flags to be used to verify the peer +certificate when a TLS connection is established. + + TRUE if the validation flags are set correctly, or FALSE if +@conn is NULL or is not a TLS connection. + + + + + a #GstRTSPConnection + + + + the validation flags. + + + + + + Set the HTTP tunneling state of the connection. This must be configured before +the @conn is connected. + + + + + + a #GstRTSPConnection + + + + the new state + + + + + + Attempt to write @size bytes of @data to the connected @conn, blocking up to +the specified @timeout. @timeout can be #NULL, in which case this function +might block forever. + +This function can be cancelled with gst_rtsp_connection_flush(). + + #GST_RTSP_OK on success. + + + + + a #GstRTSPConnection + + + + the data to write + + + + the size of @data + + + + a timeout value or #NULL + + + + + + Accept a new connection on @socket and create a new #GstRTSPConnection for +handling communication on new socket. + + #GST_RTSP_OK when @conn contains a valid connection. + + + + + a socket + + + + storage for a #GstRTSPConnection + + + + a #GCancellable to cancel the operation + + + + + + Create a newly allocated #GstRTSPConnection from @url and store it in @conn. +The connection will not yet attempt to connect to @url, use +gst_rtsp_connection_connect(). + +A copy of @url will be made. + + #GST_RTSP_OK when @conn contains a valid connection. + + + + + a #GstRTSPUrl + + + + storage for a #GstRTSPConnection + + + + + + Create a new #GstRTSPConnection for handling communication on the existing +socket @socket. The @initial_buffer contains zero terminated data already +read from @socket which should be used before starting to read new data. + + #GST_RTSP_OK when @conn contains a valid connection. + + + + + a #GSocket + + + + the IP address of the other end + + + + the port used by the other end + + + + data already read from @fd + + + + storage for a #GstRTSPConnection + + + + + + + The possible events for the connection. + + connection is readable + + + connection is writable + + + + This interface is implemented e.g. by the Windows Media Streaming RTSP + exentension (rtspwms) and the RealMedia RTSP extension (rtspreal). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The possible network families. + + unknown network family + + + internet + + + internet V6 + + + + Enumeration of rtsp header fields + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The different transport methods. + + invalid transport flag + + + stream data over UDP + + + stream data over UDP multicast + + + stream data over TCP + + + stream data tunneled over HTTP. + + + encrypt TCP and HTTP with TLS + + + + Provides methods for creating and parsing request, response and data messages. + + the message type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add a header with key @field and @value to @msg. This function takes a copy +of @value. + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + a #GstRTSPHeaderField + + + + the value of the header + + + + + + Add a header with key @header and @value to @msg. This function takes a copy +of @value. + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + header string + + + + the value of the header + + + + + + Append the currently configured headers in @msg to the #GString @str suitable +for transmission. + + #GST_RTSP_OK. + + + + + a #GstRTSPMessage + + + + a string + + + + + + Dump the contents of @msg to stdout. + + #GST_RTSP_OK. + + + + + a #GstRTSPMessage + + + + + + Free the memory used by @msg. + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + + + Get the body of @msg. @data remains valid for as long as @msg is valid and +unchanged. + + #GST_RTSP_OK. + + + + + a #GstRTSPMessage + + + + location for the data + + + + + + location for the size of @data + + + + + + Get the @indx header value with key @field from @msg. The result in @value +stays valid as long as it remains present in @msg. + + #GST_RTSP_OK when @field was found, #GST_RTSP_ENOTIMPL if the key +was not found. + + + + + a #GstRTSPMessage + + + + a #GstRTSPHeaderField + + + + pointer to hold the result + + + + the index of the header + + + + + + Get the @index header value with key @header from @msg. The result in @value +stays valid as long as it remains present in @msg. + + #GST_RTSP_OK when @field was found, #GST_RTSP_ENOTIMPL if the key +was not found. + + + + + a #GstRTSPMessage + + + + a #GstRTSPHeaderField + + + + pointer to hold the result + + + + the index of the header + + + + + + Get the message type of @msg. + + the message type. + + + + + a #GstRTSPMessage + + + + + + Initialize @msg. This function is mostly used when @msg is allocated on the +stack. The reverse operation of this is gst_rtsp_message_unset(). + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + + + Initialize a new data #GstRTSPMessage for @channel. + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + a channel + + + + + + Initialize @msg as a request message with @method and @uri. To clear @msg +again, use gst_rtsp_message_unset(). + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + the request method to use + + + + the uri of the request + + + + + + Initialize @msg with @code and @reason. + +When @reason is #NULL, the default reason for @code will be used. + +When @request is not #NULL, the relevant headers will be copied to the new +response message. + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + the status code + + + + the status reason or %NULL + + + + the request that triggered the response or %NULL + + + + + + Parses the credentials given in a WWW-Authenticate or Authorization header. + + %NULL-terminated array of GstRTSPAuthCredential or %NULL. + + + + + a #GstRTSPMessage + + + + a #GstRTSPHeaderField + + + + + + Parse the data message @msg and store the channel in @channel. + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + location to hold the channel + + + + + + Parse the request message @msg and store the values @method, @uri and +@version. The result locations can be #NULL if one is not interested in its +value. + +@uri remains valid for as long as @msg is valid and unchanged. + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + location to hold the method + + + + location to hold the uri + + + + location to hold the version + + + + + + Parse the response message @msg and store the values @code, @reason and +@version. The result locations can be #NULL if one is not interested in its +value. + +@reason remains valid for as long as @msg is valid and unchanged. + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + location to hold the status code + + + + location to hold the status reason + + + + location to hold the version + + + + + + Remove the @indx header with key @field from @msg. If @indx equals -1, all +headers will be removed. + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + a #GstRTSPHeaderField + + + + the index of the header + + + + + + Remove the @index header with key @header from @msg. If @index equals -1, +all matching headers will be removed. + + a #GstRTSPResult + + + + + a #GstRTSPMessage + + + + the header string + + + + the index of the header + + + + + + Set the body of @msg to a copy of @data. + + #GST_RTSP_OK. + + + + + a #GstRTSPMessage + + + + the data + + + + + + the size of @data + + + + + + Take the body of @msg and store it in @data and @size. After this method, +the body and size of @msg will be set to #NULL and 0 respectively. + + #GST_RTSP_OK. + + + + + a #GstRTSPMessage + + + + location for the data + + + + + + location for the size of @data + + + + + + Set the body of @msg to @data and @size. This method takes ownership of +@data. + + #GST_RTSP_OK. + + + + + a #GstRTSPMessage + + + + the data + + + + + + the size of @data + + + + + + Add a header with key @field and @value to @msg. This function takes +ownership of @value. + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + a #GstRTSPHeaderField + + + + the value of the header + + + + + + Add a header with key @header and @value to @msg. This function takes +ownership of @value, but not of @header. + + a #GstRTSPResult. + + + + + a #GstRTSPMessage + + + + a header string + + + + the value of the header + + + + + + Unset the contents of @msg so that it becomes an uninitialized +#GstRTSPMessage again. This function is mostly used in combination with +gst_rtsp_message_init_request(), gst_rtsp_message_init_response() and +gst_rtsp_message_init_data() on stack allocated #GstRTSPMessage structures. + + #GST_RTSP_OK. + + + + + a #GstRTSPMessage + + + + + + Create a new initialized #GstRTSPMessage. Free with gst_rtsp_message_free(). + + a #GstRTSPResult. + + + + + a location for the new #GstRTSPMessage + + + + + + Create a new data #GstRTSPMessage with @channel and store the +result message in @msg. Free with gst_rtsp_message_free(). + + a #GstRTSPResult. + + + + + a location for the new #GstRTSPMessage + + + + the channel + + + + + + Create a new #GstRTSPMessage with @method and @uri and store the result +request message in @msg. Free with gst_rtsp_message_free(). + + a #GstRTSPResult. + + + + + a location for the new #GstRTSPMessage + + + + the request method to use + + + + the uri of the request + + + + + + Create a new response #GstRTSPMessage with @code and @reason and store the +result message in @msg. Free with gst_rtsp_message_free(). + +When @reason is #NULL, the default reason for @code will be used. + +When @request is not #NULL, the relevant headers will be copied to the new +response message. + + a #GstRTSPResult. + + + + + a location for the new #GstRTSPMessage + + + + the status code + + + + the status reason or %NULL + + + + the request that triggered the response or %NULL + + + + + + + The different supported RTSP methods. + + invalid method + + + the DESCRIBE method + + + the ANNOUNCE method + + + the GET_PARAMETER method + + + the OPTIONS method + + + the PAUSE method + + + the PLAY method + + + the RECORD method + + + the REDIRECT method + + + the SETUP method + + + the SET_PARAMETER method + + + the TEARDOWN method + + + the GET method (HTTP). + + + the POST method (HTTP). + + + Convert @method to a string. + + a string representation of @method. + + + + + a #GstRTSPMethod + + + + + + + The type of a message. + + invalid message type + + + RTSP request message + + + RTSP response message + + + HTTP request message. + + + HTTP response message. + + + data message + + + + The transfer profile to use. + + invalid profile + + + the Audio/Visual profile (RFC 3551) + + + the secure Audio/Visual profile (RFC 3711) + + + the Audio/Visual profile with feedback (RFC 4585) + + + the secure Audio/Visual profile with feedback (RFC 5124) + + + + Provides helper functions to deal with time ranges. + + minimum value of the range + + + + maximum value of the range + + + + Converts the range in-place between different types of units. +Ranges containing the special value #GST_RTSP_TIME_NOW can not be +converted as these are only valid for #GST_RTSP_RANGE_NPT. + + %TRUE if the range could be converted + + + + + a #GstRTSPTimeRange + + + + the unit to convert the range into + + + + + + Free the memory allocated by @range. + + + + + + a #GstRTSPTimeRange + + + + + + Retrieve the minimum and maximum values from @range converted to +#GstClockTime in @min and @max. + +A value of %GST_CLOCK_TIME_NONE will be used to signal #GST_RTSP_TIME_NOW +and #GST_RTSP_TIME_END for @min and @max respectively. + +UTC times will be converted to nanoseconds since 1900. + + %TRUE on success. + + + + + a #GstRTSPTimeRange + + + + result minimum #GstClockTime + + + + result maximum #GstClockTime + + + + + + Parse @rangestr to a #GstRTSPTimeRange. + + #GST_RTSP_OK on success. + + + + + a range string to parse + + + + location to hold the #GstRTSPTimeRange result + + + + + + Convert @range into a string representation. + + The string representation of @range. g_free() after usage. + + + + + a #GstRTSPTimeRange + + + + + + + Different possible time range units. + + SMPTE timecode + + + 29.97 frames per second + + + 25 frames per second + + + Normal play time + + + Absolute time expressed as ISO 8601 timestamps + + + + Result codes from the RTSP functions. + + no error + + + some unspecified error occured + + + invalid arguments were provided to a function + + + an operation was canceled + + + no memory was available for the operation + + + a host resolve error occured + + + function not implemented + + + a system error occured, errno contains more details + + + a persing error occured + + + windows networking could not start + + + windows networking stack has wrong version + + + end-of-file was reached + + + a network problem occured, h_errno contains more details + + + the host is not an IP host + + + a timeout occured + + + the tunnel GET request has been performed + + + the tunnel POST request has been performed + + + last error + + + + The different RTSP states. + + invalid state + + + initializing + + + ready for operation + + + seeking in progress + + + playing + + + recording + + + + Enumeration of rtsp status codes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A time indication. + + the time of the time + + + + seconds when @type is GST_RTSP_TIME_SECONDS, + GST_RTSP_TIME_UTC and GST_RTSP_TIME_FRAMES + + + + + Extra fields for a time indication. + + frames and subframes when type in GstRTSPTime is + GST_RTSP_TIME_FRAMES + + + + year when type is GST_RTSP_TIME_UTC + + + + month when type is GST_RTSP_TIME_UTC + + + + day when type is GST_RTSP_TIME_UTC + + + + + A time range. + + the time units used + + + + the minimum interval + + + + the maximum interval + + + + extra fields in the minimum interval (Since: 1.2) + + + + extra fields in the maximum interval (Since: 1.2) + + + + + Possible time types. + + seconds + + + now + + + end + + + frames and subframes + + + UTC time + + + + The transfer mode to use. + + invalid tansport mode + + + transfer RTP data + + + transfer RDT (RealMedia) data + + + + Provides helper functions to deal with RTSP transport strings. + + the transport mode + + + + the tansport profile + + + + the lower transport + + + + the destination ip/hostname + + + + the source ip/hostname + + + + the number of layers + + + + if play mode was selected + + + + if record mode was selected + + + + is append mode was selected + + + + the interleave range + + + + the time to live for multicast UDP + + + + the port pair for multicast sessions + + + + the client port pair for receiving data. For TCP + based transports, applications can use this field to store the + sender and receiver ports of the client. + + + + the server port pair for receiving data. For TCP + based transports, applications can use this field to store the + sender and receiver ports of the server. + + + + the ssrc that the sender/receiver will use + + + + + + + + + Convert @transport into a string that can be used to signal the transport in +an RTSP SETUP response. + + a string describing the RTSP transport or #NULL when the transport +is invalid. + + + + + a #GstRTSPTransport + + + + + + Free the memory used by @transport. + + #GST_RTSP_OK. + + + + + a #GstRTSPTransport + + + + + + Get the media type of @transport. This media type is typically +used to generate #GstCaps events. + + #GST_RTSP_OK. + + + + + a #GstRTSPTransport + + + + media type of @transport + + + + + + Initialize @transport so that it can be used. + + #GST_RTSP_OK. + + + + + a #GstRTSPTransport + + + + + + Get the #GstElement that can handle the buffers transported over @trans. + +It is possible that there are several managers available, use @option to +selected one. + +@manager will contain an element name or #NULL when no manager is +needed/available for @trans. + + #GST_RTSP_OK. + + + + + a #GstRTSPTransMode + + + + location to hold the result + + + + option index. + + + + + + Get the mime type of the transport mode @trans. This mime type is typically +used to generate #GstCaps events. + This functions only deals with the GstRTSPTransMode and only + returns the mime type for #GST_RTSP_PROFILE_AVP. Use + gst_rtsp_transport_get_media_type() instead. + + #GST_RTSP_OK. + + + + + a #GstRTSPTransMode + + + + location to hold the result + + + + + + Allocate a new initialized #GstRTSPTransport. Use gst_rtsp_transport_free() +after usage. + + a #GstRTSPResult. + + + + + location to hold the new #GstRTSPTransport + + + + + + Parse the RTSP transport string @str into @transport. + + a #GstRTSPResult. + + + + + a transport string + + + + a #GstRTSPTransport + + + + + + + Provides helper functions to handle RTSP urls. + + the transports allowed + + + + the family + + + + the user + + + + the password + + + + the host + + + + the port + + + + the absolute path + + + + additional query parameters + + + + Make a copy of @url. + + a copy of @url. Free with gst_rtsp_url_free () after usage. + + + + + a #GstRTSPUrl + + + + + + Splits the path of @url on '/' boundaries, decoding the resulting components, + +The decoding performed by this routine is "URI decoding", as defined in RFC +3986, commonly known as percent-decoding. For example, a string "foo\%2fbar" +will decode to "foo/bar" -- the \%2f being replaced by the corresponding byte +with hex value 0x2f. Note that there is no guarantee that the resulting byte +sequence is valid in any given encoding. As a special case, \%00 is not +unescaped to NUL, as that would prematurely terminate the string. + +Also note that since paths usually start with a slash, the first component +will usually be the empty string. + + %NULL-terminated array of URL components. Free with +g_strfreev() when no longer needed. + + + + + + + a #GstRTSPUrl + + + + + + Free the memory used by @url. + + + + + + a #GstRTSPUrl + + + + + + Get the port number of @url. + + #GST_RTSP_OK. + + + + + a #GstRTSPUrl + + + + location to hold the port + + + + + + Get a newly allocated string describing the request URI for @url. + + a string with the request URI. g_free() after usage. + + + + + a #GstRTSPUrl + + + + + + Set the port number in @url to @port. + + #GST_RTSP_OK. + + + + + a #GstRTSPUrl + + + + the port + + + + + + Parse the RTSP @urlstr into a newly allocated #GstRTSPUrl. Free after usage +with gst_rtsp_url_free(). + + a #GstRTSPResult. + + + + + the url string to parse + + + + location to hold the result. + + + + + + + The supported RTSP versions. + + unknown/invalid version + + + version 1.0 + + + version 1.1. + + + Convert @version to a string. + + a string representation of @version. + + + + + a #GstRTSPVersion + + + + + + + Opaque RTSP watch object that can be used for asynchronous RTSP +operations. + + Adds a #GstRTSPWatch to a context so that it will be executed within that context. + + the ID (greater than 0) for the watch within the GMainContext. + + + + + a #GstRTSPWatch + + + + a GMainContext (if NULL, the default context will be used) + + + + + + Get the maximum amount of bytes and messages that will be queued in @watch. +See gst_rtsp_watch_set_send_backlog(). + + + + + + a #GstRTSPWatch + + + + maximum bytes + + + + maximum messages + + + + + + Reset @watch, this is usually called after gst_rtsp_connection_do_tunnel() +when the file descriptors of the connection might have changed. + + + + + + a #GstRTSPWatch + + + + + + Send a @message using the connection of the @watch. If it cannot be sent +immediately, it will be queued for transmission in @watch. The contents of +@message will then be serialized and transmitted when the connection of the +@watch becomes writable. In case the @message is queued, the ID returned in +@id will be non-zero and used as the ID argument in the message_sent +callback. + + #GST_RTSP_OK on success. + + + + + a #GstRTSPWatch + + + + a #GstRTSPMessage + + + + location for a message ID or %NULL + + + + + + When @flushing is %TRUE, abort a call to gst_rtsp_watch_wait_backlog() +and make sure gst_rtsp_watch_write_data() returns immediately with +#GST_RTSP_EINTR. And empty the queue. + + + + + + a #GstRTSPWatch + + + + new flushing state + + + + + + Set the maximum amount of bytes and messages that will be queued in @watch. +When the maximum amounts are exceeded, gst_rtsp_watch_write_data() and +gst_rtsp_watch_send_message() will return #GST_RTSP_ENOMEM. + +A value of 0 for @bytes or @messages means no limits. + + + + + + a #GstRTSPWatch + + + + maximum bytes + + + + maximum messages + + + + + + Decreases the reference count of @watch by one. If the resulting reference +count is zero the watch and associated memory will be destroyed. + + + + + + a #GstRTSPWatch + + + + + + Wait until there is place in the backlog queue, @timeout is reached +or @watch is set to flushing. + +If @timeout is %NULL this function can block forever. If @timeout +contains a valid timeout, this function will return %GST_RTSP_ETIMEOUT +after the timeout expired. + +The typically use of this function is when gst_rtsp_watch_write_data +returns %GST_RTSP_ENOMEM. The caller then calls this function to wait for +free space in the backlog queue and try again. + + %GST_RTSP_OK when if there is room in queue. + %GST_RTSP_ETIMEOUT when @timeout was reached. + %GST_RTSP_EINTR when @watch is flushing + %GST_RTSP_EINVAL when called with invalid parameters. + + + + + a #GstRTSPWatch + + + + a #GTimeVal timeout + + + + + + Write @data using the connection of the @watch. If it cannot be sent +immediately, it will be queued for transmission in @watch. The contents of +@message will then be serialized and transmitted when the connection of the +@watch becomes writable. In case the @message is queued, the ID returned in +@id will be non-zero and used as the ID argument in the message_sent +callback. + +This function will take ownership of @data and g_free() it after use. + +If the amount of queued data exceeds the limits set with +gst_rtsp_watch_set_send_backlog(), this function will return +#GST_RTSP_ENOMEM. + + #GST_RTSP_OK on success. #GST_RTSP_ENOMEM when the backlog limits +are reached. #GST_RTSP_EINTR when @watch was flushing. + + + + + a #GstRTSPWatch + + + + the data to queue + + + + + + the size of @data + + + + location for a message ID or %NULL + + + + + + Create a watch object for @conn. The functions provided in @funcs will be +called with @user_data when activity happened on the watch. + +The new watch is usually created so that it can be attached to a +maincontext with gst_rtsp_watch_attach(). + +@conn must exist for the entire lifetime of the watch. + + a #GstRTSPWatch that can be used for asynchronous RTSP +communication. Free with gst_rtsp_watch_unref () after usage. + + + + + a #GstRTSPConnection + + + + watch functions + + + + user data to pass to @funcs + + + + notify when @user_data is not referenced anymore + + + + + + + Callback functions from a #GstRTSPWatch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The default RTSP port to connect to. + + + + Free a %NULL-terminated array of credentials returned from +gst_rtsp_message_parse_auth_credentials(). + + + + + + a %NULL-terminated array of #GstRTSPAuthCredential + + + + + + Accept a new connection on @socket and create a new #GstRTSPConnection for +handling communication on new socket. + + #GST_RTSP_OK when @conn contains a valid connection. + + + + + a socket + + + + storage for a #GstRTSPConnection + + + + a #GCancellable to cancel the operation + + + + + + Create a newly allocated #GstRTSPConnection from @url and store it in @conn. +The connection will not yet attempt to connect to @url, use +gst_rtsp_connection_connect(). + +A copy of @url will be made. + + #GST_RTSP_OK when @conn contains a valid connection. + + + + + a #GstRTSPUrl + + + + storage for a #GstRTSPConnection + + + + + + Create a new #GstRTSPConnection for handling communication on the existing +socket @socket. The @initial_buffer contains zero terminated data already +read from @socket which should be used before starting to read new data. + + #GST_RTSP_OK when @conn contains a valid connection. + + + + + a #GSocket + + + + the IP address of the other end + + + + the port used by the other end + + + + data already read from @fd + + + + storage for a #GstRTSPConnection + + + + + + Convert @header to a #GstRTSPHeaderField. + + a #GstRTSPHeaderField for @header or #GST_RTSP_HDR_INVALID if the +header field is unknown. + + + + + a header string + + + + + + Convert @method to a #GstRTSPMethod. + + a #GstRTSPMethod for @method or #GST_RTSP_INVALID if the +method is unknown. + + + + + a method + + + + + + Calculates the digest auth response from the values given by the server and +the username and password. See RFC2069 for details. + +Currently only supported algorithm "md5". + + Authentication response or %NULL if unsupported + + + + + Hash algorithm to use, or %NULL for MD5 + + + + Request method, e.g. PLAY + + + + Realm + + + + Username + + + + Password + + + + Original request URI + + + + Nonce + + + + + + Check whether @field may appear multiple times in a message. + + %TRUE if multiple headers are allowed. + + + + + a #GstRTSPHeaderField + + + + + + Convert @field to a string. + + a string representation of @field. + + + + + a #GstRTSPHeaderField + + + + + + Create a new initialized #GstRTSPMessage. Free with gst_rtsp_message_free(). + + a #GstRTSPResult. + + + + + a location for the new #GstRTSPMessage + + + + + + Create a new data #GstRTSPMessage with @channel and store the +result message in @msg. Free with gst_rtsp_message_free(). + + a #GstRTSPResult. + + + + + a location for the new #GstRTSPMessage + + + + the channel + + + + + + Create a new #GstRTSPMessage with @method and @uri and store the result +request message in @msg. Free with gst_rtsp_message_free(). + + a #GstRTSPResult. + + + + + a location for the new #GstRTSPMessage + + + + the request method to use + + + + the uri of the request + + + + + + Create a new response #GstRTSPMessage with @code and @reason and store the +result message in @msg. Free with gst_rtsp_message_free(). + +When @reason is #NULL, the default reason for @code will be used. + +When @request is not #NULL, the relevant headers will be copied to the new +response message. + + a #GstRTSPResult. + + + + + a location for the new #GstRTSPMessage + + + + the status code + + + + the status reason or %NULL + + + + the request that triggered the response or %NULL + + + + + + Convert @method to a string. + + a string representation of @method. + + + + + a #GstRTSPMethod + + + + + + Convert @options to a string. + + a new string of @options. g_free() after usage. + + + + + one or more #GstRTSPMethod + + + + + + Convert the comma separated list @options to a #GstRTSPMethod bitwise or +of methods. This functions is the reverse of gst_rtsp_options_as_text(). + + a #GstRTSPMethod + + + + + a comma separated list of options + + + + + + Converts the range in-place between different types of units. +Ranges containing the special value #GST_RTSP_TIME_NOW can not be +converted as these are only valid for #GST_RTSP_RANGE_NPT. + + %TRUE if the range could be converted + + + + + a #GstRTSPTimeRange + + + + the unit to convert the range into + + + + + + Free the memory allocated by @range. + + + + + + a #GstRTSPTimeRange + + + + + + Retrieve the minimum and maximum values from @range converted to +#GstClockTime in @min and @max. + +A value of %GST_CLOCK_TIME_NONE will be used to signal #GST_RTSP_TIME_NOW +and #GST_RTSP_TIME_END for @min and @max respectively. + +UTC times will be converted to nanoseconds since 1900. + + %TRUE on success. + + + + + a #GstRTSPTimeRange + + + + result minimum #GstClockTime + + + + result maximum #GstClockTime + + + + + + Parse @rangestr to a #GstRTSPTimeRange. + + #GST_RTSP_OK on success. + + + + + a range string to parse + + + + location to hold the #GstRTSPTimeRange result + + + + + + Convert @range into a string representation. + + The string representation of @range. g_free() after usage. + + + + + a #GstRTSPTimeRange + + + + + + Convert @code to a string. + + a string representation of @code. + + + + + a #GstRTSPStatusCode + + + + + + Convert @result in a human readable string. + + a newly allocated string. g_free() after usage. + + + + + a #GstRTSPResult + + + + + + Get the #GstElement that can handle the buffers transported over @trans. + +It is possible that there are several managers available, use @option to +selected one. + +@manager will contain an element name or #NULL when no manager is +needed/available for @trans. + + #GST_RTSP_OK. + + + + + a #GstRTSPTransMode + + + + location to hold the result + + + + option index. + + + + + + Get the mime type of the transport mode @trans. This mime type is typically +used to generate #GstCaps events. + This functions only deals with the GstRTSPTransMode and only + returns the mime type for #GST_RTSP_PROFILE_AVP. Use + gst_rtsp_transport_get_media_type() instead. + + #GST_RTSP_OK. + + + + + a #GstRTSPTransMode + + + + location to hold the result + + + + + + Allocate a new initialized #GstRTSPTransport. Use gst_rtsp_transport_free() +after usage. + + a #GstRTSPResult. + + + + + location to hold the new #GstRTSPTransport + + + + + + Parse the RTSP transport string @str into @transport. + + a #GstRTSPResult. + + + + + a transport string + + + + a #GstRTSPTransport + + + + + + Parse the RTSP @urlstr into a newly allocated #GstRTSPUrl. Free after usage +with gst_rtsp_url_free(). + + a #GstRTSPResult. + + + + + the url string to parse + + + + location to hold the result. + + + + + + Convert @version to a string. + + a string representation of @version. + + + + + a #GstRTSPVersion + + + + + + Create a watch object for @conn. The functions provided in @funcs will be +called with @user_data when activity happened on the watch. + +The new watch is usually created so that it can be attached to a +maincontext with gst_rtsp_watch_attach(). + +@conn must exist for the entire lifetime of the watch. + + a #GstRTSPWatch that can be used for asynchronous RTSP +communication. Free with gst_rtsp_watch_unref () after usage. + + + + + a #GstRTSPConnection + + + + watch functions + + + + user data to pass to @funcs + + + + notify when @user_data is not referenced anymore + + + + + + diff --git a/gir-files/GstRtspServer-1.0.gir b/gir-files/GstRtspServer-1.0.gir new file mode 100644 index 000000000..a6addaa73 --- /dev/null +++ b/gir-files/GstRtspServer-1.0.gir @@ -0,0 +1,9575 @@ + + + + + + + + + + + An address + + the #GstRTSPAddressPool owner of this address + + + + the address + + + + the port number + + + + number of ports + + + + TTL or 0 for unicast addresses + + + + + + + Make a copy of @addr. + + a copy of @addr. + + + + + a #GstRTSPAddress + + + + + + Free @addr and releasing it back into the pool when owned by a +pool. + + + + + + a #GstRTSPAddress + + + + + + + Flags used to control allocation of addresses + + no flags + + + an IPv4 address + + + and IPv6 address + + + address with an even port + + + a multicast address + + + a unicast address + + + + An address pool, all member are private + + Make a new #GstRTSPAddressPool. + + a new #GstRTSPAddressPool + + + + + 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. + + a #GstRTSPAddress that should be freed with +gst_rtsp_address_free after use or %NULL when no address could be +acquired. + + + + + a #GstRTSPAddressPool + + + + flags + + + + the amount of ports + + + + + + 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. + + %TRUE if the addresses could be added. + + + + + a #GstRTSPAddressPool + + + + a minimum address to add + + + + a maximum address to add + + + + the minimum port + + + + the maximum port + + + + a TTL or 0 for unicast addresses + + + + + + Clear all addresses in @pool. There should be no outstanding +allocations. + + + + + + a #GstRTSPAddressPool + + + + + + Dump the free and allocated addresses to stdout. + + + + + + a #GstRTSPAddressPool + + + + + + Used to know if the pool includes any unicast addresses. + + %TRUE if the pool includes any unicast addresses, %FALSE otherwise + + + + + a #GstRTSPAddressPool + + + + + + 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. + + #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. + + + + + a #GstRTSPAddressPool + + + + The IP address to reserve + + + + The first port to reserve + + + + The number of ports + + + + The requested ttl + + + + storage for a #GstRTSPAddress + + + + + + the parent GObject + + + + + + + + + + + + + Opaque Address pool class. + + + + + + + + + + + + + Result codes from RTSP address pool functions. + + no error + + + invalid arguments were provided to a function + + + the addres has already been reserved + + + the address is not in the pool + + + last error + + + + The authentication structure. + + Create a new #GstRTSPAuth instance. + + a new #GstRTSPAuth + + + + + Check if @check is allowed in the current context. + + FALSE if check failed. + + + + + the item to check + + + + + + Construct a Basic authorisation token from @user and @pass. + + the base64 encoding of the string @user:@pass. +g_free() after usage. + + + + + a userid + + + + a password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add a basic token for the default authentication algorithm that +enables the client with privileges listed in @token. + + + + + + a #GstRTSPAuth + + + + the basic token + + + + authorisation token + + + + + + Add a digest @user and @pass for the default authentication algorithm that +enables the client with privileges listed in @token. + + + + + + a #GstRTSPAuth + + + + the digest user name + + + + the digest password + + + + authorisation token + + + + + + Get the default token for @auth. This token will be used for unauthenticated +users. + + the #GstRTSPToken of @auth. gst_rtsp_token_unref() after +usage. + + + + + a #GstRTSPAuth + + + + + + Gets the supported authentication methods of @auth. + + The supported authentication methods + + + + + a #GstRTSPAuth + + + + + + Get the #GTlsAuthenticationMode. + + the #GTlsAuthenticationMode. + + + + + a #GstRTSPAuth + + + + + + Get the #GTlsCertificate used for negotiating TLS @auth. + + the #GTlsCertificate of @auth. g_object_unref() after +usage. + + + + + a #GstRTSPAuth + + + + + + Get the #GTlsDatabase used for verifying client certificate. + + the #GTlsDatabase of @auth. g_object_unref() after +usage. + + + + + a #GstRTSPAuth + + + + + + Removes @basic authentication token. + + + + + + a #GstRTSPAuth + + + + the basic token + + + + + + Removes a digest user. + + + + + + a #GstRTSPAuth + + + + the digest user name + + + + + + Set the default #GstRTSPToken to @token in @auth. The default token will +be used for unauthenticated users. + + + + + + a #GstRTSPAuth + + + + a #GstRTSPToken + + + + + + Sets the supported authentication @methods for @auth. + + + + + + a #GstRTSPAuth + + + + supported methods + + + + + + The #GTlsAuthenticationMode to set on the underlying GTlsServerConnection. +When set to another value than %G_TLS_AUTHENTICATION_NONE, +#GstRTSPAuth::accept-certificate signal will be emitted and must be handled. + + + + + + a #GstRTSPAuth + + + + a #GTlsAuthenticationMode + + + + + + Set the TLS certificate for the auth. Client connections will only +be accepted when TLS is negotiated. + + + + + + a #GstRTSPAuth + + + + a #GTlsCertificate + + + + + + Sets the certificate database that is used to verify peer certificates. +If set to %NULL (the default), then peer certificate validation will always +set the %G_TLS_CERTIFICATE_UNKNOWN_CA error. + +Since 1.6 + + + + + + a #GstRTSPAuth + + + + a #GTlsDatabase + + + + + + + + + + + + + + + + + Emitted during the TLS handshake after the client certificate has +been received. See also gst_rtsp_auth_set_tls_authentication_mode(). + + %TRUE to accept @peer_cert (which will also +immediately end the signal emission). %FALSE to allow the signal +emission to continue, which will cause the handshake to fail if +no one else overrides it. + + + + + a #GTlsConnection + + + + the peer's #GTlsCertificate + + + + the problems with @peer_cert. + + + + + + + The authentication class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The client object represents the connection and its state with a client. + + Create a new #GstRTSPClient instance. + + a new #GstRTSPClient + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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. + + the ID (greater than 0) for the source within the GMainContext. + + + + + a #GstRTSPClient + + + + a #GMainContext + + + + + + Close the connection of @client and remove all media it was managing. + + + + + + a #GstRTSPClient + + + + + + Get the #GstRTSPAuth used as the authentication manager of @client. + + the #GstRTSPAuth of @client. +g_object_unref() after usage. + + + + + a #GstRTSPClient + + + + + + Get the #GstRTSPConnection of @client. + + the #GstRTSPConnection of @client. +The connection object returned remains valid until the client is freed. + + + + + a #GstRTSPClient + + + + + + Get the #GstRTSPMountPoints object that @client uses to manage its sessions. + + a #GstRTSPMountPoints, unref after usage. + + + + + a #GstRTSPClient + + + + + + Get the #GstRTSPSessionPool object that @client uses to manage its sessions. + + a #GstRTSPSessionPool, unref after usage. + + + + + a #GstRTSPClient + + + + + + Get the #GstRTSPThreadPool used as the thread pool of @client. + + the #GstRTSPThreadPool of @client. g_object_unref() after +usage. + + + + + a #GstRTSPClient + + + + + + Let the client handle @message. + + a #GstRTSPResult. + + + + + a #GstRTSPClient + + + + an #GstRTSPMessage + + + + + + Send a message message to the remote end. @message must be a +#GST_RTSP_MESSAGE_REQUEST or a #GST_RTSP_MESSAGE_RESPONSE. + + + + + + a #GstRTSPClient + + + + a #GstRTSPSession to send + the message to or %NULL + + + + The #GstRTSPMessage to send + + + + + + 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. + + 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. + + + + + + + a #GstRTSPClient + + + + a callback + + + + user data passed to @func + + + + + + configure @auth to be used as the authentication manager of @client. + + + + + + a #GstRTSPClient + + + + a #GstRTSPAuth + + + + + + Set the #GstRTSPConnection of @client. This function takes ownership of +@conn. + + %TRUE on success. + + + + + a #GstRTSPClient + + + + a #GstRTSPConnection + + + + + + 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. + + + + + + a #GstRTSPClient + + + + a #GstRTSPMountPoints + + + + + + 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. + + + + + + a #GstRTSPClient + + + + a #GstRTSPClientSendFunc + + + + user data passed to @func + + + + called when @user_data is no longer in use + + + + + + 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. + + + + + + a #GstRTSPClient + + + + a #GstRTSPSessionPool + + + + + + configure @pool to be used as the thread pool of @client. + + + + + + a #GstRTSPClient + + + + a #GstRTSPThreadPool + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a #GstRTSPContext + + + + + + + a newly allocated string with comma-separated list of + unsupported options. An empty string must be returned if + all options are supported. + + + + + a #GstRTSPContext + + + + a NULL-terminated array of strings + + + + + + + + + + + + + + + + + + a #GstRTSPContext + + + + + + + + + + + a #GstRTSPContext + + + + + + + + + + + a #GstRTSPContext + + + + + + + + + + + + + + + + + + + + + a #GstRTSPContext + + + + + + + + + + + a #GstRTSPContext + + + + + + + + + + + a #GstRTSPContext + + + + + + + a #GstRTSPStatusCode, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + + + + a #GstRTSPContext + + + + + + + a #GstRTSPStatusCode, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + + + + a #GstRTSPContext + + + + + + + a #GstRTSPStatusCode, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + + + + a #GstRTSPContext + + + + + + + a #GstRTSPStatusCode, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + + + + a #GstRTSPContext + + + + + + + a #GstRTSPStatusCode, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + + + + a #GstRTSPContext + + + + + + + a #GstRTSPStatusCode, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + + + + a #GstRTSPContext + + + + + + + a #GstRTSPStatusCode, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + + + + a #GstRTSPContext + + + + + + + a #GstRTSPStatusCode, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + + + + a #GstRTSPContext + + + + + + + a #GstRTSPStatusCode, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + + + + a #GstRTSPContext + + + + + + + a #GstRTSPStatusCode, GST_RTSP_STS_OK in case of success, + otherwise an appropriate return code + + + + + a #GstRTSPContext + + + + + + + + + + + a #GstRTSPContext + + + + + + + + + + + The session + + + + The message + + + + + + + + + + + a #GstRTSPContext + + + + + + + + + + + a #GstRTSPContext + + + + + + + + + + + a #GstRTSPContext + + + + + + + The client class structure. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 on success. + + + + + a #GstRTSPClient + + + + a #GstRTSPMessage + + + + close the connection + + + + user data when registering the callback + + + + + + 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(). + + a #GstRTSPFilterResult. + + + + + a #GstRTSPClient object + + + + a #GstRTSPSession in @client + + + + user data that has been given to gst_rtsp_client_session_filter() + + + + + + Information passed around containing the context of a request. + + the server + + + + the connection + + + + the client + + + + the complete request + + + + the complete url parsed from @request + + + + the parsed method of @uri + + + + the current auth object or %NULL + + + + authorisation token + + + + the session, can be %NULL + + + + the session media for the url can be %NULL + + + + the media factory for the url, can be %NULL + + + + the media for the url can be %NULL + + + + the stream for the url can be %NULL + + + + the response + + + + the stream transport, can be %NULL + + + + + + + + + Pops @ctx off the context stack (verifying that @ctx +is on the top of the stack). + + + + + + a #GstRTSPContext + + + + + + Pushes @ctx onto the context stack. The current +context can then be received using gst_rtsp_context_get_current(). + + + + + + a ##GstRTSPContext + + + + + + Get the current #GstRTSPContext. This object is retrieved from the +current thread that is handling the request for a client. + + a #GstRTSPContext + + + + + + Possible return values for gst_rtsp_session_pool_filter(). + + Remove session + + + Keep session in the pool + + + Ref session in the result list + + + + Function registered with gst_rtsp_stream_transport_set_keepalive() and called +when the stream is active. + + + + + + user data + + + + + + 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. + + 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. + + a new #GstRTSPMedia object. + + + + + a #GstElement + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Configure an SDP on @media for receiving streams + + TRUE on success. + + + + + a #GstRTSPMedia + + + + a #GstSDPMessage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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. + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + a #GstRTSPThread to run the + bus handler or %NULL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add @media specific info to @sdp. @info is used to configure the connection +information in the SDP. + + TRUE on success. + + + + + a #GstRTSPMedia + + + + a #GstSDPMessage + + + + a #GstSDPInfo + + + + + + 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(); + + %TRUE on success. + + + + + 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. + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + + + + + + + + + + + + + Unsuspend @media if it was in a suspended state. This method does nothing +when the media was not in the suspended state. + + %TRUE on success. + + + + + 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. + +Find all depayloader elements, they should be named depay\%d in the +element of @media, and create #GstRTSPStreams for them. + + + + + + a #GstRTSPMedia + + + + + + Create a new stream in @media that provides RTP data on @pad. +@pad should be a pad of an element inside @media->element. + + a new #GstRTSPStream that remains valid for as long +as @media exists. + + + + + a #GstRTSPMedia + + + + a #GstElement + + + + a #GstPad + + + + + + Find a stream in @media with @control as the control uri. + + the #GstRTSPStream with +control uri @control or %NULL when a stream with that control did +not exist. + + + + + a #GstRTSPMedia + + + + the control of the stream + + + + + + Get the #GstRTSPAddressPool used as the address pool of @media. + + the #GstRTSPAddressPool of @media. +g_object_unref() after usage. + + + + + 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. + + the base_time used by @media. + + + + + a #GstRTSPMedia + + + + + + Get the kernel UDP buffer size. + + the kernel UDP buffer size. + + + + + 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. + + the #GstClock used by @media. unref after usage. + + + + + a #GstRTSPMedia + + + + + + Get the element that was used when constructing @media. + + a #GstElement. Unref after usage. + + + + + a #GstRTSPMedia + + + + + + Get the latency that is used for receiving media. + + latency in milliseconds + + + + + a #GstRTSPMedia + + + + + + Get the multicast interface used for @media. + + the multicast interface for @media. +g_free() after usage. + + + + + a #GstRTSPMedia + + + + + + Get the permissions object from @media. + + a #GstRTSPPermissions object, unref after usage. + + + + + a #GstRTSPMedia + + + + + + Get the allowed profiles of @media. + + a #GstRTSPProfile + + + + + a #GstRTSPMedia + + + + + + Get the allowed protocols of @media. + + a #GstRTSPLowerTrans + + + + + a #GstRTSPMedia + + + + + + Gets if and how the media clock should be published according to RFC7273. + + The GstRTSPPublishClockMode + + + + + a #GstRTSPMedia + + + + + + Get the current range as a string. @media must be prepared with +gst_rtsp_media_prepare (). + + The range as a string, g_free() after usage. + + + + + a #GstRTSPMedia + + + + for the PLAY request + + + + the unit to use for the string + + + + + + Get the amount of time to store retransmission data. + + the amount of time to store retransmission data. + + + + + a #GstRTSPMedia + + + + + + Get the status of @media. When @media is busy preparing, this function waits +until @media is prepared or in error. + + the status of @media. + + + + + a #GstRTSPMedia + + + + + + Retrieve the stream with index @idx from @media. + + the #GstRTSPStream at index +@idx or %NULL when a stream with that index did not exist. + + + + + a #GstRTSPMedia + + + + the stream index + + + + + + Get how @media will be suspended. + + #GstRTSPSuspendMode. + + + + + a #GstRTSPMedia + + + + + + Get the #GstNetTimeProvider for the clock used by @media. The time provider +will listen on @address and @port for client time requests. + + the #GstNetTimeProvider of @media. + + + + + a #GstRTSPMedia + + + + an address or %NULL + + + + a port or 0 + + + + + + Check if the pipeline for @media can be used for PLAY or RECORD methods. + + The transport mode. + + + + + a #GstRTSPMedia + + + + + + Configure an SDP on @media for receiving streams + + TRUE on success. + + + + + a #GstRTSPMedia + + + + a #GstSDPMessage + + + + + + Check if the pipeline for @media will send an EOS down the pipeline before +unpreparing. + + %TRUE if the media will send EOS before unpreparing. + + + + + a #GstRTSPMedia + + + + + + Check if the pipeline for @media can be reused after an unprepare. + + %TRUE if the media can be reused + + + + + a #GstRTSPMedia + + + + + + Check if the pipeline for @media can be shared between multiple clients. + + %TRUE if the media can be shared between clients. + + + + + a #GstRTSPMedia + + + + + + Check if the pipeline for @media will be stopped when a client disconnects +without sending TEARDOWN. + + %TRUE if the media will be stopped when a client disconnects + without sending TEARDOWN. + + + + + 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. + + %TRUE if @media can provide a #GstNetTimeProvider. + + + + + a #GstRTSPMedia + + + + + + Get the number of streams in this media. + + The number of streams. + + + + + a #GstRTSPMedia + + + + + + 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. + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + a #GstRTSPThread to run the + bus handler or %NULL + + + + + + Seek the pipeline of @media to @range. @media must be prepared with +gst_rtsp_media_prepare(). + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + a #GstRTSPTimeRange + + + + + + configure @pool to be used as the address pool of @media. + + + + + + a #GstRTSPMedia + + + + a #GstRTSPAddressPool + + + + + + Set the kernel UDP buffer size. + + + + + + a #GstRTSPMedia + + + + the new value + + + + + + Configure the clock used for the media. + + + + + + a #GstRTSPMedia + + + + #GstClock to be used + + + + + + Set or unset if an EOS event will be sent to the pipeline for @media before +it is unprepared. + + + + + + a #GstRTSPMedia + + + + the new value + + + + + + Configure the latency used for receiving media. + + + + + + a #GstRTSPMedia + + + + latency in milliseconds + + + + + + configure @multicast_iface to be used for @media. + + + + + + a #GstRTSPMedia + + + + a multicast interface name + + + + + + Set @permissions on @media. + + + + + + a #GstRTSPMedia + + + + a #GstRTSPPermissions + + + + + + Set the state of the pipeline managed by @media to @state + + + + + + a #GstRTSPMedia + + + + the target state of the pipeline + + + + + + Configure the allowed lower transport for @media. + + + + + + a #GstRTSPMedia + + + + the new flags + + + + + + Configure the allowed lower transport for @media. + + + + + + a #GstRTSPMedia + + + + the new flags + + + + + + Sets if and how the media clock should be published according to RFC7273. + + + + + + a #GstRTSPMedia + + + + the clock publish mode + + + + + + Set the amount of time to store retransmission packets. + + + + + + a #GstRTSPMedia + + + + the new value + + + + + + Set or unset if the pipeline for @media can be reused after the pipeline has +been unprepared. + + + + + + a #GstRTSPMedia + + + + 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. + + + + + + a #GstRTSPMedia + + + + the new value + + + + + + Set the state of @media to @state and for the transports in @transports. + +@media must be prepared with gst_rtsp_media_prepare(); + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + the target state of the media + + + + +a #GPtrArray of #GstRTSPStreamTransport pointers + + + + + + + + Set or unset if the pipeline for @media should be stopped when a +client disconnects without sending TEARDOWN. + + + + + + a #GstRTSPMedia + + + + the new value + + + + + + 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. + + + + + + a #GstRTSPMedia + + + + the new #GstRTSPSuspendMode + + + + + + Sets if the media pipeline can work in PLAY or RECORD mode + + + + + + a #GstRTSPMedia + + + + the new value + + + + + + Add @media specific info to @sdp. @info is used to configure the connection +information in the SDP. + + TRUE on success. + + + + + a #GstRTSPMedia + + + + a #GstSDPMessage + + + + a #GstSDPInfo + + + + + + 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(); + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + + + Set @pipeline as the #GstPipeline for @media. Ownership is +taken of @pipeline. + + + + + + a #GstRTSPMedia + + + + a #GstPipeline + + + + + + 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. + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + + + Unsuspend @media if it was in a suspended state. This method does nothing +when the media was not in the suspended state. + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + + + Set @media to provide a #GstNetTimeProvider. + + + + + + a #GstRTSPMedia + + + + if a #GstNetTimeProvider should be used + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The RTSP media class + + + + + + + + + + + + + + + + + + + + + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + a #GstRTSPThread to run the + bus handler or %NULL + + + + + + + + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + + + + + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + + + + + + %TRUE on success. + + + + + a #GstRTSPMedia + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TRUE on success. + + + + + a #GstRTSPMedia + + + + a #GstSDPMessage + + + + a #GstSDPInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TRUE on success. + + + + + a #GstRTSPMedia + + + + a #GstSDPMessage + + + + + + + + + + + + + The definition and logic for constructing the pipeline for a media. The media +can contain multiple streams like audio and video. + + Create a new #GstRTSPMediaFactory instance. + + a new #GstRTSPMediaFactory object. + + + + + + + + + + + + + + + + + + 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 (). + + a new #GstRTSPMedia if the media could be prepared. + + + + + a #GstRTSPMediaFactory + + + + 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. + + a new #GstElement. + + + + + a #GstRTSPMediaFactory + + + + the url used + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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. + + + + + + a #GstRTSPMediaFactory + + + + a role + + + + the first field name + + + + additional arguments + + + + + + 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 (). + + a new #GstRTSPMedia if the media could be prepared. + + + + + a #GstRTSPMediaFactory + + + + 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. + + a new #GstElement. + + + + + a #GstRTSPMediaFactory + + + + the url used + + + + + + Get the #GstRTSPAddressPool used as the address pool of @factory. + + the #GstRTSPAddressPool of @factory. g_object_unref() after +usage. + + + + + a #GstRTSPMediaFactory + + + + + + Get the kernel UDP buffer size. + + the kernel UDP buffer size. + + + + + a #GstRTSPMedia + + + + + + Returns the clock that is going to be used by the pipelines +of all medias created from this factory. + + The GstClock + + + + + a #GstRTSPMediaFactory + + + + + + Get the latency that is used for receiving media + + latency in milliseconds + + + + + a #GstRTSPMediaFactory + + + + + + Get the gst_parse_launch() pipeline description that will be used in the +default prepare vmethod. + + the configured launch description. g_free() after +usage. + + + + + a #GstRTSPMediaFactory + + + + + + Return the GType of the GstRTSPMedia subclass this +factory will create. + + + + + + a #GstRTSPMediaFactory + + + + + + Get the multicast interface used for @factory. + + the multicast interface for @factory. g_free() after +usage. + + + + + a #GstRTSPMediaFactory + + + + + + Get the permissions object from @factory. + + a #GstRTSPPermissions object, unref after usage. + + + + + a #GstRTSPMediaFactory + + + + + + Get the allowed profiles of @factory. + + a #GstRTSPProfile + + + + + a #GstRTSPMediaFactory + + + + + + Get the allowed protocols of @factory. + + a #GstRTSPLowerTrans + + + + + a #GstRTSPMediaFactory + + + + + + Gets if and how the media clock should be published according to RFC7273. + + The GstRTSPPublishClockMode + + + + + a #GstRTSPMediaFactory + + + + + + Get the time that is stored for retransmission purposes + + a #GstClockTime + + + + + a #GstRTSPMediaFactory + + + + + + Get how media created from this factory will be suspended. + + a #GstRTSPSuspendMode. + + + + + a #GstRTSPMediaFactory + + + + + + Get if media created from this factory can be used for PLAY or RECORD +methods. + + The supported transport modes. + + + + + a #GstRTSPMediaFactory + + + + + + Get if media created from this factory will have an EOS event sent to the +pipeline before shutdown. + + %TRUE if the media will receive EOS before shutdown. + + + + + a #GstRTSPMediaFactory + + + + + + Get if media created from this factory can be shared between clients. + + %TRUE if the media will be shared between clients. + + + + + a #GstRTSPMediaFactory + + + + + + + + + + + + + + + + configure @pool to be used as the address pool of @factory. + + + + + + a #GstRTSPMediaFactory + + + + a #GstRTSPAddressPool + + + + + + Set the kernel UDP buffer size. + + + + + + a #GstRTSPMedia + + + + the new value + + + + + + Configures a specific clock to be used by the pipelines +of all medias created from this factory. + + + + + + a #GstRTSPMediaFactory + + + + the clock to be used by the media factory + + + + + + Configure if media created from this factory will have an EOS sent to the +pipeline before shutdown. + + + + + + a #GstRTSPMediaFactory + + + + the new value + + + + + + Configure the latency used for receiving media + + + + + + a #GstRTSPMediaFactory + + + + latency in milliseconds + + + + + + 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 description with brackets '(' +')'. + +The description should return a pipeline with payloaders named pay0, pay1, +etc.. Each of the payloaders will result in a stream. + + + + + + a #GstRTSPMediaFactory + + + + the launch description + + + + + + Configure the GType of the GstRTSPMedia subclass to +create (by default, overridden construct vmethods +may of course do something different) + + + + + + a #GstRTSPMediaFactory + + + + the GType of the class to create + + + + + + configure @multicast_iface to be used for @factory. + + + + + + a #GstRTSPMediaFactory + + + + a multicast interface name + + + + + + Set @permissions on @factory. + + + + + + a #GstRTSPMediaFactory + + + + a #GstRTSPPermissions + + + + + + Configure the allowed profiles for @factory. + + + + + + a #GstRTSPMediaFactory + + + + the new flags + + + + + + Configure the allowed lower transport for @factory. + + + + + + a #GstRTSPMediaFactory + + + + the new flags + + + + + + Sets if and how the media clock should be published according to RFC7273. + + + + + + a #GstRTSPMediaFactory + + + + the clock publish mode + + + + + + Configure the time to store for possible retransmission + + + + + + a #GstRTSPMediaFactory + + + + a #GstClockTime + + + + + + Configure if media created from this factory can be shared between clients. + + + + + + a #GstRTSPMediaFactory + + + + the new value + + + + + + Configure if media created from this factory should be stopped +when a client disconnects without sending TEARDOWN. + + + + + + a #GstRTSPMediaFactory + + + + the new value + + + + + + Configure how media created from this factory will be suspended. + + + + + + a #GstRTSPMediaFactory + + + + the new #GstRTSPSuspendMode + + + + + + Configure if this factory creates media for PLAY or RECORD modes. + + + + + + a #GstRTSPMediaFactory + + + + the new value + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The #GstRTSPMediaFactory class structure. + + + + + + + + + + + + + + + + + + + + + + a new #GstElement. + + + + + a #GstRTSPMediaFactory + + + + the url used + + + + + + + + + a new #GstRTSPMedia if the media could be prepared. + + + + + a #GstRTSPMediaFactory + + + + the url used + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A media factory that creates a pipeline to play and uri. + + Create a new #GstRTSPMediaFactoryURI instance. + + a new #GstRTSPMediaFactoryURI object. + + + + + Get the URI that will provide media for this factory. + + the configured URI. g_free() after usage. + + + + + a #GstRTSPMediaFactory + + + + + + Set the URI of the resource that will be streamed by this factory. + + + + + + a #GstRTSPMediaFactory + + + + the uri the stream + + + + + + + + + + + + + + + + + + + + + + + + The #GstRTSPMediaFactoryURI class structure. + + + + + + + + + + + + + + + The state of the media pipeline. + + media pipeline not prerolled + + + media pipeline is busy doing a clean + shutdown. + + + media pipeline is prerolling + + + media pipeline is prerolled + + + media is suspended + + + media pipeline is in error + + + + Creates a #GstRTSPMediaFactory object for a given url. + + Make a new mount points object. + + a new #GstRTSPMountPoints + + + + + Make a path string from @url. + + a path string for @url, g_free() after usage. + + + + + a #GstRTSPMountPoints + + + + a #GstRTSPUrl + + + + + + 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. + + + + + + a #GstRTSPMountPoints + + + + a mount point + + + + a #GstRTSPMediaFactory + + + + + + Make a path string from @url. + + a path string for @url, g_free() after usage. + + + + + a #GstRTSPMountPoints + + + + a #GstRTSPUrl + + + + + + 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. + + the #GstRTSPMediaFactory for @path. +g_object_unref() after usage. + + + + + a #GstRTSPMountPoints + + + + a mount point + + + + the amount of @path matched + + + + + + Remove the #GstRTSPMediaFactory associated with @path in @mounts. + + + + + + a #GstRTSPMountPoints + + + + a mount point + + + + + + + + + + + + + + + + + + The class for the media mounts object. + + + + + + + a path string for @url, g_free() after usage. + + + + + a #GstRTSPMountPoints + + + + a #GstRTSPUrl + + + + + + + + + + + + + + + The opaque permissions structure. It is used to define the permissions +of objects in different roles. + + + + + Create a new empty Authorization permissions. + + a new empty authorization permissions. + + + + + Add a new @role to @permissions with the given variables. The fields +are the same layout as gst_structure_new(). + + + + + + a #GstRTSPPermissions + + + + a role + + + + the first field name + + + + additional arguments + + + + + + 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(). + + + + + + a #GstRTSPPermissions + + + + a role + + + + the first field name + + + + additional fields to add + + + + + + Get all permissions for @role in @permissions. + + the structure with permissions for @role. It +remains valid for as long as @permissions is valid. + + + + + a #GstRTSPPermissions + + + + a role + + + + + + Check if @role in @permissions is given permission for @permission. + + %TRUE if @role is allowed @permission. + + + + + a #GstRTSPPermissions + + + + a role + + + + a permission + + + + + + Remove all permissions for @role in @permissions. + + + + + + a #GstRTSPPermissions + + + + a role + + + + + + + Whether the clock and possibly RTP/clock offset should be published according to RFC7273. + + Publish nothing + + + Publish the clock but not the offset + + + Publish the clock and offset + + + + Function registered with gst_rtsp_stream_transport_set_callbacks() and +called when @buffer must be sent on @channel. + + %TRUE on success + + + + + a #GstBuffer + + + + a channel + + + + user data + + + + + + This object listens on a port, creates and manages the clients connected to +it. + + Create a new #GstRTSPServer instance. + + a new #GstRTSPServer + + + + + A default #GSocketSourceFunc that creates a new #GstRTSPClient to accept and handle a +new connection on @socket or @server. + + TRUE if the source could be connected, FALSE if an error occurred. + + + + + a #GSocket + + + + the condition on @source + + + + a #GstRTSPServer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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. + +This takes a reference on @server until the source is destroyed. Note that +if @context is not the default main context as returned by +g_main_context_default() (or %NULL), g_source_remove() cannot be used to +destroy the source. In that case it is recommended to use +gst_rtsp_server_create_source() and attach it to @context manually. + + the ID (greater than 0) for the source within the GMainContext. + + + + + a #GstRTSPServer + + + + a #GMainContext + + + + + + 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. + + 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. + + + + + + + a #GstRTSPServer + + + + a callback + + + + user data passed to @func + + + + + + Create a #GSocket for @server. The socket will listen on the +configured service. + + the #GSocket for @server or %NULL when an error +occurred. + + + + + a #GstRTSPServer + + + + a #GCancellable + + + + + + 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(). + +This takes a reference on @server until @source is destroyed. + + the #GSource for @server or %NULL when an error +occurred. Free with g_source_unref () + + + + + a #GstRTSPServer + + + + a #GCancellable or %NULL. + + + + + + Get the address on which the server will accept connections. + + the server address. g_free() after usage. + + + + + a #GstRTSPServer + + + + + + Get the #GstRTSPAuth used as the authentication manager of @server. + + the #GstRTSPAuth of @server. g_object_unref() after +usage. + + + + + a #GstRTSPServer + + + + + + The maximum amount of queued requests for the server. + + the server backlog. + + + + + a #GstRTSPServer + + + + + + Get the port number where the server was bound to. + + the port number + + + + + a #GstRTSPServer + + + + + + Get the #GstRTSPMountPoints used as the mount points of @server. + + the #GstRTSPMountPoints of @server. g_object_unref() after +usage. + + + + + a #GstRTSPServer + + + + + + Get the service on which the server will accept connections. + + the service. use g_free() after usage. + + + + + a #GstRTSPServer + + + + + + Get the #GstRTSPSessionPool used as the session pool of @server. + + the #GstRTSPSessionPool used for sessions. g_object_unref() after +usage. + + + + + a #GstRTSPServer + + + + + + Get the #GstRTSPThreadPool used as the thread pool of @server. + + the #GstRTSPThreadPool of @server. g_object_unref() after +usage. + + + + + a #GstRTSPServer + + + + + + Configure @server to accept connections on the given address. + +This function must be called before the server is bound. + + + + + + a #GstRTSPServer + + + + the address + + + + + + configure @auth to be used as the authentication manager of @server. + + + + + + a #GstRTSPServer + + + + a #GstRTSPAuth + + + + + + configure the maximum amount of requests that may be queued for the +server. + +This function must be called before the server is bound. + + + + + + a #GstRTSPServer + + + + the backlog + + + + + + configure @mounts to be used as the mount points of @server. + + + + + + a #GstRTSPServer + + + + a #GstRTSPMountPoints + + + + + + 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. + + + + + + a #GstRTSPServer + + + + the service + + + + + + configure @pool to be used as the session pool of @server. + + + + + + a #GstRTSPServer + + + + a #GstRTSPSessionPool + + + + + + configure @pool to be used as the thread pool of @server. + + + + + + a #GstRTSPServer + + + + a #GstRTSPThreadPool + + + + + + 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. + + TRUE if all was ok, FALSE if an error occurred. + + + + + a #GstRTSPServer + + + + a network socket + + + + the IP address of the remote client + + + + the port used by the other end + + + + any initial data that was already read from the socket + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The RTSP server class structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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(). + + a #GstRTSPFilterResult. + + + + + a #GstRTSPServer object + + + + a #GstRTSPClient in @server + + + + user data that has been given to gst_rtsp_server_client_filter() + + + + + + + + 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. + + Create a new #GstRTSPSession instance with @sessionid. + + a new #GstRTSPSession + + + + + a session id + + + + + + Allow @session to expire. This method must be called an equal +amount of time as gst_rtsp_session_prevent_expire(). + + + + + + a #GstRTSPSession + + + + + + 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. + + 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. + + + + + + + a #GstRTSPSession + + + + a callback + + + + user data passed to @func + + + + + + Get the string that can be placed in the Session header field. + + the Session header of @session. +g_free() after usage. + + + + + a #GstRTSPSession + + + + + + Get the session media for @path. @matched will contain the number of matched +characters of @path. + + the configuration for @path in @sess. + + + + + a #GstRTSPSession + + + + the path for the media + + + + the amount of matched characters + + + + + + Get the sessionid of @session. + + the sessionid of @session. +The value remains valid as long as @session is alive. + + + + + a #GstRTSPSession + + + + + + Get the timeout value of @session. + + the timeout of @session in seconds. + + + + + a #GstRTSPSession + + + + + + Check if @session timeout out. + Use gst_rtsp_session_is_expired_usec() instead. + + %TRUE if @session timed out + + + + + a #GstRTSPSession + + + + the current system time + + + + + + Check if @session timeout out. + + %TRUE if @session timed out + + + + + a #GstRTSPSession + + + + the current monotonic time + + + + + + 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. + + a new @GstRTSPSessionMedia object. + + + + + a #GstRTSPSession + + + + the path for the media + + + + a #GstRTSPMedia + + + + + + Get the amount of milliseconds till the session will expire. + Use gst_rtsp_session_next_timeout_usec() instead. + + the amount of milliseconds since the session will time out. + + + + + a #GstRTSPSession + + + + the current system time + + + + + + Get the amount of milliseconds till the session will expire. + + the amount of milliseconds since the session will time out. + + + + + a #GstRTSPSession + + + + the current monotonic time + + + + + + Prevent @session from expiring. + + + + + + a #GstRTSPSession + + + + + + Release the managed @media in @sess, freeing the memory allocated by it. + + %TRUE if there are more media session left in @sess. + + + + + a #GstRTSPSession + + + + a #GstRTSPMedia + + + + + + Configure @session for a timeout of @timeout seconds. The session will be +cleaned up when there is no activity for @timeout seconds. + + + + + + a #GstRTSPSession + + + + the new timeout + + + + + + Update the last_access time of the session to the current time. + + + + + + a #GstRTSPSession + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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(). + + a #GstRTSPFilterResult. + + + + + a #GstRTSPSession object + + + + a #GstRTSPSessionMedia in @sess + + + + user data that has been given to gst_rtsp_session_filter() + + + + + + State of a client session regarding a specific media identified by path. + + Create a new #GstRTSPSessionMedia that manages the streams +in @media for @path. @media should be prepared. + +Ownership is taken of @media. + + a new #GstRTSPSessionMedia. + + + + + the path + + + + the #GstRTSPMedia + + + + + + Fill @range with the next available min and max channels for +interleaved transport. + + %TRUE on success. + + + + + a #GstRTSPSessionMedia + + + + a #GstRTSPRange + + + + + + Get the base_time of the #GstRTSPMedia in @media + + the base_time of the media. + + + + + a #GstRTSPSessionMedia + + + + + + Get the #GstRTSPMedia that was used when constructing @media + + the #GstRTSPMedia of @media. +Remains valid as long as @media is valid. + + + + + a #GstRTSPSessionMedia + + + + + + Retrieve the RTP-Info header string for all streams in @media +with configured transports. + + The RTP-Info as a string or +%NULL when no RTP-Info could be generated, g_free() after usage. + + + + + a #GstRTSPSessionMedia + + + + + + Get the current RTSP state of @media. + + the current RTSP state of @media. + + + + + a #GstRTSPSessionMedia + + + + + + Get a previously created #GstRTSPStreamTransport for the stream at @idx. + + a #GstRTSPStreamTransport that is +valid until the session of @media is unreffed. + + + + + a #GstRTSPSessionMedia + + + + the stream index + + + + + + Check if the path of @media matches @path. It @path matches, the amount of +matched characters is returned in @matched. + + %TRUE when @path matches the path of @media. + + + + + a #GstRTSPSessionMedia + + + + a path + + + + the amount of matched characters of @path + + + + + + Set the RTSP state of @media to @state. + + + + + + a #GstRTSPSessionMedia + + + + a #GstRTSPState + + + + + + Tell the media object @media to change to @state. + + %TRUE on success. + + + + + a #GstRTSPSessionMedia + + + + the new state + + + + + + Configure the transport for @stream to @tr in @media. + + the new or updated #GstRTSPStreamTransport for @stream. + + + + + a #GstRTSPSessionMedia + + + + a #GstRTSPStream + + + + a #GstRTSPTransport + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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. + + Create a new #GstRTSPSessionPool instance. + + A new #GstRTSPSessionPool. g_object_unref() after +usage. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inspect all the sessions in @pool and remove the sessions that are inactive +for more than their timeout. + + the amount of sessions that got removed. + + + + + a #GstRTSPSessionPool + + + + + + Create a new #GstRTSPSession object in @pool. + + a new #GstRTSPSession. + + + + + a #GstRTSPSessionPool + + + + + + Create a #GSource that will be dispatched when the session should be cleaned +up. + + a #GSource + + + + + a #GstRTSPSessionPool + + + + + + 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. + + 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. + + + + + + + a #GstRTSPSessionPool + + + + a callback + + + + user data passed to @func + + + + + + Find the session with @sessionid in @pool. The access time of the session +will be updated with gst_rtsp_session_touch(). + + the #GstRTSPSession with @sessionid +or %NULL when the session did not exist. g_object_unref() after usage. + + + + + the pool to search + + + + the session id + + + + + + Get the maximum allowed number of sessions in @pool. 0 means an unlimited +amount of sessions. + + the maximum allowed number of sessions. + + + + + a #GstRTSPSessionPool + + + + + + Get the amount of active sessions in @pool. + + the amount of active sessions in @pool. + + + + + a #GstRTSPSessionPool + + + + + + Remove @sess from @pool, releasing the ref that the pool has on @sess. + + %TRUE if the session was found and removed. + + + + + a #GstRTSPSessionPool + + + + a #GstRTSPSession + + + + + + Configure the maximum allowed number of sessions in @pool to @max. +A value of 0 means an unlimited amount of sessions. + + + + + + a #GstRTSPSessionPool + + + + the maximum number of sessions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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(). + + a #GstRTSPFilterResult. + + + + + a #GstRTSPSessionPool object + + + + a #GstRTSPSession in @pool + + + + user data that has been given to gst_rtsp_session_pool_filter() + + + + + + 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. + + %FALSE if the source should be removed. + + + + + a #GstRTSPSessionPool object + + + + user data that has been given when registering the handler + + + + + + + + + + The definition of a media stream. + + Create a new media stream with index @idx that handles RTP data on +@pad and has a payloader element @payloader if @pad is a source pad +or a depayloader element @payloader if @pad is a sink pad. + + a new #GstRTSPStream + + + + + an index + + + + a #GstElement + + + + a #GstPad + + + + + + 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. + + %TRUE if @trans was added + + + + + a #GstRTSPStream + + + + a #GstRTSPStreamTransport + + + + + + Allocates RTP and RTCP ports. + This function shouldn't have been made public + + %TRUE if the RTP and RTCP sockets have been succeccully allocated. + + + + + a #GstRTSPStream + + + + protocol family + + + + transport method + + + + Whether to use client settings or not + + + + + + Get the #GstRTSPAddressPool used as the address pool of @stream. + + the #GstRTSPAddressPool of @stream. +g_object_unref() after usage. + + + + + a #GstRTSPStream + + + + + + Get the size of the UDP transmission buffer (in bytes) + + the size of the UDP TX buffer + + + + + a #GstRTSPStream + + + + + + Retrieve the current caps of @stream. + + the #GstCaps of @stream. +use gst_caps_unref() after usage. + + + + + a #GstRTSPStream + + + + + + Get the control string to identify this stream. + + the control string. g_free() after usage. + + + + + a #GstRTSPStream + + + + + + + + + + + + + + + + Get the configured DSCP QoS in of the outgoing sockets. + + the DSCP QoS value of the outgoing sockets, or -1 if disbled. + + + + + a #GstRTSPStream + + + + + + Get the stream index. + + the stream index. + + + + + a #GstRTSPStream + + + + + + Get the previous joined bin with gst_rtsp_stream_join_bin() or NULL. + + the joined bin or NULL. + + + + + a #GstRTSPStream + + + + + + Get the configured MTU in the payloader of @stream. + + the MTU of the payloader. + + + + + a #GstRTSPStream + + + + + + Get the multicast address of @stream for @family. The original +#GstRTSPAddress is cached and copy is returned, so freeing the return value +won't release the address from the pool. + + the #GstRTSPAddress of @stream +or %NULL when no address could be allocated. gst_rtsp_address_free() +after usage. + + + + + a #GstRTSPStream + + + + the #GSocketFamily + + + + + + Get the multicast interface used for @stream. + + the multicast interface for @stream. +g_free() after usage. + + + + + a #GstRTSPStream + + + + + + Get the allowed profiles of @stream. + + a #GstRTSPProfile + + + + + a #GstRTSPStream + + + + + + Get the allowed protocols of @stream. + + a #GstRTSPLowerTrans + + + + + a #GstRTSPStream + + + + + + Get the stream payload type. + + the stream payload type. + + + + + a #GstRTSPStream + + + + + + Gets if and how the stream clock should be published according to RFC7273. + + The GstRTSPPublishClockMode + + + + + a #GstRTSPStream + + + + + + Get the payload-type used for retransmission of this stream + + The retransmission PT. + + + + + a #GstRTSPStream + + + + + + Get the amount of time to store retransmission data. + + the amount of time to store retransmission data. + + + + + a #GstRTSPStream + + + + + + Get the RTCP socket from @stream for a @family. + +@stream must be joined to a bin. + + the RTCP socket or %NULL if no +socket could be allocated for @family. Unref after usage + + + + + a #GstRTSPStream + + + + the socket family + + + + + + Get the RTP socket from @stream for a @family. + +@stream must be joined to a bin. + + the RTP socket or %NULL if no +socket could be allocated for @family. Unref after usage + + + + + a #GstRTSPStream + + + + the socket family + + + + + + Retrieve the current rtptime, seq and running-time. This is used to +construct a RTPInfo reply header. + + %TRUE when rtptime, seq and running-time could be determined. + + + + + a #GstRTSPStream + + + + result RTP timestamp + + + + result RTP seqnum + + + + the clock rate + + + + result running-time + + + + + + Get the RTP session of this stream. + + The RTP session of this stream. Unref after usage. + + + + + a #GstRTSPStream + + + + + + Fill @server_port with the port pair used by the server. This function can +only be called when @stream has been joined. + + + + + + a #GstRTSPStream + + + + result server port + + + + the port family to get + + + + + + Get the sinkpad associated with @stream. + + the sinkpad. Unref after usage. + + + + + a #GstRTSPStream + + + + + + Get the srcpad associated with @stream. + + the srcpad. Unref after usage. + + + + + a #GstRTSPStream + + + + + + Get the SRTP encoder for this stream. + + The SRTP encoder for this stream. Unref after usage. + + + + + a #GstRTSPStream + + + + + + Get the SSRC used by the RTP session of this stream. This function can only +be called when @stream has been joined. + + + + + + a #GstRTSPStream + + + + result ssrc + + + + + + Check if @stream has the control string @control. + + %TRUE is @stream has @control as the control string + + + + + a #GstRTSPStream + + + + a control string + + + + + + Check if @stream is blocking on a #GstBuffer. + + %TRUE if @stream is blocking + + + + + a #GstRTSPStream + + + + + + See gst_rtsp_stream_set_client_side() + + TRUE if this #GstRTSPStream is client-side. + + + + + a #GstRTSPStream + + + + + + Check if @transport can be handled by stream + + %TRUE if @transport can be handled by @stream. + + + + + a #GstRTSPStream + + + + a #GstRTSPTransport + + + + + + 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. + + %TRUE on success. + + + + + a #GstRTSPStream + + + + a #GstBin to join + + + + a rtpbin element in @bin + + + + the target state of the new elements + + + + + + Remove the elements of @stream from @bin. + + %TRUE on success. + + + + + a #GstRTSPStream + + + + a #GstBin + + + + a rtpbin #GstElement + + + + + + Query the position of the stream in %GST_FORMAT_TIME. This only considers +the RTP parts of the pipeline and not the RTCP parts. + + %TRUE if the position could be queried + + + + + a #GstRTSPStream + + + + current position of 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. + + %TRUE if the stop could be queried + + + + + a #GstRTSPStream + + + + current stop of a #GstRTSPStream + + + + + + 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. + + a GstFlowReturn. + + + + + a #GstRTSPStream + + + + 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. + + a GstFlowReturn. + + + + + a #GstRTSPStream + + + + a #GstBuffer + + + + + + 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. + + %TRUE if @trans was removed + + + + + a #GstRTSPStream + + + + a #GstRTSPStreamTransport + + + + + + Creating a rtxsend bin + + a #GstElement. + + + + + a #GstRTSPStream + + + + the session id + + + + + + Reserve @address and @port as the address and port of @stream. The original +#GstRTSPAddress is cached and copy is returned, so freeing the return value +won't release the address from the pool. + + the #GstRTSPAddress of @stream or %NULL when +the address could be reserved. gst_rtsp_address_free() after usage. + + + + + a #GstRTSPStream + + + + an address + + + + a port + + + + n_ports + + + + a TTL + + + + + + configure @pool to be used as the address pool of @stream. + + + + + + a #GstRTSPStream + + + + a #GstRTSPAddressPool + + + + + + Blocks or unblocks the dataflow on @stream. + + %TRUE on success + + + + + a #GstRTSPStream + + + + boolean indicating we should block or unblock + + + + + + Set the size of the UDP transmission buffer (in bytes) +Needs to be set before the stream is joined to a bin. + + + + + + a #GstRTSPStream + + + + the buffer size + + + + + + Sets the #GstRTSPStream as a 'client side' stream - used for sending +streams to an RTSP server via RECORD. This has the practical effect +of changing which UDP port numbers are used when setting up the local +side of the stream sending to be either the 'server' or 'client' pair +of a configured UDP transport. + + + + + + a #GstRTSPStream + + + + TRUE if this #GstRTSPStream is running on the 'client' side of +an RTSP connection. + + + + + + Set the control string in @stream. + + + + + + a #GstRTSPStream + + + + a control string + + + + + + Configure the dscp qos of the outgoing sockets to @dscp_qos. + + + + + + a #GstRTSPStream + + + + a new dscp qos value (0-63, or -1 to disable) + + + + + + Configure the mtu in the payloader of @stream to @mtu. + + + + + + a #GstRTSPStream + + + + a new MTU + + + + + + configure @multicast_iface to be used for @stream. + + + + + + a #GstRTSPStream + + + + a multicast interface name + + + + + + Configure the allowed profiles for @stream. + + + + + + a #GstRTSPStream + + + + the new profiles + + + + + + Configure the allowed lower transport for @stream. + + + + + + a #GstRTSPStream + + + + the new flags + + + + + + Configure a pt map between @pt and @caps. + + + + + + a #GstRTSPStream + + + + the pt + + + + a #GstCaps + + + + + + Sets if and how the stream clock should be published according to RFC7273. + + + + + + a #GstRTSPStream + + + + the clock publish mode + + + + + + Set the payload type (pt) for retransmission of this stream. + + + + + + a #GstRTSPStream + + + + a #guint + + + + + + Set the amount of time to store retransmission packets. + + + + + + a #GstRTSPStream + + + + a #GstClockTime + + + + + + + + + + + + + + + + + + + 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. + + 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. + + + + + + + a #GstRTSPStream + + + + a callback + + + + user data passed to @func + + + + + + 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. + + %TRUE if @crypto could be updated + + + + + a #GstRTSPStream + + + + the SSRC + + + + a #GstCaps with crypto info + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Transport description for a stream + + Create a new #GstRTSPStreamTransport that can be used to manage +@stream with transport @tr. + + a new #GstRTSPStreamTransport + + + + + a #GstRTSPStream + + + + a GstRTSPTransport + + + + + + Get the RTP-Info string for @trans and @start_time. + + the RTPInfo string for @trans +and @start_time or %NULL when the RTP-Info could not be +determined. g_free() after usage. + + + + + a #GstRTSPStreamTransport + + + + a star time + + + + + + Get the #GstRTSPStream used when constructing @trans. + + the stream used when constructing @trans. + + + + + a #GstRTSPStreamTransport + + + + + + Get the transport configured in @trans. + + the transport configured in @trans. It remains +valid for as long as @trans is valid. + + + + + a #GstRTSPStreamTransport + + + + + + Get the url configured in @trans. + + the url configured in @trans. +It remains valid for as long as @trans is valid. + + + + + a #GstRTSPStreamTransport + + + + + + Check if @trans is timed out. + + %TRUE if @trans timed out. + + + + + a #GstRTSPStreamTransport + + + + + + Signal the installed keep_alive callback for @trans. + + + + + + a #GstRTSPStreamTransport + + + + + + Receive @buffer on @channel @trans. + + a #GstFlowReturn. Returns GST_FLOW_NOT_LINKED when @channel is not + configured in the transport of @trans. + + + + + a #GstRTSPStreamTransport + + + + a channel + + + + a #GstBuffer + + + + + + Send @buffer to the installed RTCP callback for @trans. + + %TRUE on success + + + + + a #GstRTSPStreamTransport + + + + a #GstBuffer + + + + + + Send @buffer to the installed RTP callback for @trans. + + %TRUE on success + + + + + a #GstRTSPStreamTransport + + + + a #GstBuffer + + + + + + Activate or deactivate datatransfer configured in @trans. + + %TRUE when the state was changed. + + + + + a #GstRTSPStreamTransport + + + + new state of @trans + + + + + + 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. + + + + + + a #GstRTSPStreamTransport + + + + a callback called when RTP should be sent + + + + a callback called when RTCP should be sent + + + + user data passed to callbacks + + + + 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. + + + + + + a #GstRTSPStreamTransport + + + + a callback called when the receiver is active + + + + user data passed to callback + + + + called with the user_data when no longer needed. + + + + + + Set the timed out state of @trans to @timedout + + + + + + a #GstRTSPStreamTransport + + + + timed out value + + + + + + Set @tr as the client transport. This function takes ownership of the +passed @tr. + + + + + + a #GstRTSPStreamTransport + + + + a client #GstRTSPTransport + + + + + + Set @url as the client url. + + + + + + a #GstRTSPStreamTransport + + + + a client #GstRTSPUrl + + + + + + parent instance + + + + + + + + + + + + + + + + + + + + + + + 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(). + + a #GstRTSPFilterResult. + + + + + a #GstRTSPStream object + + + + a #GstRTSPStreamTransport in @stream + + + + user data that has been given to gst_rtsp_stream_transport_filter() + + + + + + + + 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. + + Media is not suspended + + + Media is PAUSED in suspend + + + The media is set to NULL when suspended + + + + Structure holding info about a mainloop running in a thread + + parent #GstMiniObject + + + + the thread type + + + + a #GMainContext + + + + a #GMainLoop + + + + Create a new thread object that can run a mainloop. + + a #GstRTSPThread. + + + + + the thread type + + + + + + Reuse the mainloop of @thread + + %TRUE if the mainloop could be reused + + + + + 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. + + + + + + a #GstRTSPThread + + + + + + + The thread pool structure. + + Create a new #GstRTSPThreadPool instance. + + a new #GstRTSPThreadPool + + + + + 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. + + + + + + + + + + + + + + + + + + + + + + Get a new #GstRTSPThread for @type and @ctx. + + a new #GstRTSPThread, +gst_rtsp_thread_stop() after usage + + + + + a #GstRTSPThreadPool + + + + the #GstRTSPThreadType + + + + a #GstRTSPContext + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get the maximum number of threads used for client connections. +See gst_rtsp_thread_pool_set_max_threads(). + + the maximum number of threads. + + + + + a #GstRTSPThreadPool + + + + + + Get a new #GstRTSPThread for @type and @ctx. + + a new #GstRTSPThread, +gst_rtsp_thread_stop() after usage + + + + + a #GstRTSPThreadPool + + + + the #GstRTSPThreadType + + + + a #GstRTSPContext + + + + + + 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. + + + + + + a #GstRTSPThreadPool + + + + maximum threads + + + + + + + + + + + + + + + + + + + + + Class for managing threads. + + + + + a #GThreadPool used internally + + + + + + a new #GstRTSPThread, +gst_rtsp_thread_stop() after usage + + + + + a #GstRTSPThreadPool + + + + the #GstRTSPThreadType + + + + a #GstRTSPContext + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Different thread types + + a thread to handle the client communication + + + a thread to handle media + + + + An opaque object used for checking authorisations. +It is generated after successful authentication. + + + + + Create a new Authorization token with the given fieldnames and values. +Arguments are given similar to gst_structure_new(). + + a new authorization token. + + + + + the first fieldname + + + + additional arguments + + + + + + Create a new empty Authorization token. + + a new empty authorization token. + + + + + Create a new Authorization token with the given fieldnames and values. +Arguments are given similar to gst_structure_new_valist(). + + a new authorization token. + + + + + the first fieldname + + + + additional arguments + + + + + + Get the string value of @field in @token. + + the string value of @field in +@token or %NULL when @field is not defined in @token. The string +becomes invalid when you free @token. + + + + + a #GstRTSPToken + + + + a field name + + + + + + Access the structure of the token. + + 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. + + + + + The #GstRTSPToken. + + + + + + Check if @token has a boolean @field and if it is set to %TRUE. + + %TRUE if @token has a boolean field named @field set to %TRUE. + + + + + a #GstRTSPToken + + + + a field name + + + + + + Get a writable version of the structure. + + 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. + + + + + The #GstRTSPToken. + + + + + + + The supported modes of the media. + + Transport supports PLAY mode + + + Transport supports RECORD mode + + + + Used with gst_rtsp_address_pool_add_range() to bind to all +IPv4 addresses + + + + Used with gst_rtsp_address_pool_add_range() to bind to all +IPv6 addresses + + + + Check a new connection + + + + Check if access is allowed to a factory. +When access is not allowed an 404 Not Found is sent in the response. + + + + Check if media can be constructed from a media factory +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. + + + + Check the URL and methods + + + + G_TYPE_BOOLEAN, %TRUE if the media can be accessed, %FALSE will +return a 404 Not Found error when trying to access the media. + + + + G_TYPE_BOOLEAN, %TRUE if the media can be constructed, %FALSE will +return a 404 Not Found error when trying to access the media. + + + + 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. + + + + G_TYPE_BOOLEAN, %TRUE if the client can specify TTL, destination and + port pair in multicast. + + + + + + + + + + + + Get the current #GstRTSPContext. This object is retrieved from the +current thread that is handling the request for a client. + + a #GstRTSPContext + + + + + + + + + + Get parameters (not implemented yet) + + a #GstRTSPResult + + + + + a #GstRTSPClient + + + + a #GstRTSPContext + + + + + + Set parameters (not implemented yet) + + a #GstRTSPResult + + + + + a #GstRTSPClient + + + + a #GstRTSPContext + + + + + + Add @media specific info to @sdp. @info is used to configure the connection +information in the SDP. + + TRUE on success. + + + + + a #GstSDPMessage + + + + a #GstSDPInfo + + + + a #GstRTSPMedia + + + + + + Add info from @stream to @sdp. + + TRUE on success. + + + + + a #GstSDPMessage + + + + a #GstSDPInfo + + + + a #GstRTSPStream + + + + + + diff --git a/gir-files/GstSdp-1.0.gir b/gir-files/GstSdp-1.0.gir new file mode 100644 index 000000000..db78f9dce --- /dev/null +++ b/gir-files/GstSdp-1.0.gir @@ -0,0 +1,4309 @@ + + + + + + + + + The different cache types + + The envelope key MUST NOT be cached + + + The envelope key MUST be cached + + + The envelope key MUST be cached, but only + to be used for the specific CSB. + + + + + + The encryption algorithm used to encrypt the Encr data field + + no encryption + + + AES-CM using a 128-bit key + + + AES Key Wrap using a 128-bit key + + + + + + The key validity type + + No specific usage rule + + + The key is associated with the SPI/MKI + + + The key has a start and expiration time + + + + The type of key. + + a TEK Generation Key + + + Traffic-Encrypting Key + + + + Specifies the authentication algorithm used + + no authentication + + + HMAC-SHA-1-160 + + + + The Security policy Map item for SRTP + + The security policy applied for the stream with @ssrc + + + + the SSRC that must be used for the stream + + + + current rollover counter + + + + + Specifies the method of uniquely mapping Crypto Sessions to the security +protocol sessions. + + + + + Structure holding the information of the MIKEY message + + + + + the version + + + + the #GstMIKEYType message type + + + + verify flag + + + + a #GstMIKEYPRFFunc + + + + Identifies the Crypto Session Bundle + + + + a #GstMIKEYMapType + + + + map info array of type depending on @map_type + + + + + + the payload array of #GstMIKEYPayload + + + + + + Make a new MIKEY message. + + a new #GstMIKEYMessage on success + + + + + Make a new #GstMIKEYMessage from @bytes. + + a new #GstMIKEYMessage + + + + + a #GBytes + + + + a #GstMIKEYDecryptInfo + + + + + + Makes mikey message including: + - Security Policy Payload + - Key Data Transport Payload + - Key Data Sub-Payload + + a #GstMIKEYMessage, +or %NULL if there is no srtp information in the caps. + + + + + a #GstCaps, including SRTP parameters (srtp/srtcp cipher, authorization, key data) + + + + + + Parse @size bytes from @data into a #GstMIKEYMessage. @info contains the +parameters to decrypt and verify the data. + + a #GstMIKEYMessage on success or %NULL when parsing failed and +@error will be set. + + + + + bytes to read + + + + + + length of @data + + + + #GstMIKEYDecryptInfo + + + + + + Add a Crypto policy for SRTP to @msg. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + The security policy applied for the stream with @ssrc + + + + the SSRC that must be used for the stream + + + + current rollover counter + + + + + + Add a new payload to @msg. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + a #GstMIKEYPayload + + + + + + Add a new PKE payload to @msg with the given parameters. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + envelope key cache indicator + + + + the length of @data + + + + the encrypted envelope key + + + + + + + + Add a new RAND payload to @msg with the given parameters. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + the length of @rand + + + + random data + + + + + + + + Add a new RAND payload to @msg with @len random bytes. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + length + + + + + + Add a new T payload to @msg with the given parameters. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + specifies the timestamp type used + + + + The timestamp value of the specified @type + + + + + + + + Add a new T payload to @msg that contains the current time +in NTP-UTC format. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + + + + a #gchar, base64-encoded data + + + + + a #GstMIKEYMessage + + + + + + Find the @nth occurence of the payload with @type in @msg. + + the @nth #GstMIKEYPayload of @type. + + + + + a #GstMIKEYMessage + + + + a #GstMIKEYPayloadType + + + + payload to find + + + + + + Get the policy information of @msg at @idx. + + a #GstMIKEYMapSRTP + + + + + a #GstMIKEYMessage + + + + an index + + + + + + Get the number of crypto sessions in @msg. + + the number of crypto sessions + + + + + a #GstMIKEYMessage + + + + + + Get the number of payloads in @msg. + + the number of payloads in @msg + + + + + a #GstMIKEYMessage + + + + + + Get the #GstMIKEYPayload at @idx in @msg + + the #GstMIKEYPayload at @idx. The payload +remains valid for as long as it is part of @msg. + + + + + a #GstMIKEYMessage + + + + an index + + + + + + Insert a Crypto Session map for SRTP in @msg at @idx + +When @idx is -1, the policy will be appended. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + the index to insert at + + + + the map info + + + + + + Insert the @payload at index @idx in @msg. If @idx is -1, the payload +will be appended to @msg. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + an index + + + + a #GstMIKEYPayload + + + + + + Remove the SRTP policy at @idx. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + the index to remove + + + + + + Remove the payload in @msg at @idx + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + an index + + + + + + Replace a Crypto Session map for SRTP in @msg at @idx with @map. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + the index to insert at + + + + the map info + + + + + + Replace the payload at @idx in @msg with @payload. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + an index + + + + a #GstMIKEYPayload + + + + + + Set the information in @msg. + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + a version + + + + a #GstMIKEYType + + + + verify flag + + + + the #GstMIKEYPRFFunc function to use + + + + the Crypto Session Bundle id + + + + the #GstMIKEYCSIDMapType + + + + + + Convert @msg to a #GBytes. + + a new #GBytes for @msg. + + + + + a #GstMIKEYMessage + + + + a #GstMIKEYEncryptInfo + + + + + + + %TRUE on success + + + + + a #GstMIKEYMessage + + + + a #GstCaps to be filled with SRTP parameters (srtp/srtcp cipher, authorization, key data) + + + + + + + The PRF function that has been/will be used for key derivation + + MIKEY-1 PRF function + + + + Hold the common fields for all payloads + + + + + the payload type + + + + length of the payload + + + + Make a new #GstMIKEYPayload with @type. + + a new #GstMIKEYPayload or %NULL on failure. + + + + + a #GstMIKEYPayloadType + + + + + + Add a new sub payload to @payload. + + %TRUE on success. + + + + + a #GstMIKEYPayload + + + + a #GstMIKEYPayload to add + + + + + + Get the number of sub payloads of @payload. @payload should be of type +%GST_MIKEY_PT_KEMAC. + + the number of sub payloads in @payload + + + + + a #GstMIKEYPayload + + + + + + Get the sub payload of @payload at @idx. @payload should be of type +%GST_MIKEY_PT_KEMAC. + + the #GstMIKEYPayload at @idx. + + + + + a #GstMIKEYPayload + + + + an index + + + + + + Remove the sub payload at @idx in @payload. + + %TRUE on success. + + + + + a #GstMIKEYPayload + + + + the index to remove + + + + + + Set the KEMAC parameters. @payload should point to a %GST_MIKEY_PT_KEMAC +payload. + + %TRUE on success + + + + + a #GstMIKEYPayload + + + + the #GstMIKEYEncAlg + + + + a #GstMIKEYMacAlg + + + + + + Set the key validity period in the %GST_MIKEY_PT_KEY_DATA @payload. + + %TRUE on success + + + + + a #GstMIKEYPayload + + + + the length of @vf_data + + + + the Valid From data + + + + + + the length of @vt_data + + + + the Valid To data + + + + + + + + Set @key_len bytes of @key_data of type @key_type as the key for the +%GST_MIKEY_PT_KEY_DATA @payload. + + %TRUE on success + + + + + a #GstMIKEYPayload + + + + a #GstMIKEYKeyDataType + + + + the length of @key_data + + + + the key of type @key_type + + + + + + + + Set the salt key data. If @salt_len is 0 and @salt_data is %NULL, the +salt data will be removed. + + %TRUE on success + + + + + a #GstMIKEYPayload + + + + the length of @salt_data + + + + the salt + + + + + + + + Set the SPI/MKI validity in the %GST_MIKEY_PT_KEY_DATA @payload. + + %TRUE on success + + + + + a #GstMIKEYPayload + + + + the length of @spi_data + + + + the SPI/MKI data + + + + + + + + Set the PKE values in @payload. @payload must be of type +%GST_MIKEY_PT_PKE. + + %TRUE on success + + + + + a #GstMIKEYPayload + + + + envelope key cache indicator + + + + the length of @data + + + + the encrypted envelope key + + + + + + + + Set the random values in a %GST_MIKEY_PT_RAND @payload. + + %TRUE on success + + + + + a #GstMIKEYPayload + + + + the length of @rand + + + + random values + + + + + + + + Add a new parameter to the %GST_MIKEY_PT_SP @payload with @type, @len +and @val. + + %TRUE on success + + + + + a #GstMIKEYPayload + + + + a type + + + + a length + + + + @len bytes of data + + + + + + + + Get the number of security policy parameters in a %GST_MIKEY_PT_SP +@payload. + + the number of parameters in @payload + + + + + a #GstMIKEYPayload + + + + + + Get the Security Policy parameter in a %GST_MIKEY_PT_SP @payload +at @idx. + + the #GstMIKEYPayloadSPParam at @idx in @payload + + + + + a #GstMIKEYPayload + + + + an index + + + + + + Remove the Security Policy parameters from a %GST_MIKEY_PT_SP +@payload at @idx. + + %TRUE on success + + + + + a #GstMIKEYPayload + + + + an index + + + + + + Set the Security Policy parameters for @payload. + + %TRUE on success + + + + + a #GstMIKEYPayload + + + + the policy number + + + + a #GstMIKEYSecProto + + + + + + Set the timestamp in a %GST_MIKEY_PT_T @payload. + + %TRUE on success + + + + + a #GstMIKEYPayload + + + + the #GstMIKEYTSType + + + + the timestamp value + + + + + + + + + A structure holding the KEMAC payload + + the common #GstMIKEYPayload + + + + the #GstMIKEYEncAlg + + + + the #GstMIKEYMacAlg + + + + the subpayloads + + + + + + + The Key data payload contains key material. It should be added as sub +payload to the KEMAC. + + the payload header + + + + + + + length of @key_data + + + + + + + the length of @salt_data, can be 0 + + + + salt data + + + + the Key Validity type + + + + length of @kv_data + + + + + + key validity data + + + + + + + The Envelope data payload contains the encrypted envelope key that is +used in the public-key transport to protect the data in the Key data +transport payload. The encryption algorithm used is implicit from +the certificate/public key used. + + the common #GstMIKEYPayload + + + + envelope key cache indicator + + + + length of @data + + + + the encrypted envelope key + + + + + The RAND payload consists of a (pseudo-)random bit-string + + the payload header + + + + the length of @rand + + + + random values + + + + + The Security Policy payload defines a set of policies that apply to a +specific security protocol + + the payload header + + + + the policy number + + + + the security protocol + + + + array of #GstMIKEYPayloadPSParam + + + + + + + A Type/Length/Value field for security paramaters + + specifies the type of the parameter + + + + specifies the length of @val + + + + specifies the value of the parameter + + + + + The timestamp payload carries the timestamp information + + the payload header + + + + a #GstMIKEYTSType + + + + the timestamp value + + + + + Different MIKEY Payload types. + + Last payload + + + Key data transport payload + + + Envelope data payload + + + DH data payload + + + Signature payload + + + Timestamp payload + + + ID payload + + + Certificate Payload + + + Cert hash payload + + + Verfication message payload + + + Security Policy payload + + + RAND payload + + + Error payload + + + Key data sub-payload + + + General Extension Payload + + + + Specifies the security protocol + + + + + This policy specifies the parameters for SRTP and SRTCP + + Encryption algorithm + + + Session Encr. key length + + + Authentication algorithm + + + Session Auth. key length + + + Session Salt key length + + + SRTP Pseudo Random Function + + + Key derivation rate + + + SRTP encryption off/on, 0 if off, 1 if on + + + SRTCP encryption off/on, 0 if off, 1 if on + + + sender's FEC order + + + SRTP authentication off/on, 0 if off, 1 if on + + + Authentication tag length + + + SRTP prefix length + + + + Specifies the timestamp type. + + an NTP time in UTC timezone + + + an NTP time + + + a counter + + + + Different MIKEY data types. + + Invalid type + + + Initiator's pre-shared key message + + + Verification message of a Pre-shared key message + + + Initiator's public-key transport message + + + Verification message of a public-key message + + + Initiator's DH exchange message + + + Responder's DH exchange message + + + Error message + + + + The supported MIKEY version 1. + + + + The contents of the SDP "a=" field which contains a key/value pair. + + the attribute key + + + + the attribute value or NULL when it was a property attribute + + + + Clear the attribute. + + @GST_SDP_OK. + + + + + a #GstSDPAttribute + + + + + + Set the attribute with @key and @value. + + @GST_SDP_OK. + + + + + a #GstSDPAttribute + + + + the key + + + + the value + + + + + + + The contents of the SDP "b=" field which specifies the proposed bandwidth to +be used by the session or media. + + the bandwidth modifier type + + + + the bandwidth in kilobits per second + + + + Reset the bandwidth information in @bw. + + a #GstSDPResult. + + + + + a #GstSDPBandwidth + + + + + + Set bandwidth information in @bw. + + a #GstSDPResult. + + + + + a #GstSDPBandwidth + + + + the bandwidth modifier type + + + + the bandwidth in kilobits per second + + + + + + + The contents of the SDP "c=" field which contains connection data. + + the type of network. "IN" is defined to have the meaning + "Internet". + + + + the type of @address. + + + + the address + + + + the time to live of the address + + + + the number of layers + + + + Clear the connection. + + @GST_SDP_OK. + + + + + a #GstSDPConnection + + + + + + Set the connection with the given parameters. + + @GST_SDP_OK. + + + + + a #GstSDPConnection + + + + the type of network. "IN" is defined to have the meaning +"Internet". + + + + the type of address. + + + + the address + + + + the time to live of the address + + + + the number of layers + + + + + + + The contents of the SDP "k=" field which is used to convey encryption +keys. + + the encryption type + + + + the encryption data + + + + + The contents of the SDP "m=" field with all related fields. + + the media type + + + + the transport port to which the media stream will be sent + + + + the number of ports or -1 if only one port was specified + + + + the transport protocol + + + + an array of #gchar formats + + + + + + the media title + + + + array of #GstSDPConnection with media connection information + + + + + + array of #GstSDPBandwidth with media bandwidth information + + + + + + the encryption key + + + + array of #GstSDPAttribute with the additional media attributes + + + + + + Add the attribute with @key and @value to @media. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + a key + + + + a value + + + + + + Add the bandwidth information with @bwtype and @bandwidth to @media. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + the bandwidth modifier type + + + + the bandwidth in kilobits per second + + + + + + Add the given connection parameters to @media. + + a #GstSDPResult. + + + + + a #GstSDPMedia + + + + the type of network. "IN" is defined to have the meaning +"Internet". + + + + the type of address. + + + + the address + + + + the time to live of the address + + + + the number of layers + + + + + + Add the format information to @media. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + the format + + + + + + Convert the contents of @media to a text string. + + A dynamically allocated string representing the media. + + + + + a #GstSDPMedia + + + + + + Get the number of attribute fields in @media. + + the number of attributes in @media. + + + + + a #GstSDPMedia + + + + + + Mapping of attributes of #GstSDPMedia to #GstCaps + + a #GstSDPResult. + + + + + a #GstSDPMedia + + + + a #GstCaps + + + + + + Get the number of bandwidth fields in @media. + + the number of bandwidths in @media. + + + + + a #GstSDPMedia + + + + + + Get the number of connection fields in @media. + + the number of connections in @media. + + + + + a #GstSDPMedia + + + + + + Allocate a new copy of @media and store the result in @copy. The value in +@copy should be release with gst_sdp_media_free function. + + a #GstSDPResult + + + + + a #GstSDPMedia + + + + pointer to new #GstSDPMedia + + + + + + Get the number of formats in @media. + + the number of formats in @media. + + + + + a #GstSDPMedia + + + + + + Free all resources allocated by @media. @media should not be used anymore after +this function. This function should be used when @media was dynamically +allocated with gst_sdp_media_new(). + + a #GstSDPResult. + + + + + a #GstSDPMedia + + + + + + Get the attribute at position @idx in @media. + + the #GstSDPAttribute at position @idx. + + + + + a #GstSDPMedia + + + + an index + + + + + + Get the first attribute value for @key in @media. + + the first attribute value for @key. + + + + + a #GstSDPMedia + + + + a key + + + + + + Get the @nth attribute value for @key in @media. + + the @nth attribute value. + + + + + a #GstSDPMedia + + + + a key + + + + an index + + + + + + Get the bandwidth at position @idx in @media. + + the #GstSDPBandwidth at position @idx. + + + + + a #GstSDPMedia + + + + an index + + + + + + Mapping of caps from SDP fields: + +a=rtpmap:(payload) (encoding_name)/(clock_rate)[/(encoding_params)] + +a=framesize:(payload) (width)-(height) + +a=fmtp:(payload) (param)[=(value)];... + + a #GstCaps, or %NULL if an error happened + + + + + a #GstSDPMedia + + + + a payload type + + + + + + Get the connection at position @idx in @media. + + the #GstSDPConnection at position @idx. + + + + + a #GstSDPMedia + + + + an index + + + + + + Get the format information at position @idx in @media. + + the format at position @idx. + + + + + a #GstSDPMedia + + + + an index + + + + + + Get the information of @media + + the information of @media. + + + + + a #GstSDPMedia + + + + + + Get the encryption information from @media. + + a #GstSDPKey. + + + + + a #GstSDPMedia + + + + + + Get the media description of @media. + + the media description. + + + + + a #GstSDPMedia + + + + + + Get the number of ports for @media. + + the number of ports for @media. + + + + + a #GstSDPMedia + + + + + + Get the port number for @media. + + the port number of @media. + + + + + a #GstSDPMedia + + + + + + Get the transport protocol of @media + + the transport protocol of @media. + + + + + a #GstSDPMedia + + + + + + Initialize @media so that its contents are as if it was freshly allocated +with gst_sdp_media_new(). This function is mostly used to initialize a media +allocated on the stack. gst_sdp_media_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. + + a #GstSDPResult. + + + + + a #GstSDPMedia + + + + + + Insert the attribute to @media at @idx. When @idx is -1, +the attribute is appended. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + a #GstSDPAttribute + + + + + + Insert the bandwidth information to @media at @idx. When @idx is -1, +the bandwidth is appended. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + a #GstSDPBandwidth + + + + + + Insert the connection information to @media at @idx. When @idx is -1, +the connection is appended. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + a #GstSDPConnection + + + + + + Insert the format information to @media at @idx. When @idx is -1, +the format is appended. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + the format + + + + + + Creates a new #GstMIKEYMessage after parsing the key-mgmt attribute +from a #GstSDPMedia. + + a #GstSDPResult. + + + + + a #GstSDPMedia + + + + pointer to new #GstMIKEYMessage + + + + + + Remove the attribute in @media at @idx. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + + + Remove the bandwidth information in @media at @idx. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + + + Remove the connection information in @media at @idx. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + + + Remove the format information in @media at @idx. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + + + Replace the attribute in @media at @idx with @attr. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + a #GstSDPAttribute + + + + + + Replace the bandwidth information in @media at @idx with @bw. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + a #GstSDPBandwidth + + + + + + Replace the connection information in @media at @idx with @conn. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + a #GstSDPConnection + + + + + + Replace the format information in @media at @idx with @format. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + an index + + + + the format + + + + + + Set the media information of @media to @information. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + the media information + + + + + + Adds the encryption information to @media. + + a #GstSDPResult. + + + + + a #GstSDPMedia + + + + the encryption type + + + + the encryption data + + + + + + Set the media description of @media to @med. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + the media description + + + + + + Set the port information in @media. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + the port number + + + + the number of ports + + + + + + Set the media transport protocol of @media to @proto. + + #GST_SDP_OK. + + + + + a #GstSDPMedia + + + + the media transport protocol + + + + + + Free all resources allocated in @media. @media should not be used anymore after +this function. This function should be used when @media was allocated on the +stack and initialized with gst_sdp_media_init(). + + a #GstSDPResult. + + + + + a #GstSDPMedia + + + + + + Allocate a new GstSDPMedia and store the result in @media. + + a #GstSDPResult. + + + + + pointer to new #GstSDPMedia + + + + + + Mapping of caps to SDP fields: + +a=rtpmap:(payload) (encoding_name) or (clock_rate)[or (encoding_params)] + +a=framesize:(payload) (width)-(height) + +a=fmtp:(payload) (param)[=(value)];... + +a=rtcp-fb:(payload) (param1) [param2]... + + a #GstSDPResult. + + + + + a #GstCaps + + + + a #GstSDPMedia + + + + + + + The GstSDPMessage helper functions makes it easy to parse and create SDP +messages. + + the protocol version + + + + owner/creator and session identifier + + + + session name + + + + session information + + + + URI of description + + + + array of #gchar with email addresses + + + + + + array of #gchar with phone numbers + + + + + + connection information for the session + + + + array of #GstSDPBandwidth with bandwidth information + + + + + + array of #GstSDPTime with time descriptions + + + + + + array of #GstSDPZone with time zone adjustments + + + + + + encryption key + + + + array of #GstSDPAttribute with session attributes + + + + + + array of #GstSDPMedia with media descriptions + + + + + + Add the attribute with @key and @value to @msg. + + @GST_SDP_OK. + + + + + a #GstSDPMessage + + + + the key + + + + the value + + + + + + Add the specified bandwidth information to @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the bandwidth modifier type + + + + the bandwidth in kilobits per second + + + + + + Add @email to the list of emails in @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + an email + + + + + + Adds @media to the array of medias in @msg. This function takes ownership of +the contents of @media so that @media will have to be reinitialized with +gst_sdp_media_init() before it can be used again. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + a #GstSDPMedia to add + + + + + + Add @phone to the list of phones in @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + a phone + + + + + + Add time information @start and @stop to @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the start time + + + + the stop time + + + + the repeat times + + + + + + + + Add time zone information to @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the NTP time that a time zone adjustment happens + + + + the offset from the time when the session was first scheduled + + + + + + Convert the contents of @msg to a text string. + + A dynamically allocated string representing the SDP description. + + + + + a #GstSDPMessage + + + + + + Get the number of attributes in @msg. + + the number of attributes in @msg. + + + + + a #GstSDPMessage + + + + + + Mapping of attributes of #GstSDPMessage to #GstCaps + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + a #GstCaps + + + + + + Get the number of bandwidth information in @msg. + + the number of bandwidth information in @msg. + + + + + a #GstSDPMessage + + + + + + Allocate a new copy of @msg and store the result in @copy. The value in +@copy should be release with gst_sdp_message_free function. + + a #GstSDPResult + + + + + a #GstSDPMessage + + + + pointer to new #GstSDPMessage + + + + + + Dump the parsed contents of @msg to stdout. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + + + Get the number of emails in @msg. + + the number of emails in @msg. + + + + + a #GstSDPMessage + + + + + + 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_sdp_message_new(). + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + + + Get the attribute at position @idx in @msg. + + the #GstSDPAttribute at position @idx. + + + + + a #GstSDPMessage + + + + the index + + + + + + Get the first attribute with key @key in @msg. + + the attribute value of the first attribute with @key. + + + + + a #GstSDPMessage + + + + the key + + + + + + Get the @nth attribute with key @key in @msg. + + the attribute value of the @nth attribute with @key. + + + + + a #GstSDPMessage + + + + the key + + + + the index + + + + + + Get the bandwidth at index @idx from @msg. + + a #GstSDPBandwidth. + + + + + a #GstSDPMessage + + + + the bandwidth index + + + + + + Get the connection of @msg. + + a #GstSDPConnection. The result remains valid as long as @msg is valid. + + + + + a #GstSDPMessage + + + + + + Get the email with number @idx from @msg. + + the email at position @idx. + + + + + a #GstSDPMessage + + + + an email index + + + + + + Get the information in @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + + + Get the encryption information from @msg. + + a #GstSDPKey. + + + + + a #GstSDPMessage + + + + + + Get the media description at index @idx in @msg. + + a #GstSDPMedia. + + + + + a #GstSDPMessage + + + + the index + + + + + + Get the origin of @msg. + + a #GstSDPOrigin. The result remains valid as long as @msg is valid. + + + + + a #GstSDPMessage + + + + + + Get the phone with number @idx from @msg. + + the phone at position @idx. + + + + + a #GstSDPMessage + + + + a phone index + + + + + + Get the session name in @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + + + Get time information with index @idx from @msg. + + a #GstSDPTime. + + + + + a #GstSDPMessage + + + + the time index + + + + + + Get the URI in @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + + + Get the version in @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + + + Get time zone information with index @idx from @msg. + + a #GstSDPZone. + + + + + a #GstSDPMessage + + + + the zone index + + + + + + Initialize @msg so that its contents are as if it was freshly allocated +with gst_sdp_message_new(). This function is mostly used to initialize a message +allocated on the stack. gst_sdp_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. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + + + Insert attribute into the array of attributes in @msg +at index @idx. +When -1 is given as @idx, the attribute is inserted at the end. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + an index + + + + a #GstSDPAttribute + + + + + + Insert bandwidth parameters into the array of bandwidths in @msg +at index @idx. +When -1 is given as @idx, the bandwidth is inserted at the end. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + an index + + + + the bandwidth + + + + + + Insert @email into the array of emails in @msg at index @idx. +When -1 is given as @idx, the email is inserted at the end. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + an index + + + + an email + + + + + + Insert @phone into the array of phone numbers in @msg at index @idx. +When -1 is given as @idx, the phone is inserted at the end. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + a phone index + + + + a phone + + + + + + Insert time parameters into the array of times in @msg +at index @idx. +When -1 is given as @idx, the times are inserted at the end. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + an index + + + + a #GstSDPTime + + + + + + Insert zone parameters into the array of zones in @msg +at index @idx. +When -1 is given as @idx, the zone is inserted at the end. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + an index +@zone a #GstSDPZone + + + + + + + + + Get the number of media descriptions in @msg. + + the number of media descriptions in @msg. + + + + + a #GstSDPMessage + + + + + + Creates a new #GstMIKEYMessage after parsing the key-mgmt attribute +from a #GstSDPMessage. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + pointer to new #GstMIKEYMessage + + + + + + Get the number of phones in @msg. + + the number of phones in @msg. + + + + + a #GstSDPMessage + + + + + + Remove the attribute in @msg at index @idx. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the index + + + + + + Remove the bandwidth information in @msg at index @idx. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the bandwidth index + + + + + + Remove the email in @msg at index @idx. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + an email index + + + + + + Remove the phone number in @msg at index @idx. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + a phone index + + + + + + Remove the time information in @msg at index @idx. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the index + + + + + + Remove the zone information in @msg at index @idx. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the index + + + + + + Replace the attribute in @msg at index @idx with @attr. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the index + + + + a #GstSDPAttribute + + + + + + Replace the bandwidth information in @msg at index @idx with @bw. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the bandwidth index + + + + the bandwidth + + + + + + Replace the email in @msg at index @idx with @email. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + an email index + + + + an email + + + + + + Replace the phone number in @msg at index @idx with @phone. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + a phone index + + + + a phone + + + + + + Replace the time information in @msg at index @idx with @t. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the index + + + + a #GstSDPTime + + + + + + Replace the zone information in @msg at index @idx with @zone. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the index + + + + a #GstSDPZone + + + + + + Configure the SDP connection in @msg with the given parameters. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the type of network. "IN" is defined to have the meaning +"Internet". + + + + the type of address. + + + + the address + + + + the time to live of the address + + + + the number of layers + + + + + + Set the information in @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the information + + + + + + Adds the encryption information to @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the encryption type + + + + the encryption data + + + + + + Configure the SDP origin in @msg with the given parameters. + + #GST_SDP_OK. + + + + + a #GstSDPMessage + + + + the user name + + + + a session id + + + + a session version + + + + a network type + + + + an address type + + + + an address + + + + + + Set the session name in @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the session name + + + + + + Set the URI in @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the URI + + + + + + Set the version in @msg. + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + the version + + + + + + Get the number of time information entries in @msg. + + the number of time information entries in @msg. + + + + + a #GstSDPMessage + + + + + + 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_sdp_message_init(). + + a #GstSDPResult. + + + + + a #GstSDPMessage + + + + + + Get the number of time zone information entries in @msg. + + the number of time zone information entries in @msg. + + + + + a #GstSDPMessage + + + + + + Creates a uri from @msg with the given @scheme. The uri has the format: + + \@scheme:///[#type=value *[&type=value]] + + Where each value is url encoded. + + a uri for @msg. + + + + + the uri scheme + + + + the #GstSDPMessage + + + + + + Allocate a new GstSDPMessage and store the result in @msg. + + a #GstSDPResult. + + + + + pointer to new #GstSDPMessage + + + + + + Parse the contents of @size bytes pointed to by @data and store the result in +@msg. + + #GST_SDP_OK on success. + + + + + the start of the buffer + + + + + + the size of the buffer + + + + the result #GstSDPMessage + + + + + + Parse the null-terminated @uri and store the result in @msg. + +The uri should be of the form: + + scheme://[address[:ttl=ttl][:noa=noa]]/[sessionname] + [#type=value *[&type=value]] + + where value is url encoded. This looslely resembles + http://tools.ietf.org/html/draft-fujikawa-sdp-url-01 + + #GST_SDP_OK on success. + + + + + the start of the uri + + + + the result #GstSDPMessage + + + + + + + The contents of the SDP "o=" field which gives the originator of the session +(their username and the address of the user's host) plus a session id and +session version number. + + the user's login on the originating host, or it is "-" + if the originating host does not support the concept of user ids. + + + + is a numeric string such that the tuple of @username, @sess_id, + @nettype, @addrtype and @addr form a globally unique identifier for the + session. + + + + a version number for this announcement + + + + the type of network. "IN" is defined to have the meaning + "Internet". + + + + the type of @addr. + + + + the globally unique address of the machine from which the session was + created. + + + + + Return values for the SDP functions. + + A successful return value + + + a function was given invalid parameters + + + + The contents of the SDP "t=" field which specify the start and stop times for +a conference session. + + start time for the conference. The value is the decimal + representation of Network Time Protocol (NTP) time values in seconds + + + + stop time for the conference. The value is the decimal + representation of Network Time Protocol (NTP) time values in seconds + + + + repeat times for a session + + + + + + Reset the time information in @t. + + a #GstSDPResult. + + + + + a #GstSDPTime + + + + + + Set time information @start, @stop and @repeat in @t. + + a #GstSDPResult. + + + + + a #GstSDPTime + + + + the start time + + + + the stop time + + + + the repeat times + + + + + + + + + The contents of the SDP "z=" field which allows the sender to +specify a list of time zone adjustments and offsets from the base +time. + + the NTP time that a time zone adjustment happens + + + + the offset from the time when the session was first scheduled + + + + Reset the zone information in @zone. + + a #GstSDPResult. + + + + + a #GstSDPZone + + + + + + Set zone information in @zone. + + a #GstSDPResult. + + + + + a #GstSDPZone + + + + the NTP time that a time zone adjustment happens + + + + the offset from the time when the session was first scheduled + + + + + + + The Application-Specific Maximum bandwidth modifier. + + + + The Conference Total bandwidth modifier. + + + + The extension prefix bandwidth modifier. + + + + RTCP bandwidth allocated to data receivers (RFC 3556). + + + + RTCP bandwidth allocated to active data senders (RFC 3556). + + + + Transport Independent Application Specific Maximum bandwidth (RFC 3890). + + + + Check if the given @addr is a multicast address. + + TRUE when @addr is multicast. + + + + + a network type + + + + an address type + + + + an address + + + + + + Makes key management data + + a #gchar key-mgmt data, + + + + + a #gchar URI + + + + a #gchar base64-encoded key data + + + + + + Allocate a new GstSDPMedia and store the result in @media. + + a #GstSDPResult. + + + + + pointer to new #GstSDPMedia + + + + + + Mapping of caps to SDP fields: + +a=rtpmap:(payload) (encoding_name) or (clock_rate)[or (encoding_params)] + +a=framesize:(payload) (width)-(height) + +a=fmtp:(payload) (param)[=(value)];... + +a=rtcp-fb:(payload) (param1) [param2]... + + a #GstSDPResult. + + + + + a #GstCaps + + + + a #GstSDPMedia + + + + + + Creates a uri from @msg with the given @scheme. The uri has the format: + + \@scheme:///[#type=value *[&type=value]] + + Where each value is url encoded. + + a uri for @msg. + + + + + the uri scheme + + + + the #GstSDPMessage + + + + + + Allocate a new GstSDPMessage and store the result in @msg. + + a #GstSDPResult. + + + + + pointer to new #GstSDPMessage + + + + + + Parse the contents of @size bytes pointed to by @data and store the result in +@msg. + + #GST_SDP_OK on success. + + + + + the start of the buffer + + + + + + the size of the buffer + + + + the result #GstSDPMessage + + + + + + Parse the null-terminated @uri and store the result in @msg. + +The uri should be of the form: + + scheme://[address[:ttl=ttl][:noa=noa]]/[sessionname] + [#type=value *[&type=value]] + + where value is url encoded. This looslely resembles + http://tools.ietf.org/html/draft-fujikawa-sdp-url-01 + + #GST_SDP_OK on success. + + + + + the start of the uri + + + + the result #GstSDPMessage + + + + + + diff --git a/gstreamer-rtsp-server/CHANGELOG.md b/gstreamer-rtsp-server/CHANGELOG.md new file mode 100644 index 000000000..614f2ff50 --- /dev/null +++ b/gstreamer-rtsp-server/CHANGELOG.md @@ -0,0 +1,218 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html), +specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field). + +## [0.10.1] - 2018-01-03 +### Fixed +- Don't require &mut self for TagSetterExtManual::add() + +### Added +- A TagSetter example application +- Bindings for gst_video::convert_sample() and ::convert_sample_async() +- Bindings for gst_video::VideoRectangle +- Debug impl for Sample and ::with_buffer_list() constructor +- A borrowing version of VideoFrame: VideoFrameRef +- Bindings for GstVideoFilter + +### Changed +- Deprecated Sample::get_info() in favour of ::get_structure() +- Player has gst::Object as another parent class now + +## [0.10.0] - 2017-12-22 +### Fixed +- Various clippy warnings +- Memory leak of the tag list in Toc::merge_tags() +- Property getters use Values of the correct type +- Event::get_structure(), Message::get_structure() and + Query::get_structure() can return None for the structure +- Various other nullability fixes all over the API, changing functions to + accept Option<> or returning Option<>, or only plain types +- Functions taking paths/filenames now actually take Paths instead of &strs +- Element::remove_pad() is not giving away a new reference to the pad + anymore, which caused a memory leak of all pads ever removed +- Precision handling in ClockTime's Display impl +- Video/AudioInfo are only Send, not Sync + +### Added +- Various enums now also derive useful traits like Copy, Clone and Hash in + addition to PartialEq, Eq and Debug +- TagList::merge() and insert() for combining tag lists +- EventType gained many useful functions to work with event types and + a PartialOrd impl to check expected event order of event types where it matters +- MessageRef/EventRef/QueryRef implement ToOwned +- Bindings for Registry and PluginFeature +- Event::set_running_time_offset() for adjusting the offset while events + pass through the pipeline +- Event/Message GroupIds and Seqnums now have a newtype wrapper around u32 + instead of the plain value, making usage of them slightly more typesafe. + Also add an "invalid" value for both, as exists in latest GStreamer now. +- FormattedValue, GenericFormattedValue and related types were + implemented now, which allows more convenient and type-safe usage of + formatted values (time, bytes, etc) +- Bindings for force-keyunit and still-frame events were added +- MappedBuffer/BufferMap now implement various other useful traits, including + AsRef<[u8]>, AsMut, Deref, DerefMut, Debug, PartialEq and Eq +- Add VideoMultiviewFramePacking enum, and use it in Player +- Bindings for the GStreamer Net library, including PTP/NTP/network client + clocks and the GStreamer NetClock provider for network synchronization of + pipelines +- IteratorError implements std::error:Error +- Plugin::add_dependency() and ::add_dependency_simple() was added +- Rank and TypeFindProbability implement PartialOrd/Ord now +- Bindings for TypeFind, TypeFindFactory and the typefind helpers +- StreamCollection::iter() for iterating over all contained streams +- ErrorMessage type that can be used e.g. in a Result for passing an error + message from somewhere to upper layers to then be posted on an element the + same way gst_element_error!() would've done + +### Changed +- Sample::new(), TagList::add(), Structure::set() and similar + functions take the values (ToSendValue impls) by reference instead of value. + They were not consumed by the function before. +- The Debug impls of various types, including Event/Buffer/Message/Query/Structure + were improved to print all the fields, similar to what GST_PTR_FORMAT would + do in C +- Switched to lazy_static 1.0 +- Gap event and Duration tag are using ClockTimes now, as well as various + Player signals +- Segment is now based on a generic type FormattedSegment that can + take any format (time, bytes, etc) or a GenericFormattedValue for more + type-safety and convenience. Also functions for "casting" between a generic + segment and a segment with a specific format exist on this now +- AppSrc and AppSink now have a builder for the callbacks, making it + unnecessary to always provide all callbacks even if only one is actually + needed +- Various functions that returned bool for errors, are now returning a Result +- Player configuration is now a custom type with more convenient API +- Player VideoInfo uses a Fraction instead of (u32,u32) for the framerate and + pixel-aspect-ratio +- VideoFrame API has more consistent API between writable and read-only + variants +- Buffer::copy_into() was added, and ::copy_region() now takes a + BufferCopyFlags parameter instead of always using the default flags +- ChildProxy::set_child_property() takes a &ToValue now to follow the API of + Object::set_property() and improve usability +- Proxy/GhostPad default pad functions use the correct specific pad type now + instead of a generic Pad +- Bus::add_signal_watch_full() takes a Priority for the priority instead of u32 +- Clock::(un)adjust_with_calibration() takes no clock parameter anymore + +### Removed +- FormatValue was removed in favour of GenericFormattedValue and the + connected traits and specific format impls + +## [0.9.1] - 2017-11-26 +### Fixed +- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`, + `PadLinkError`/`PadLinkSuccess` too + +## [0.9.0] - 2017-11-26 +### Added +- Bindings for (outputting to) the GStreamer logging system +- Bindings for the GStreamer base library +- Bindings for all the `Pad` functions to override pad behaviour, and pad task + functions +- Bindings for `StaticCaps` and `StaticPadTemplate` +- Bindings for `deep-notify` signal on `Object` +- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them + from an element with context information (file, line, module, etc.) similar + to the C `GST_ELEMENT_ERROR` macro +- Support for setting custom fields in `Messages`/`Events` during construction +- Support for creating Buffers out of anything that is `AsRef<[u8]>` or + `AsMut<[u8]>` +- Support for using the `Read` trait on `Adapter` +- Functions for getting all sink/src/all pads of an `Element`, and all children + of a `Bin` +- Builder for `Caps` and `Structures` in addition to the existing functions +- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler` +- Rust ports of the basic tutorials 1 to 8 from + https://gstreamer.freedesktop.org/documentation/tutorials/ +- "Getting started" and "Installation" sections to the README.md +- "dox" feature for generating documentation for all available configurations + +### Fixed +- `StackTraceFlags` are only available since 1.12 +- Worked around macOS requiring a `NSRunLoop` running on the main thread in all + examples and tutorials, to be able to show a window or anything else + +### Changed +- `ClockTime` is now a wrapper around `Option` to handle the + `CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic + and other traits as needed and ensures that no accidential calculations with + `CLOCK_TIME_NONE` can happen +- "Values with format", like in `Duration`/`Position`/`Convert` queries or + `Seek` events now return a `FormatValue` type. This contains the actual + `Format` together with the value and does any required conversions. This + also makes it harder to accidentially mix e.g. values in bytes and time +- `PadProbeId` does not implement `Clone`/`Copy` anymore +- Property notify watches return a custom type instead of ulong +- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of + `glib::Error` now. Using arbitrary ones does not work +- `Iterator` bindings were completely rewritten and provide the item type as a + generic type parameter now, greatly simplifying its usage +- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and + `Structures`, as their content must be possible to send to different threads + safely +- `Message::get_src()` can return `None` +- Allow `None` as `Caps` in `AppSrc`/`AppSink` +- Allow everything implementing `Into>` to be used as a pad name +- Moved `copy()` from `GstRc` directly to `MiniObject` +- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now + implement an `into_result()` function that splits them into a `Result` with + the good and bad cases. Also mark them as `#[must_use]` to make it harder to + accidentially ignore errors. +- Error enums implement the `Error` trait + +- Many examples use the `failure` crate for error handling now, cleaning up the + error handling code quite a bit +- Lots of other code cleanup, compiler/clippy warning cleanup, etc. + +## [0.8.2] - 2017-11-11 +### Fixed +- Implement StaticType of BufferRef instead of Buffer. Buffer aka + GstRc already implements StaticType if BufferRef does, and + without this it was not possible to use Buffers in GValues. +- Free memory of the appsink/appsrc callbacks with the correct type. It was + crashing because of using the wrong type before. +- Fix documentation URLs in Cargo.toml. + +### Added +- Installation instructions and links to documentation for getting started to + README.md. + +## [0.8.1] - 2017-09-15 +### Added +- Implement Send+Sync for Query, Message and Event, and their corresponding + Ref types. + +### Fixed +- Constructor for gst_player::Player now works properly with GStreamer 1.12 + when passing a video renderer or signal dispatcher. There was a reference + counting bug. +- Instead of returning &'static references from functions, return references + with a generic, unbound lifetime instead. + See https://github.com/rust-lang/rust/pull/42417#issue-233404573 +- Various "unused external crate" warnings and clippy warnings everywhere. + +### Changed +- Remove Cargo.lock from GIT, it's not very useful for library crates. +- Run everything through latest rustfmt-nightly. +- Use while-let (instead of loop and if-let) and CLOCK_TIME_NONE (instead of + u64::MAX) in the examples. + +## [0.8.0] - 2017-08-31 + +- Initial release of the autogenerated GStreamer bindings. Older versions + (< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs). + The API of the two is incompatible. + +[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...HEAD +[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1 +[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0 +[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1 +[0.9.0]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.9.0 +[0.8.2]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.8.2 +[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1 diff --git a/gstreamer-rtsp-server/Cargo.toml b/gstreamer-rtsp-server/Cargo.toml new file mode 100644 index 000000000..6e6fac931 --- /dev/null +++ b/gstreamer-rtsp-server/Cargo.toml @@ -0,0 +1,44 @@ +[package] +name = "gstreamer-rtsp-server" +version = "0.11.0" +authors = ["Mathieu Duponchelle ", "Sebastian Dröge "] +categories = ["api-bindings", "multimedia"] +description = "Rust bindings for GStreamer RTSP Server library" +repository = "https://github.com/sdroege/gstreamer-rs" +license = "MIT/Apache-2.0" +readme = "README.md" +homepage = "https://gstreamer.freedesktop.org" +documentation = "https://sdroege.github.io/rustdoc/gstreamer/gstreamer_rtsp_server" +keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"] +build = "build.rs" + +[dependencies] +bitflags = "1.0" +libc = "0.2" +glib-sys = { git = "https://github.com/gtk-rs/sys" } +gio-sys = { git = "https://github.com/gtk-rs/sys" } +gobject-sys = { git = "https://github.com/gtk-rs/sys" } +gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } +gstreamer-rtsp-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } +gstreamer-rtsp-server-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } +gstreamer-net-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } +glib = { git = "https://github.com/gtk-rs/glib" } +gio = { git = "https://github.com/gtk-rs/gio" } +gstreamer = { path = "../gstreamer" } +gstreamer-rtsp = { path = "../gstreamer-rtsp" } +gstreamer-net = { path = "../gstreamer-net" } + +[build-dependencies.rustdoc-stripper] +version = "0.1" +optional = true + +[features] +v1_10 = ["gstreamer-sys/v1_10", "gstreamer-rtsp-sys/v1_10", "gstreamer-net-sys/v1_10", "gstreamer-rtsp-server-sys/v1_10"] +v1_12 = ["gstreamer-sys/v1_12", "gstreamer-rtsp-sys/v1_12", "gstreamer-net-sys/v1_12", "gstreamer-rtsp-server-sys/v1_12", "v1_10"] +embed-lgpl-docs = ["rustdoc-stripper"] +purge-lgpl-docs = ["rustdoc-stripper"] +dox = ["gstreamer-rtsp-server-sys/dox", "glib/dox", "gstreamer/dox"] +default-features = [] + +[badges] +travis-ci = { repository = "sdroege/gstreamer-rs", branch = "master" } diff --git a/gstreamer-rtsp-server/LICENSE-APACHE b/gstreamer-rtsp-server/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/gstreamer-rtsp-server/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/gstreamer-rtsp-server/LICENSE-MIT b/gstreamer-rtsp-server/LICENSE-MIT new file mode 100644 index 000000000..31aa79387 --- /dev/null +++ b/gstreamer-rtsp-server/LICENSE-MIT @@ -0,0 +1,23 @@ +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. diff --git a/gstreamer-rtsp-server/README.md b/gstreamer-rtsp-server/README.md new file mode 100644 index 000000000..18879ee94 --- /dev/null +++ b/gstreamer-rtsp-server/README.md @@ -0,0 +1,170 @@ +# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-rtsp-server.svg)](https://crates.io/crates/gstreamer-rtsp-server) [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs) + +[GStreamer](https://gstreamer.freedesktop.org/) (Rtsp Server library) bindings for Rust. +Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/). + +These bindings are providing a safe API that can be used to interface with +GStreamer, e.g. for writing GStreamer-based applications. + +For background and motivation, see the [announcement blogpost](https://coaxion.net/blog/2017/07/writing-gstreamer-applications-in-rust/). + +The bindings (since 0.8.0) are autogenerated with [gir](https://github.com/gtk-rs/gir/) +based on the [GObject-Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection/) +API metadata provided by the GStreamer project. Older versions before 0.8.0 were manually +written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs). +The API of the two is incompatible. + +A crate for writing GStreamer plugins in Rust can be found here: https://github.com/sdroege/gst-plugin-rs + +## Table of Contents +1. [Installation](#installation) + 1. [Linux/BSDs](#installation-linux) + 1. [macOS](#installation-macos) + 1. [Windows](#installation-windows) +1. [Getting Started](#getting-started) +1. [License](#license) +1. [Contribution](#contribution) + + + +## Installation + +To build the GStreamer bindings or anything depending on them, you need to +have at least GStreamer 1.8 and gst-plugins-base 1.8 installed. In addition, +some of the examples/tutorials require various GStreamer plugins to be +available, which can be found in gst-plugins-base, gst-plugins-good, +gst-plugins-bad, gst-plugins-ugly and/or gst-libav. + + + +### Linux/BSDs + +You need to install the above mentioned packages with your distributions +package manager, or build them from source. + +On Debian/Ubuntu they can be installed with + +``` +$ apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \ + gstreamer1.0-libav +``` + +Package names on other distributions should be similar. +Please submit a pull request with instructions for yours. + + + +### macOS + +You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or +by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/) +provided by the GStreamer project. + +#### Homebrew + +``` +$ brew install gstreamer gst-plugins-base gst-plugins-good \ + gst-plugins-bad gst-plugins-ugly gst-libav +``` + +#### GStreamer Binaries + +You need to download the *two* `.pkg` files from the GStreamer website and +install them, e.g. `gstreamer-1.0-1.12.3-x86_64.pkg` and +`gstreamer-1.0-devel-1.12.3-x86_64.pkg`. + +After installation, you also need to install `pkg-config` (e.g. via Homebrew) +and set the `PKG_CONFIG_PATH` environment variable + +``` +$ export PKG_CONFIG_PATH="/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" +``` + + + +### Windows + +You can install GStreamer and the plugins via [MSYS2](http://www.msys2.org/) +with `pacman` or by installing the +[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by +the GStreamer project. + +#### MSYS2 / pacman + +``` +$ pacman -S pkg-config mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base \ + mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad \ + mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav +``` + +#### GStreamer Binaries + +You need to download the *two* `.msi` files for your platform from the +GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.12.3.msi` and +`gstreamer-1.0-devel-x86_64-1.12.3.msi`. + +After installation, you also need to install `pkg-config` (e.g. via MSYS2 or +from [here](https://sourceforge.net/projects/pkgconfiglite/)) +and set the `PKG_CONFIG_PATH` environment variable + +``` +$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" +``` + + + +## Getting Started + +The API reference can be found +[here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/), however it is +only the Rust API reference and does not explain any of the concepts. + +For getting started with GStreamer development, the best would be to follow +the [documentation](https://gstreamer.freedesktop.org/documentation/) on the +GStreamer website, especially the [Application Development +Manual](https://gstreamer.freedesktop.org/documentation/application-development/). +While being C-centric, it explains all the fundamental concepts of GStreamer +and the code examples should be relatively easily translatable to Rust. The +API is basically the same, function/struct names are the same and everything +is only more convenient (hopefully) and safer. + +In addition there are +[tutorials](https://gstreamer.freedesktop.org/documentation/tutorials/) on the +GStreamer website. Many of them were ported to Rust already and the code can +be found in the +[tutorials](https://github.com/sdroege/gstreamer-rs/tree/master/tutorials) +directory. + +Some further examples for various aspects of GStreamer and how to use it from +Rust can be found in the +[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples) +directory. + + + +## LICENSE + +gstreamer-rs and all crates contained in here are licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) + +at your option. + +GStreamer itself is licensed under the Lesser General Public License version +2.1 or (at your option) any later version: +https://www.gnu.org/licenses/lgpl-2.1.html + + + +## Contribution + +Any kinds of contributions are welcome as a pull request. + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in gstreamer-rs by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. diff --git a/gstreamer-rtsp-server/build.rs b/gstreamer-rtsp-server/build.rs new file mode 100644 index 000000000..fde24fe37 --- /dev/null +++ b/gstreamer-rtsp-server/build.rs @@ -0,0 +1,34 @@ +fn main() { + manage_docs(); +} + +#[cfg(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs"))] +fn manage_docs() { + extern crate stripper_lib; + use std::io; + + let path = "src"; + let ignores: &[&str] = &[]; + + stripper_lib::loop_over_files( + path.as_ref(), + &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), + &ignores, + false, + ); + + #[cfg(feature = "embed-lgpl-docs")] + { + let docs = include_str!("../docs/gstreamer-rtsp-server/docs.md"); + let mut infos = stripper_lib::parse_cmts(docs.lines(), true); + stripper_lib::loop_over_files( + path.as_ref(), + &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), + &ignores, + false, + ); + } +} + +#[cfg(not(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")))] +fn manage_docs() {} diff --git a/gstreamer-rtsp-server/src/auto/enums.rs b/gstreamer-rtsp-server/src/auto/enums.rs new file mode 100644 index 000000000..20d1fff34 --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/enums.rs @@ -0,0 +1,254 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::StaticType; +use glib::Type; +use glib::translate::*; +use glib::value::FromValue; +use glib::value::FromValueOptional; +use glib::value::SetValue; +use glib::value::Value; +use gobject_ffi; + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPAddressPoolResult { + Ok, + Einval, + Ereserved, + Erange, + Elast, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPAddressPoolResult { + type GlibType = ffi::GstRTSPAddressPoolResult; + + fn to_glib(&self) -> ffi::GstRTSPAddressPoolResult { + match *self { + RTSPAddressPoolResult::Ok => ffi::GST_RTSP_ADDRESS_POOL_OK, + RTSPAddressPoolResult::Einval => ffi::GST_RTSP_ADDRESS_POOL_EINVAL, + RTSPAddressPoolResult::Ereserved => ffi::GST_RTSP_ADDRESS_POOL_ERESERVED, + RTSPAddressPoolResult::Erange => ffi::GST_RTSP_ADDRESS_POOL_ERANGE, + RTSPAddressPoolResult::Elast => ffi::GST_RTSP_ADDRESS_POOL_ELAST, + RTSPAddressPoolResult::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPAddressPoolResult { + fn from_glib(value: ffi::GstRTSPAddressPoolResult) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPAddressPoolResult::Ok, + -1 => RTSPAddressPoolResult::Einval, + -2 => RTSPAddressPoolResult::Ereserved, + -3 => RTSPAddressPoolResult::Erange, + -4 => RTSPAddressPoolResult::Elast, + value => RTSPAddressPoolResult::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPMediaStatus { + Unprepared, + Unpreparing, + Preparing, + Prepared, + Suspended, + Error, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPMediaStatus { + type GlibType = ffi::GstRTSPMediaStatus; + + fn to_glib(&self) -> ffi::GstRTSPMediaStatus { + match *self { + RTSPMediaStatus::Unprepared => ffi::GST_RTSP_MEDIA_STATUS_UNPREPARED, + RTSPMediaStatus::Unpreparing => ffi::GST_RTSP_MEDIA_STATUS_UNPREPARING, + RTSPMediaStatus::Preparing => ffi::GST_RTSP_MEDIA_STATUS_PREPARING, + RTSPMediaStatus::Prepared => ffi::GST_RTSP_MEDIA_STATUS_PREPARED, + RTSPMediaStatus::Suspended => ffi::GST_RTSP_MEDIA_STATUS_SUSPENDED, + RTSPMediaStatus::Error => ffi::GST_RTSP_MEDIA_STATUS_ERROR, + RTSPMediaStatus::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPMediaStatus { + fn from_glib(value: ffi::GstRTSPMediaStatus) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPMediaStatus::Unprepared, + 1 => RTSPMediaStatus::Unpreparing, + 2 => RTSPMediaStatus::Preparing, + 3 => RTSPMediaStatus::Prepared, + 4 => RTSPMediaStatus::Suspended, + 5 => RTSPMediaStatus::Error, + value => RTSPMediaStatus::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPPublishClockMode { + None, + Clock, + ClockAndOffset, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPPublishClockMode { + type GlibType = ffi::GstRTSPPublishClockMode; + + fn to_glib(&self) -> ffi::GstRTSPPublishClockMode { + match *self { + RTSPPublishClockMode::None => ffi::GST_RTSP_PUBLISH_CLOCK_MODE_NONE, + RTSPPublishClockMode::Clock => ffi::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK, + RTSPPublishClockMode::ClockAndOffset => ffi::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK_AND_OFFSET, + RTSPPublishClockMode::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPPublishClockMode { + fn from_glib(value: ffi::GstRTSPPublishClockMode) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPPublishClockMode::None, + 1 => RTSPPublishClockMode::Clock, + 2 => RTSPPublishClockMode::ClockAndOffset, + value => RTSPPublishClockMode::__Unknown(value), + } + } +} + +impl StaticType for RTSPPublishClockMode { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_publish_clock_mode_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPPublishClockMode { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPPublishClockMode { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for RTSPPublishClockMode { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPSuspendMode { + None, + Pause, + Reset, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPSuspendMode { + type GlibType = ffi::GstRTSPSuspendMode; + + fn to_glib(&self) -> ffi::GstRTSPSuspendMode { + match *self { + RTSPSuspendMode::None => ffi::GST_RTSP_SUSPEND_MODE_NONE, + RTSPSuspendMode::Pause => ffi::GST_RTSP_SUSPEND_MODE_PAUSE, + RTSPSuspendMode::Reset => ffi::GST_RTSP_SUSPEND_MODE_RESET, + RTSPSuspendMode::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPSuspendMode { + fn from_glib(value: ffi::GstRTSPSuspendMode) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPSuspendMode::None, + 1 => RTSPSuspendMode::Pause, + 2 => RTSPSuspendMode::Reset, + value => RTSPSuspendMode::__Unknown(value), + } + } +} + +impl StaticType for RTSPSuspendMode { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_suspend_mode_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPSuspendMode { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPSuspendMode { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for RTSPSuspendMode { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPThreadType { + Client, + Media, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPThreadType { + type GlibType = ffi::GstRTSPThreadType; + + fn to_glib(&self) -> ffi::GstRTSPThreadType { + match *self { + RTSPThreadType::Client => ffi::GST_RTSP_THREAD_TYPE_CLIENT, + RTSPThreadType::Media => ffi::GST_RTSP_THREAD_TYPE_MEDIA, + RTSPThreadType::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPThreadType { + fn from_glib(value: ffi::GstRTSPThreadType) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPThreadType::Client, + 1 => RTSPThreadType::Media, + value => RTSPThreadType::__Unknown(value), + } + } +} + diff --git a/gstreamer-rtsp-server/src/auto/flags.rs b/gstreamer-rtsp-server/src/auto/flags.rs new file mode 100644 index 000000000..f2f82ff2b --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/flags.rs @@ -0,0 +1,90 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::StaticType; +use glib::Type; +use glib::translate::*; +use glib::value::FromValue; +use glib::value::FromValueOptional; +use glib::value::SetValue; +use glib::value::Value; +use gobject_ffi; + +bitflags! { + pub struct RTSPAddressFlags: u32 { + const NONE = 0; + const IPV4 = 1; + const IPV6 = 2; + const EVEN_PORT = 4; + const MULTICAST = 8; + const UNICAST = 16; + } +} + +#[doc(hidden)] +impl ToGlib for RTSPAddressFlags { + type GlibType = ffi::GstRTSPAddressFlags; + + fn to_glib(&self) -> ffi::GstRTSPAddressFlags { + ffi::GstRTSPAddressFlags::from_bits_truncate(self.bits()) + } +} + +#[doc(hidden)] +impl FromGlib for RTSPAddressFlags { + fn from_glib(value: ffi::GstRTSPAddressFlags) -> RTSPAddressFlags { + skip_assert_initialized!(); + RTSPAddressFlags::from_bits_truncate(value.bits()) + } +} + +bitflags! { + pub struct RTSPTransportMode: u32 { + const PLAY = 1; + const RECORD = 2; + } +} + +#[doc(hidden)] +impl ToGlib for RTSPTransportMode { + type GlibType = ffi::GstRTSPTransportMode; + + fn to_glib(&self) -> ffi::GstRTSPTransportMode { + ffi::GstRTSPTransportMode::from_bits_truncate(self.bits()) + } +} + +#[doc(hidden)] +impl FromGlib for RTSPTransportMode { + fn from_glib(value: ffi::GstRTSPTransportMode) -> RTSPTransportMode { + skip_assert_initialized!(); + RTSPTransportMode::from_bits_truncate(value.bits()) + } +} + +impl StaticType for RTSPTransportMode { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_transport_mode_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPTransportMode { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPTransportMode { + unsafe fn from_value(value: &Value) -> Self { + from_glib(ffi::GstRTSPTransportMode::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0))) + } +} + +impl SetValue for RTSPTransportMode { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits()) + } +} + diff --git a/gstreamer-rtsp-server/src/auto/mod.rs b/gstreamer-rtsp-server/src/auto/mod.rs new file mode 100644 index 000000000..253928e56 --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/mod.rs @@ -0,0 +1,91 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +mod r_t_s_p_address_pool; +pub use self::r_t_s_p_address_pool::RTSPAddressPool; +pub use self::r_t_s_p_address_pool::RTSPAddressPoolExt; + +mod r_t_s_p_auth; +pub use self::r_t_s_p_auth::RTSPAuth; +pub use self::r_t_s_p_auth::RTSPAuthExt; + +mod r_t_s_p_client; +pub use self::r_t_s_p_client::RTSPClient; +pub use self::r_t_s_p_client::RTSPClientExt; + +mod r_t_s_p_media; +pub use self::r_t_s_p_media::RTSPMedia; +pub use self::r_t_s_p_media::RTSPMediaExt; + +mod r_t_s_p_media_factory; +pub use self::r_t_s_p_media_factory::RTSPMediaFactory; +pub use self::r_t_s_p_media_factory::RTSPMediaFactoryExt; + +mod r_t_s_p_media_factory_u_r_i; +pub use self::r_t_s_p_media_factory_u_r_i::RTSPMediaFactoryURI; +pub use self::r_t_s_p_media_factory_u_r_i::RTSPMediaFactoryURIExt; + +mod r_t_s_p_mount_points; +pub use self::r_t_s_p_mount_points::RTSPMountPoints; +pub use self::r_t_s_p_mount_points::RTSPMountPointsExt; + +mod r_t_s_p_server; +pub use self::r_t_s_p_server::RTSPServer; +pub use self::r_t_s_p_server::RTSPServerExt; + +mod r_t_s_p_session; +pub use self::r_t_s_p_session::RTSPSession; +pub use self::r_t_s_p_session::RTSPSessionExt; + +mod r_t_s_p_session_media; +pub use self::r_t_s_p_session_media::RTSPSessionMedia; +pub use self::r_t_s_p_session_media::RTSPSessionMediaExt; + +mod r_t_s_p_session_pool; +pub use self::r_t_s_p_session_pool::RTSPSessionPool; +pub use self::r_t_s_p_session_pool::RTSPSessionPoolExt; + +mod r_t_s_p_stream; +pub use self::r_t_s_p_stream::RTSPStream; +pub use self::r_t_s_p_stream::RTSPStreamExt; + +mod r_t_s_p_stream_transport; +pub use self::r_t_s_p_stream_transport::RTSPStreamTransport; +pub use self::r_t_s_p_stream_transport::RTSPStreamTransportExt; + +mod r_t_s_p_thread_pool; +pub use self::r_t_s_p_thread_pool::RTSPThreadPool; +pub use self::r_t_s_p_thread_pool::RTSPThreadPoolExt; + +mod r_t_s_p_address; +pub use self::r_t_s_p_address::RTSPAddress; + +mod enums; +pub use self::enums::RTSPAddressPoolResult; +pub use self::enums::RTSPMediaStatus; +pub use self::enums::RTSPPublishClockMode; +pub use self::enums::RTSPSuspendMode; +pub use self::enums::RTSPThreadType; + +mod flags; +pub use self::flags::RTSPAddressFlags; +pub use self::flags::RTSPTransportMode; + +#[doc(hidden)] +pub mod traits { + pub use super::RTSPAddressPoolExt; + pub use super::RTSPAuthExt; + pub use super::RTSPClientExt; + pub use super::RTSPMediaExt; + pub use super::RTSPMediaFactoryExt; + pub use super::RTSPMediaFactoryURIExt; + pub use super::RTSPMountPointsExt; + pub use super::RTSPServerExt; + pub use super::RTSPSessionExt; + pub use super::RTSPSessionMediaExt; + pub use super::RTSPSessionPoolExt; + pub use super::RTSPStreamExt; + pub use super::RTSPStreamTransportExt; + pub use super::RTSPThreadPoolExt; +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_address.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_address.rs new file mode 100644 index 000000000..84418c1e8 --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_address.rs @@ -0,0 +1,22 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct RTSPAddress(Boxed); + + match fn { + copy => |ptr| ffi::gst_rtsp_address_copy(mut_override(ptr)), + free => |ptr| ffi::gst_rtsp_address_free(ptr), + get_type => || ffi::gst_rtsp_address_get_type(), + } +} + +unsafe impl Send for RTSPAddress {} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_address_pool.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_address_pool.rs new file mode 100644 index 000000000..5984059c0 --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_address_pool.rs @@ -0,0 +1,84 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPAddress; +use RTSPAddressFlags; +use ffi; +use glib; +use glib::object::IsA; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct RTSPAddressPool(Object); + + match fn { + get_type => || ffi::gst_rtsp_address_pool_get_type(), + } +} + +impl RTSPAddressPool { + pub fn new() -> RTSPAddressPool { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_address_pool_new()) + } + } +} + +impl Default for RTSPAddressPool { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Send for RTSPAddressPool {} +unsafe impl Sync for RTSPAddressPool {} + +pub trait RTSPAddressPoolExt { + fn acquire_address(&self, flags: RTSPAddressFlags, n_ports: i32) -> Option; + + fn add_range(&self, min_address: &str, max_address: &str, min_port: u16, max_port: u16, ttl: u8) -> Result<(), glib::error::BoolError>; + + fn clear(&self); + + fn dump(&self); + + fn has_unicast_addresses(&self) -> bool; +} + +impl> RTSPAddressPoolExt for O { + fn acquire_address(&self, flags: RTSPAddressFlags, n_ports: i32) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_address_pool_acquire_address(self.to_glib_none().0, flags.to_glib(), n_ports)) + } + } + + fn add_range(&self, min_address: &str, max_address: &str, min_port: u16, max_port: u16, ttl: u8) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_address_pool_add_range(self.to_glib_none().0, min_address.to_glib_none().0, max_address.to_glib_none().0, min_port, max_port, ttl), "Failed to add address range") + } + } + + fn clear(&self) { + unsafe { + ffi::gst_rtsp_address_pool_clear(self.to_glib_none().0); + } + } + + fn dump(&self) { + unsafe { + ffi::gst_rtsp_address_pool_dump(self.to_glib_none().0); + } + } + + fn has_unicast_addresses(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_address_pool_has_unicast_addresses(self.to_glib_none().0)) + } + } +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_auth.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_auth.rs new file mode 100644 index 000000000..40a8d2892 --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_auth.rs @@ -0,0 +1,170 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use gio; +use glib::object::IsA; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +#[cfg(any(feature = "v1_12", feature = "dox"))] +use gst_rtsp; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct RTSPAuth(Object); + + match fn { + get_type => || ffi::gst_rtsp_auth_get_type(), + } +} + +impl RTSPAuth { + pub fn new() -> RTSPAuth { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_auth_new()) + } + } + + pub fn check(check: &str) -> bool { + assert_initialized_main_thread!(); + unsafe { + from_glib(ffi::gst_rtsp_auth_check(check.to_glib_none().0)) + } + } + + pub fn make_basic(user: &str, pass: &str) -> String { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_auth_make_basic(user.to_glib_none().0, pass.to_glib_none().0)) + } + } +} + +impl Default for RTSPAuth { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Send for RTSPAuth {} +unsafe impl Sync for RTSPAuth {} + +pub trait RTSPAuthExt { + //fn add_basic(&self, basic: &str, token: /*Ignored*/&mut RTSPToken); + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn add_digest(&self, user: &str, pass: &str, token: /*Ignored*/&mut RTSPToken); + + //fn get_default_token(&self) -> /*Ignored*/Option; + + #[cfg(any(feature = "v1_12", feature = "dox"))] + fn get_supported_methods(&self) -> gst_rtsp::RTSPAuthMethod; + + //fn get_tls_authentication_mode(&self) -> /*Ignored*/gio::TlsAuthenticationMode; + + fn get_tls_certificate(&self) -> Option; + + //fn get_tls_database(&self) -> /*Ignored*/Option; + + fn remove_basic(&self, basic: &str); + + #[cfg(any(feature = "v1_12", feature = "dox"))] + fn remove_digest(&self, user: &str); + + //fn set_default_token<'a, P: Into>>(&self, token: P); + + #[cfg(any(feature = "v1_12", feature = "dox"))] + fn set_supported_methods(&self, methods: gst_rtsp::RTSPAuthMethod); + + //fn set_tls_authentication_mode<'a, P: Into>>(&self, mode: P); + + fn set_tls_certificate<'a, P: Into>>(&self, cert: P); + + //fn set_tls_database<'a, P: IsA + 'a, Q: Into>>(&self, database: Q); + + //fn connect_accept_certificate(&self, f: F) -> SignalHandlerId; +} + +impl> RTSPAuthExt for O { + //fn add_basic(&self, basic: &str, token: /*Ignored*/&mut RTSPToken) { + // unsafe { TODO: call ffi::gst_rtsp_auth_add_basic() } + //} + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn add_digest(&self, user: &str, pass: &str, token: /*Ignored*/&mut RTSPToken) { + // unsafe { TODO: call ffi::gst_rtsp_auth_add_digest() } + //} + + //fn get_default_token(&self) -> /*Ignored*/Option { + // unsafe { TODO: call ffi::gst_rtsp_auth_get_default_token() } + //} + + #[cfg(any(feature = "v1_12", feature = "dox"))] + fn get_supported_methods(&self) -> gst_rtsp::RTSPAuthMethod { + unsafe { + from_glib(ffi::gst_rtsp_auth_get_supported_methods(self.to_glib_none().0)) + } + } + + //fn get_tls_authentication_mode(&self) -> /*Ignored*/gio::TlsAuthenticationMode { + // unsafe { TODO: call ffi::gst_rtsp_auth_get_tls_authentication_mode() } + //} + + fn get_tls_certificate(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_auth_get_tls_certificate(self.to_glib_none().0)) + } + } + + //fn get_tls_database(&self) -> /*Ignored*/Option { + // unsafe { TODO: call ffi::gst_rtsp_auth_get_tls_database() } + //} + + fn remove_basic(&self, basic: &str) { + unsafe { + ffi::gst_rtsp_auth_remove_basic(self.to_glib_none().0, basic.to_glib_none().0); + } + } + + #[cfg(any(feature = "v1_12", feature = "dox"))] + fn remove_digest(&self, user: &str) { + unsafe { + ffi::gst_rtsp_auth_remove_digest(self.to_glib_none().0, user.to_glib_none().0); + } + } + + //fn set_default_token<'a, P: Into>>(&self, token: P) { + // unsafe { TODO: call ffi::gst_rtsp_auth_set_default_token() } + //} + + #[cfg(any(feature = "v1_12", feature = "dox"))] + fn set_supported_methods(&self, methods: gst_rtsp::RTSPAuthMethod) { + unsafe { + ffi::gst_rtsp_auth_set_supported_methods(self.to_glib_none().0, methods.to_glib()); + } + } + + //fn set_tls_authentication_mode<'a, P: Into>>(&self, mode: P) { + // unsafe { TODO: call ffi::gst_rtsp_auth_set_tls_authentication_mode() } + //} + + fn set_tls_certificate<'a, P: Into>>(&self, cert: P) { + let cert = cert.into(); + let cert = cert.to_glib_none(); + unsafe { + ffi::gst_rtsp_auth_set_tls_certificate(self.to_glib_none().0, cert.0); + } + } + + //fn set_tls_database<'a, P: IsA + 'a, Q: Into>>(&self, database: Q) { + // unsafe { TODO: call ffi::gst_rtsp_auth_set_tls_database() } + //} + + //fn connect_accept_certificate(&self, f: F) -> SignalHandlerId { + // Ignored connection: Gio.TlsConnection + //} +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_client.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_client.rs new file mode 100644 index 000000000..95d765bfb --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_client.rs @@ -0,0 +1,432 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPAuth; +use RTSPMountPoints; +use RTSPSession; +use RTSPSessionPool; +use RTSPThreadPool; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct RTSPClient(Object); + + match fn { + get_type => || ffi::gst_rtsp_client_get_type(), + } +} + +impl RTSPClient { + pub fn new() -> RTSPClient { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_client_new()) + } + } +} + +impl Default for RTSPClient { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Send for RTSPClient {} +unsafe impl Sync for RTSPClient {} + +pub trait RTSPClientExt { + fn close(&self); + + fn get_auth(&self) -> Option; + + //fn get_connection(&self) -> /*Ignored*/Option; + + fn get_mount_points(&self) -> Option; + + fn get_session_pool(&self) -> Option; + + fn get_thread_pool(&self) -> Option; + + //fn handle_message(&self, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult; + + //fn send_message<'a, P: Into>>(&self, session: P, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult; + + //fn session_filter<'a, P: Into>, Q: Into>>(&self, func: P, user_data: Q) -> Vec; + + fn set_auth<'a, P: Into>>(&self, auth: P); + + //fn set_connection(&self, conn: /*Ignored*/&mut gst_rtsp::RTSPConnection) -> bool; + + fn set_mount_points<'a, P: Into>>(&self, mounts: P); + + //fn set_send_func<'a, P: Into>, Q: Into>>(&self, func: /*Unknown conversion*//*Unimplemented*/RTSPClientSendFunc, user_data: P, notify: Q); + + fn set_session_pool<'a, P: Into>>(&self, pool: P); + + fn set_thread_pool<'a, P: Into>>(&self, pool: P); + + fn get_property_drop_backlog(&self) -> bool; + + fn set_property_drop_backlog(&self, drop_backlog: bool); + + //fn connect_announce_request(&self, f: F) -> SignalHandlerId; + + //fn connect_check_requirements(&self, f: F) -> SignalHandlerId; + + fn connect_closed(&self, f: F) -> SignalHandlerId; + + //fn connect_describe_request(&self, f: F) -> SignalHandlerId; + + //fn connect_get_parameter_request(&self, f: F) -> SignalHandlerId; + + //fn connect_handle_response(&self, f: F) -> SignalHandlerId; + + fn connect_new_session(&self, f: F) -> SignalHandlerId; + + //fn connect_options_request(&self, f: F) -> SignalHandlerId; + + //fn connect_pause_request(&self, f: F) -> SignalHandlerId; + + //fn connect_play_request(&self, f: F) -> SignalHandlerId; + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_announce_request(&self, f: F) -> SignalHandlerId; + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_describe_request(&self, f: F) -> SignalHandlerId; + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_get_parameter_request(&self, f: F) -> SignalHandlerId; + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_options_request(&self, f: F) -> SignalHandlerId; + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_pause_request(&self, f: F) -> SignalHandlerId; + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_play_request(&self, f: F) -> SignalHandlerId; + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_record_request(&self, f: F) -> SignalHandlerId; + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_set_parameter_request(&self, f: F) -> SignalHandlerId; + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_setup_request(&self, f: F) -> SignalHandlerId; + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_teardown_request(&self, f: F) -> SignalHandlerId; + + //fn connect_record_request(&self, f: F) -> SignalHandlerId; + + //fn connect_send_message(&self, f: F) -> SignalHandlerId; + + //fn connect_set_parameter_request(&self, f: F) -> SignalHandlerId; + + //fn connect_setup_request(&self, f: F) -> SignalHandlerId; + + //fn connect_teardown_request(&self, f: F) -> SignalHandlerId; + + fn connect_property_drop_backlog_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_mount_points_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_session_pool_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> RTSPClientExt for O { + fn close(&self) { + unsafe { + ffi::gst_rtsp_client_close(self.to_glib_none().0); + } + } + + fn get_auth(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_client_get_auth(self.to_glib_none().0)) + } + } + + //fn get_connection(&self) -> /*Ignored*/Option { + // unsafe { TODO: call ffi::gst_rtsp_client_get_connection() } + //} + + fn get_mount_points(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_client_get_mount_points(self.to_glib_none().0)) + } + } + + fn get_session_pool(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_client_get_session_pool(self.to_glib_none().0)) + } + } + + fn get_thread_pool(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_client_get_thread_pool(self.to_glib_none().0)) + } + } + + //fn handle_message(&self, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult { + // unsafe { TODO: call ffi::gst_rtsp_client_handle_message() } + //} + + //fn send_message<'a, P: Into>>(&self, session: P, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult { + // unsafe { TODO: call ffi::gst_rtsp_client_send_message() } + //} + + //fn session_filter<'a, P: Into>, Q: Into>>(&self, func: P, user_data: Q) -> Vec { + // unsafe { TODO: call ffi::gst_rtsp_client_session_filter() } + //} + + fn set_auth<'a, P: Into>>(&self, auth: P) { + let auth = auth.into(); + let auth = auth.to_glib_none(); + unsafe { + ffi::gst_rtsp_client_set_auth(self.to_glib_none().0, auth.0); + } + } + + //fn set_connection(&self, conn: /*Ignored*/&mut gst_rtsp::RTSPConnection) -> bool { + // unsafe { TODO: call ffi::gst_rtsp_client_set_connection() } + //} + + fn set_mount_points<'a, P: Into>>(&self, mounts: P) { + let mounts = mounts.into(); + let mounts = mounts.to_glib_none(); + unsafe { + ffi::gst_rtsp_client_set_mount_points(self.to_glib_none().0, mounts.0); + } + } + + //fn set_send_func<'a, P: Into>, Q: Into>>(&self, func: /*Unknown conversion*//*Unimplemented*/RTSPClientSendFunc, user_data: P, notify: Q) { + // unsafe { TODO: call ffi::gst_rtsp_client_set_send_func() } + //} + + fn set_session_pool<'a, P: Into>>(&self, pool: P) { + let pool = pool.into(); + let pool = pool.to_glib_none(); + unsafe { + ffi::gst_rtsp_client_set_session_pool(self.to_glib_none().0, pool.0); + } + } + + fn set_thread_pool<'a, P: Into>>(&self, pool: P) { + let pool = pool.into(); + let pool = pool.to_glib_none(); + unsafe { + ffi::gst_rtsp_client_set_thread_pool(self.to_glib_none().0, pool.0); + } + } + + fn get_property_drop_backlog(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "drop-backlog".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn set_property_drop_backlog(&self, drop_backlog: bool) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "drop-backlog".to_glib_none().0, Value::from(&drop_backlog).to_glib_none().0); + } + } + + //fn connect_announce_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //fn connect_check_requirements(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + // Empty ctype arr: *.CArray TypeId { ns_id: 0, id: 28 } + //} + + fn connect_closed(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "closed", + transmute(closed_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + //fn connect_describe_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //fn connect_get_parameter_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //fn connect_handle_response(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + fn connect_new_session(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "new-session", + transmute(new_session_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + //fn connect_options_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //fn connect_pause_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //fn connect_play_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_announce_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_describe_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_get_parameter_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_options_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_pause_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_play_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_record_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_set_parameter_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_setup_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //#[cfg(any(feature = "v1_12", feature = "dox"))] + //fn connect_pre_teardown_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //fn connect_record_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //fn connect_send_message(&self, f: F) -> SignalHandlerId { + // Ignored message: GstRtsp.RTSPMessage + //} + + //fn connect_set_parameter_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //fn connect_setup_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + //fn connect_teardown_request(&self, f: F) -> SignalHandlerId { + // Ignored ctx: GstRtspServer.RTSPContext + //} + + fn connect_property_drop_backlog_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::drop-backlog", + transmute(notify_drop_backlog_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_mount_points_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::mount-points", + transmute(notify_mount_points_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_session_pool_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::session-pool", + transmute(notify_session_pool_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn closed_trampoline

(this: *mut ffi::GstRTSPClient, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPClient::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn new_session_trampoline

(this: *mut ffi::GstRTSPClient, object: *mut ffi::GstRTSPSession, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &RTSPSession) + Send + Sync + 'static) = transmute(f); + f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object)) +} + +unsafe extern "C" fn notify_drop_backlog_trampoline

(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPClient::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_mount_points_trampoline

(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPClient::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_session_pool_trampoline

(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPClient::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_media.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_media.rs new file mode 100644 index 000000000..a298f40d4 --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_media.rs @@ -0,0 +1,845 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPAddressPool; +use RTSPMediaStatus; +use RTSPPublishClockMode; +use RTSPStream; +use RTSPSuspendMode; +use RTSPTransportMode; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use gst_rtsp; +use libc; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct RTSPMedia(Object); + + match fn { + get_type => || ffi::gst_rtsp_media_get_type(), + } +} + +impl RTSPMedia { + pub fn new>(element: &P) -> RTSPMedia { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_media_new(element.to_glib_full())) + } + } +} + +unsafe impl Send for RTSPMedia {} +unsafe impl Sync for RTSPMedia {} + +pub trait RTSPMediaExt { + fn collect_streams(&self); + + fn create_stream, Q: IsA>(&self, payloader: &P, pad: &Q) -> Option; + + fn find_stream(&self, control: &str) -> Option; + + fn get_address_pool(&self) -> Option; + + fn get_base_time(&self) -> gst::ClockTime; + + fn get_buffer_size(&self) -> u32; + + fn get_clock(&self) -> Option; + + fn get_element(&self) -> Option; + + fn get_latency(&self) -> u32; + + fn get_multicast_iface(&self) -> Option; + + //fn get_permissions(&self) -> /*Ignored*/Option; + + fn get_profiles(&self) -> gst_rtsp::RTSPProfile; + + fn get_protocols(&self) -> gst_rtsp::RTSPLowerTrans; + + fn get_publish_clock_mode(&self) -> RTSPPublishClockMode; + + fn get_range_string(&self, play: bool, unit: gst_rtsp::RTSPRangeUnit) -> Option; + + fn get_retransmission_time(&self) -> gst::ClockTime; + + fn get_status(&self) -> RTSPMediaStatus; + + fn get_stream(&self, idx: u32) -> Option; + + fn get_suspend_mode(&self) -> RTSPSuspendMode; + + //fn get_time_provider<'a, P: Into>>(&self, address: P, port: u16) -> /*Ignored*/Option; + + fn get_transport_mode(&self) -> RTSPTransportMode; + + //fn handle_sdp(&self, sdp: /*Ignored*/&mut gst_sdp::SDPMessage) -> bool; + + fn is_eos_shutdown(&self) -> bool; + + fn is_reusable(&self) -> bool; + + fn is_shared(&self) -> bool; + + fn is_stop_on_disconnect(&self) -> bool; + + fn is_time_provider(&self) -> bool; + + fn n_streams(&self) -> u32; + + //fn prepare<'a, P: Into>>(&self, thread: P) -> bool; + + //fn seek(&self, range: /*Ignored*/&mut gst_rtsp::RTSPTimeRange) -> bool; + + fn set_address_pool<'a, P: Into>>(&self, pool: P); + + fn set_buffer_size(&self, size: u32); + + fn set_clock<'a, P: IsA + 'a, Q: Into>>(&self, clock: Q); + + fn set_eos_shutdown(&self, eos_shutdown: bool); + + fn set_latency(&self, latency: u32); + + fn set_multicast_iface<'a, P: Into>>(&self, multicast_iface: P); + + //fn set_permissions<'a, P: Into>>(&self, permissions: P); + + fn set_pipeline_state(&self, state: gst::State); + + fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile); + + fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans); + + fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode); + + fn set_retransmission_time(&self, time: gst::ClockTime); + + fn set_reusable(&self, reusable: bool); + + fn set_shared(&self, shared: bool); + + //fn set_state(&self, state: gst::State, transports: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 26 }) -> bool; + + fn set_stop_on_disconnect(&self, stop_on_disconnect: bool); + + fn set_suspend_mode(&self, mode: RTSPSuspendMode); + + fn set_transport_mode(&self, mode: RTSPTransportMode); + + //fn setup_sdp(&self, sdp: /*Ignored*/&mut gst_sdp::SDPMessage, info: /*Ignored*/&mut SDPInfo) -> bool; + + fn suspend(&self) -> Result<(), glib::error::BoolError>; + + fn take_pipeline(&self, pipeline: &gst::Pipeline); + + fn unprepare(&self) -> Result<(), glib::error::BoolError>; + + fn unsuspend(&self) -> Result<(), glib::error::BoolError>; + + fn use_time_provider(&self, time_provider: bool); + + fn get_property_eos_shutdown(&self) -> bool; + + fn get_property_reusable(&self) -> bool; + + fn get_property_shared(&self) -> bool; + + fn get_property_stop_on_disconnect(&self) -> bool; + + fn set_property_time_provider(&self, time_provider: bool); + + fn connect_new_state(&self, f: F) -> SignalHandlerId; + + fn connect_new_stream(&self, f: F) -> SignalHandlerId; + + fn connect_prepared(&self, f: F) -> SignalHandlerId; + + fn connect_removed_stream(&self, f: F) -> SignalHandlerId; + + fn connect_target_state(&self, f: F) -> SignalHandlerId; + + fn connect_unprepared(&self, f: F) -> SignalHandlerId; + + fn connect_property_buffer_size_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_clock_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_element_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_eos_shutdown_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_latency_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_profiles_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_protocols_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_reusable_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_shared_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_stop_on_disconnect_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_suspend_mode_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_time_provider_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_transport_mode_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> RTSPMediaExt for O { + fn collect_streams(&self) { + unsafe { + ffi::gst_rtsp_media_collect_streams(self.to_glib_none().0); + } + } + + fn create_stream, Q: IsA>(&self, payloader: &P, pad: &Q) -> Option { + unsafe { + from_glib_none(ffi::gst_rtsp_media_create_stream(self.to_glib_none().0, payloader.to_glib_none().0, pad.to_glib_none().0)) + } + } + + fn find_stream(&self, control: &str) -> Option { + unsafe { + from_glib_none(ffi::gst_rtsp_media_find_stream(self.to_glib_none().0, control.to_glib_none().0)) + } + } + + fn get_address_pool(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_media_get_address_pool(self.to_glib_none().0)) + } + } + + fn get_base_time(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::gst_rtsp_media_get_base_time(self.to_glib_none().0)) + } + } + + fn get_buffer_size(&self) -> u32 { + unsafe { + ffi::gst_rtsp_media_get_buffer_size(self.to_glib_none().0) + } + } + + fn get_clock(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_media_get_clock(self.to_glib_none().0)) + } + } + + fn get_element(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_media_get_element(self.to_glib_none().0)) + } + } + + fn get_latency(&self) -> u32 { + unsafe { + ffi::gst_rtsp_media_get_latency(self.to_glib_none().0) + } + } + + fn get_multicast_iface(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_media_get_multicast_iface(self.to_glib_none().0)) + } + } + + //fn get_permissions(&self) -> /*Ignored*/Option { + // unsafe { TODO: call ffi::gst_rtsp_media_get_permissions() } + //} + + fn get_profiles(&self) -> gst_rtsp::RTSPProfile { + unsafe { + from_glib(ffi::gst_rtsp_media_get_profiles(self.to_glib_none().0)) + } + } + + fn get_protocols(&self) -> gst_rtsp::RTSPLowerTrans { + unsafe { + from_glib(ffi::gst_rtsp_media_get_protocols(self.to_glib_none().0)) + } + } + + fn get_publish_clock_mode(&self) -> RTSPPublishClockMode { + unsafe { + from_glib(ffi::gst_rtsp_media_get_publish_clock_mode(self.to_glib_none().0)) + } + } + + fn get_range_string(&self, play: bool, unit: gst_rtsp::RTSPRangeUnit) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_media_get_range_string(self.to_glib_none().0, play.to_glib(), unit.to_glib())) + } + } + + fn get_retransmission_time(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::gst_rtsp_media_get_retransmission_time(self.to_glib_none().0)) + } + } + + fn get_status(&self) -> RTSPMediaStatus { + unsafe { + from_glib(ffi::gst_rtsp_media_get_status(self.to_glib_none().0)) + } + } + + fn get_stream(&self, idx: u32) -> Option { + unsafe { + from_glib_none(ffi::gst_rtsp_media_get_stream(self.to_glib_none().0, idx)) + } + } + + fn get_suspend_mode(&self) -> RTSPSuspendMode { + unsafe { + from_glib(ffi::gst_rtsp_media_get_suspend_mode(self.to_glib_none().0)) + } + } + + //fn get_time_provider<'a, P: Into>>(&self, address: P, port: u16) -> /*Ignored*/Option { + // unsafe { TODO: call ffi::gst_rtsp_media_get_time_provider() } + //} + + fn get_transport_mode(&self) -> RTSPTransportMode { + unsafe { + from_glib(ffi::gst_rtsp_media_get_transport_mode(self.to_glib_none().0)) + } + } + + //fn handle_sdp(&self, sdp: /*Ignored*/&mut gst_sdp::SDPMessage) -> bool { + // unsafe { TODO: call ffi::gst_rtsp_media_handle_sdp() } + //} + + fn is_eos_shutdown(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_media_is_eos_shutdown(self.to_glib_none().0)) + } + } + + fn is_reusable(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_media_is_reusable(self.to_glib_none().0)) + } + } + + fn is_shared(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_media_is_shared(self.to_glib_none().0)) + } + } + + fn is_stop_on_disconnect(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_media_is_stop_on_disconnect(self.to_glib_none().0)) + } + } + + fn is_time_provider(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_media_is_time_provider(self.to_glib_none().0)) + } + } + + fn n_streams(&self) -> u32 { + unsafe { + ffi::gst_rtsp_media_n_streams(self.to_glib_none().0) + } + } + + //fn prepare<'a, P: Into>>(&self, thread: P) -> bool { + // unsafe { TODO: call ffi::gst_rtsp_media_prepare() } + //} + + //fn seek(&self, range: /*Ignored*/&mut gst_rtsp::RTSPTimeRange) -> bool { + // unsafe { TODO: call ffi::gst_rtsp_media_seek() } + //} + + fn set_address_pool<'a, P: Into>>(&self, pool: P) { + let pool = pool.into(); + let pool = pool.to_glib_none(); + unsafe { + ffi::gst_rtsp_media_set_address_pool(self.to_glib_none().0, pool.0); + } + } + + fn set_buffer_size(&self, size: u32) { + unsafe { + ffi::gst_rtsp_media_set_buffer_size(self.to_glib_none().0, size); + } + } + + fn set_clock<'a, P: IsA + 'a, Q: Into>>(&self, clock: Q) { + let clock = clock.into(); + let clock = clock.to_glib_none(); + unsafe { + ffi::gst_rtsp_media_set_clock(self.to_glib_none().0, clock.0); + } + } + + fn set_eos_shutdown(&self, eos_shutdown: bool) { + unsafe { + ffi::gst_rtsp_media_set_eos_shutdown(self.to_glib_none().0, eos_shutdown.to_glib()); + } + } + + fn set_latency(&self, latency: u32) { + unsafe { + ffi::gst_rtsp_media_set_latency(self.to_glib_none().0, latency); + } + } + + fn set_multicast_iface<'a, P: Into>>(&self, multicast_iface: P) { + let multicast_iface = multicast_iface.into(); + let multicast_iface = multicast_iface.to_glib_none(); + unsafe { + ffi::gst_rtsp_media_set_multicast_iface(self.to_glib_none().0, multicast_iface.0); + } + } + + //fn set_permissions<'a, P: Into>>(&self, permissions: P) { + // unsafe { TODO: call ffi::gst_rtsp_media_set_permissions() } + //} + + fn set_pipeline_state(&self, state: gst::State) { + unsafe { + ffi::gst_rtsp_media_set_pipeline_state(self.to_glib_none().0, state.to_glib()); + } + } + + fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) { + unsafe { + ffi::gst_rtsp_media_set_profiles(self.to_glib_none().0, profiles.to_glib()); + } + } + + fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) { + unsafe { + ffi::gst_rtsp_media_set_protocols(self.to_glib_none().0, protocols.to_glib()); + } + } + + fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) { + unsafe { + ffi::gst_rtsp_media_set_publish_clock_mode(self.to_glib_none().0, mode.to_glib()); + } + } + + fn set_retransmission_time(&self, time: gst::ClockTime) { + unsafe { + ffi::gst_rtsp_media_set_retransmission_time(self.to_glib_none().0, time.to_glib()); + } + } + + fn set_reusable(&self, reusable: bool) { + unsafe { + ffi::gst_rtsp_media_set_reusable(self.to_glib_none().0, reusable.to_glib()); + } + } + + fn set_shared(&self, shared: bool) { + unsafe { + ffi::gst_rtsp_media_set_shared(self.to_glib_none().0, shared.to_glib()); + } + } + + //fn set_state(&self, state: gst::State, transports: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 26 }) -> bool { + // unsafe { TODO: call ffi::gst_rtsp_media_set_state() } + //} + + fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) { + unsafe { + ffi::gst_rtsp_media_set_stop_on_disconnect(self.to_glib_none().0, stop_on_disconnect.to_glib()); + } + } + + fn set_suspend_mode(&self, mode: RTSPSuspendMode) { + unsafe { + ffi::gst_rtsp_media_set_suspend_mode(self.to_glib_none().0, mode.to_glib()); + } + } + + fn set_transport_mode(&self, mode: RTSPTransportMode) { + unsafe { + ffi::gst_rtsp_media_set_transport_mode(self.to_glib_none().0, mode.to_glib()); + } + } + + //fn setup_sdp(&self, sdp: /*Ignored*/&mut gst_sdp::SDPMessage, info: /*Ignored*/&mut SDPInfo) -> bool { + // unsafe { TODO: call ffi::gst_rtsp_media_setup_sdp() } + //} + + fn suspend(&self) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_media_suspend(self.to_glib_none().0), "Failed to suspend media") + } + } + + fn take_pipeline(&self, pipeline: &gst::Pipeline) { + unsafe { + ffi::gst_rtsp_media_take_pipeline(self.to_glib_none().0, pipeline.to_glib_full()); + } + } + + fn unprepare(&self) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_media_unprepare(self.to_glib_none().0), "Failed to unprepare media") + } + } + + fn unsuspend(&self) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_media_unsuspend(self.to_glib_none().0), "Failed to unsuspend media") + } + } + + fn use_time_provider(&self, time_provider: bool) { + unsafe { + ffi::gst_rtsp_media_use_time_provider(self.to_glib_none().0, time_provider.to_glib()); + } + } + + fn get_property_eos_shutdown(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "eos-shutdown".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn get_property_reusable(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "reusable".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn get_property_shared(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "shared".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn get_property_stop_on_disconnect(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "stop-on-disconnect".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn set_property_time_provider(&self, time_provider: bool) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "time-provider".to_glib_none().0, Value::from(&time_provider).to_glib_none().0); + } + } + + fn connect_new_state(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "new-state", + transmute(new_state_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_new_stream(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "new-stream", + transmute(new_stream_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_prepared(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "prepared", + transmute(prepared_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_removed_stream(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "removed-stream", + transmute(removed_stream_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_target_state(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "target-state", + transmute(target_state_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_unprepared(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "unprepared", + transmute(unprepared_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_buffer_size_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::buffer-size", + transmute(notify_buffer_size_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_clock_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::clock", + transmute(notify_clock_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_element_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::element", + transmute(notify_element_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_eos_shutdown_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::eos-shutdown", + transmute(notify_eos_shutdown_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_latency_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::latency", + transmute(notify_latency_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_profiles_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::profiles", + transmute(notify_profiles_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_protocols_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::protocols", + transmute(notify_protocols_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_reusable_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::reusable", + transmute(notify_reusable_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_shared_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::shared", + transmute(notify_shared_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_stop_on_disconnect_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::stop-on-disconnect", + transmute(notify_stop_on_disconnect_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_suspend_mode_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::suspend-mode", + transmute(notify_suspend_mode_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_time_provider_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::time-provider", + transmute(notify_time_provider_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_transport_mode_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::transport-mode", + transmute(notify_transport_mode_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn new_state_trampoline

(this: *mut ffi::GstRTSPMedia, object: libc::c_int, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, i32) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked(), object) +} + +unsafe extern "C" fn new_stream_trampoline

(this: *mut ffi::GstRTSPMedia, object: *mut ffi::GstRTSPStream, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &RTSPStream) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object)) +} + +unsafe extern "C" fn prepared_trampoline

(this: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn removed_stream_trampoline

(this: *mut ffi::GstRTSPMedia, object: *mut ffi::GstRTSPStream, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &RTSPStream) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object)) +} + +unsafe extern "C" fn target_state_trampoline

(this: *mut ffi::GstRTSPMedia, object: libc::c_int, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, i32) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked(), object) +} + +unsafe extern "C" fn unprepared_trampoline

(this: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_buffer_size_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_clock_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_element_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_eos_shutdown_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_latency_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_profiles_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_protocols_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_reusable_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_shared_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_stop_on_disconnect_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_suspend_mode_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_time_provider_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_transport_mode_trampoline

(this: *mut ffi::GstRTSPMedia, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMedia::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_media_factory.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_media_factory.rs new file mode 100644 index 000000000..d694a6ae5 --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_media_factory.rs @@ -0,0 +1,603 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPAddressPool; +use RTSPMedia; +use RTSPPublishClockMode; +use RTSPSuspendMode; +use RTSPTransportMode; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use gst_rtsp; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct RTSPMediaFactory(Object); + + match fn { + get_type => || ffi::gst_rtsp_media_factory_get_type(), + } +} + +impl RTSPMediaFactory { + pub fn new() -> RTSPMediaFactory { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_media_factory_new()) + } + } +} + +impl Default for RTSPMediaFactory { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Send for RTSPMediaFactory {} +unsafe impl Sync for RTSPMediaFactory {} + +pub trait RTSPMediaFactoryExt { + //fn add_role(&self, role: &str, fieldname: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs); + + fn construct(&self, url: &gst_rtsp::RTSPUrl) -> Option; + + fn create_element(&self, url: &gst_rtsp::RTSPUrl) -> Option; + + fn get_address_pool(&self) -> Option; + + fn get_buffer_size(&self) -> u32; + + fn get_clock(&self) -> Option; + + fn get_latency(&self) -> u32; + + fn get_launch(&self) -> Option; + + fn get_media_gtype(&self) -> glib::types::Type; + + fn get_multicast_iface(&self) -> Option; + + //fn get_permissions(&self) -> /*Ignored*/Option; + + fn get_profiles(&self) -> gst_rtsp::RTSPProfile; + + fn get_protocols(&self) -> gst_rtsp::RTSPLowerTrans; + + fn get_publish_clock_mode(&self) -> RTSPPublishClockMode; + + fn get_retransmission_time(&self) -> gst::ClockTime; + + fn get_suspend_mode(&self) -> RTSPSuspendMode; + + fn get_transport_mode(&self) -> RTSPTransportMode; + + fn is_eos_shutdown(&self) -> bool; + + fn is_shared(&self) -> bool; + + fn is_stop_on_disonnect(&self) -> bool; + + fn set_address_pool<'a, P: Into>>(&self, pool: P); + + fn set_buffer_size(&self, size: u32); + + fn set_clock<'a, P: IsA + 'a, Q: Into>>(&self, clock: Q); + + fn set_eos_shutdown(&self, eos_shutdown: bool); + + fn set_latency(&self, latency: u32); + + fn set_launch(&self, launch: &str); + + fn set_media_gtype(&self, media_gtype: glib::types::Type); + + fn set_multicast_iface<'a, P: Into>>(&self, multicast_iface: P); + + //fn set_permissions<'a, P: Into>>(&self, permissions: P); + + fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile); + + fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans); + + fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode); + + fn set_retransmission_time(&self, time: gst::ClockTime); + + fn set_shared(&self, shared: bool); + + fn set_stop_on_disconnect(&self, stop_on_disconnect: bool); + + fn set_suspend_mode(&self, mode: RTSPSuspendMode); + + fn set_transport_mode(&self, mode: RTSPTransportMode); + + fn get_property_eos_shutdown(&self) -> bool; + + fn get_property_shared(&self) -> bool; + + fn get_property_stop_on_disconnect(&self) -> bool; + + fn connect_media_configure(&self, f: F) -> SignalHandlerId; + + fn connect_media_constructed(&self, f: F) -> SignalHandlerId; + + fn connect_property_buffer_size_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_clock_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_eos_shutdown_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_latency_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_launch_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_profiles_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_protocols_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_shared_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_stop_on_disconnect_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_suspend_mode_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_transport_mode_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> RTSPMediaFactoryExt for O { + //fn add_role(&self, role: &str, fieldname: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { + // unsafe { TODO: call ffi::gst_rtsp_media_factory_add_role() } + //} + + fn construct(&self, url: &gst_rtsp::RTSPUrl) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_media_factory_construct(self.to_glib_none().0, url.to_glib_none().0)) + } + } + + fn create_element(&self, url: &gst_rtsp::RTSPUrl) -> Option { + unsafe { + from_glib_none(ffi::gst_rtsp_media_factory_create_element(self.to_glib_none().0, url.to_glib_none().0)) + } + } + + fn get_address_pool(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_media_factory_get_address_pool(self.to_glib_none().0)) + } + } + + fn get_buffer_size(&self) -> u32 { + unsafe { + ffi::gst_rtsp_media_factory_get_buffer_size(self.to_glib_none().0) + } + } + + fn get_clock(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_media_factory_get_clock(self.to_glib_none().0)) + } + } + + fn get_latency(&self) -> u32 { + unsafe { + ffi::gst_rtsp_media_factory_get_latency(self.to_glib_none().0) + } + } + + fn get_launch(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_media_factory_get_launch(self.to_glib_none().0)) + } + } + + fn get_media_gtype(&self) -> glib::types::Type { + unsafe { + from_glib(ffi::gst_rtsp_media_factory_get_media_gtype(self.to_glib_none().0)) + } + } + + fn get_multicast_iface(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_media_factory_get_multicast_iface(self.to_glib_none().0)) + } + } + + //fn get_permissions(&self) -> /*Ignored*/Option { + // unsafe { TODO: call ffi::gst_rtsp_media_factory_get_permissions() } + //} + + fn get_profiles(&self) -> gst_rtsp::RTSPProfile { + unsafe { + from_glib(ffi::gst_rtsp_media_factory_get_profiles(self.to_glib_none().0)) + } + } + + fn get_protocols(&self) -> gst_rtsp::RTSPLowerTrans { + unsafe { + from_glib(ffi::gst_rtsp_media_factory_get_protocols(self.to_glib_none().0)) + } + } + + fn get_publish_clock_mode(&self) -> RTSPPublishClockMode { + unsafe { + from_glib(ffi::gst_rtsp_media_factory_get_publish_clock_mode(self.to_glib_none().0)) + } + } + + fn get_retransmission_time(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::gst_rtsp_media_factory_get_retransmission_time(self.to_glib_none().0)) + } + } + + fn get_suspend_mode(&self) -> RTSPSuspendMode { + unsafe { + from_glib(ffi::gst_rtsp_media_factory_get_suspend_mode(self.to_glib_none().0)) + } + } + + fn get_transport_mode(&self) -> RTSPTransportMode { + unsafe { + from_glib(ffi::gst_rtsp_media_factory_get_transport_mode(self.to_glib_none().0)) + } + } + + fn is_eos_shutdown(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_media_factory_is_eos_shutdown(self.to_glib_none().0)) + } + } + + fn is_shared(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_media_factory_is_shared(self.to_glib_none().0)) + } + } + + fn is_stop_on_disonnect(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_media_factory_is_stop_on_disonnect(self.to_glib_none().0)) + } + } + + fn set_address_pool<'a, P: Into>>(&self, pool: P) { + let pool = pool.into(); + let pool = pool.to_glib_none(); + unsafe { + ffi::gst_rtsp_media_factory_set_address_pool(self.to_glib_none().0, pool.0); + } + } + + fn set_buffer_size(&self, size: u32) { + unsafe { + ffi::gst_rtsp_media_factory_set_buffer_size(self.to_glib_none().0, size); + } + } + + fn set_clock<'a, P: IsA + 'a, Q: Into>>(&self, clock: Q) { + let clock = clock.into(); + let clock = clock.to_glib_none(); + unsafe { + ffi::gst_rtsp_media_factory_set_clock(self.to_glib_none().0, clock.0); + } + } + + fn set_eos_shutdown(&self, eos_shutdown: bool) { + unsafe { + ffi::gst_rtsp_media_factory_set_eos_shutdown(self.to_glib_none().0, eos_shutdown.to_glib()); + } + } + + fn set_latency(&self, latency: u32) { + unsafe { + ffi::gst_rtsp_media_factory_set_latency(self.to_glib_none().0, latency); + } + } + + fn set_launch(&self, launch: &str) { + unsafe { + ffi::gst_rtsp_media_factory_set_launch(self.to_glib_none().0, launch.to_glib_none().0); + } + } + + fn set_media_gtype(&self, media_gtype: glib::types::Type) { + unsafe { + ffi::gst_rtsp_media_factory_set_media_gtype(self.to_glib_none().0, media_gtype.to_glib()); + } + } + + fn set_multicast_iface<'a, P: Into>>(&self, multicast_iface: P) { + let multicast_iface = multicast_iface.into(); + let multicast_iface = multicast_iface.to_glib_none(); + unsafe { + ffi::gst_rtsp_media_factory_set_multicast_iface(self.to_glib_none().0, multicast_iface.0); + } + } + + //fn set_permissions<'a, P: Into>>(&self, permissions: P) { + // unsafe { TODO: call ffi::gst_rtsp_media_factory_set_permissions() } + //} + + fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) { + unsafe { + ffi::gst_rtsp_media_factory_set_profiles(self.to_glib_none().0, profiles.to_glib()); + } + } + + fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) { + unsafe { + ffi::gst_rtsp_media_factory_set_protocols(self.to_glib_none().0, protocols.to_glib()); + } + } + + fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) { + unsafe { + ffi::gst_rtsp_media_factory_set_publish_clock_mode(self.to_glib_none().0, mode.to_glib()); + } + } + + fn set_retransmission_time(&self, time: gst::ClockTime) { + unsafe { + ffi::gst_rtsp_media_factory_set_retransmission_time(self.to_glib_none().0, time.to_glib()); + } + } + + fn set_shared(&self, shared: bool) { + unsafe { + ffi::gst_rtsp_media_factory_set_shared(self.to_glib_none().0, shared.to_glib()); + } + } + + fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) { + unsafe { + ffi::gst_rtsp_media_factory_set_stop_on_disconnect(self.to_glib_none().0, stop_on_disconnect.to_glib()); + } + } + + fn set_suspend_mode(&self, mode: RTSPSuspendMode) { + unsafe { + ffi::gst_rtsp_media_factory_set_suspend_mode(self.to_glib_none().0, mode.to_glib()); + } + } + + fn set_transport_mode(&self, mode: RTSPTransportMode) { + unsafe { + ffi::gst_rtsp_media_factory_set_transport_mode(self.to_glib_none().0, mode.to_glib()); + } + } + + fn get_property_eos_shutdown(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "eos-shutdown".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn get_property_shared(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "shared".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn get_property_stop_on_disconnect(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "stop-on-disconnect".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn connect_media_configure(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "media-configure", + transmute(media_configure_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_media_constructed(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "media-constructed", + transmute(media_constructed_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_buffer_size_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::buffer-size", + transmute(notify_buffer_size_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_clock_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::clock", + transmute(notify_clock_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_eos_shutdown_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::eos-shutdown", + transmute(notify_eos_shutdown_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_latency_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::latency", + transmute(notify_latency_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_launch_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::launch", + transmute(notify_launch_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_profiles_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::profiles", + transmute(notify_profiles_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_protocols_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::protocols", + transmute(notify_protocols_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_shared_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::shared", + transmute(notify_shared_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_stop_on_disconnect_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::stop-on-disconnect", + transmute(notify_stop_on_disconnect_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_suspend_mode_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::suspend-mode", + transmute(notify_suspend_mode_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_transport_mode_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::transport-mode", + transmute(notify_transport_mode_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn media_configure_trampoline

(this: *mut ffi::GstRTSPMediaFactory, object: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &RTSPMedia) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object)) +} + +unsafe extern "C" fn media_constructed_trampoline

(this: *mut ffi::GstRTSPMediaFactory, object: *mut ffi::GstRTSPMedia, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &RTSPMedia) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object)) +} + +unsafe extern "C" fn notify_buffer_size_trampoline

(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_clock_trampoline

(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_eos_shutdown_trampoline

(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_latency_trampoline

(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_launch_trampoline

(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_profiles_trampoline

(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_protocols_trampoline

(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_shared_trampoline

(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_stop_on_disconnect_trampoline

(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_suspend_mode_trampoline

(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_transport_mode_trampoline

(this: *mut ffi::GstRTSPMediaFactory, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactory::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_media_factory_u_r_i.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_media_factory_u_r_i.rs new file mode 100644 index 000000000..b2e2aa72f --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_media_factory_u_r_i.rs @@ -0,0 +1,118 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPMediaFactory; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct RTSPMediaFactoryURI(Object): RTSPMediaFactory; + + match fn { + get_type => || ffi::gst_rtsp_media_factory_uri_get_type(), + } +} + +impl RTSPMediaFactoryURI { + pub fn new() -> RTSPMediaFactoryURI { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_media_factory_uri_new()) + } + } +} + +impl Default for RTSPMediaFactoryURI { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Send for RTSPMediaFactoryURI {} +unsafe impl Sync for RTSPMediaFactoryURI {} + +pub trait RTSPMediaFactoryURIExt { + fn get_uri(&self) -> Option; + + fn set_uri(&self, uri: &str); + + fn get_property_use_gstpay(&self) -> bool; + + fn set_property_use_gstpay(&self, use_gstpay: bool); + + fn connect_property_uri_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_use_gstpay_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> RTSPMediaFactoryURIExt for O { + fn get_uri(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_media_factory_uri_get_uri(self.to_glib_none().0)) + } + } + + fn set_uri(&self, uri: &str) { + unsafe { + ffi::gst_rtsp_media_factory_uri_set_uri(self.to_glib_none().0, uri.to_glib_none().0); + } + } + + fn get_property_use_gstpay(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "use-gstpay".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn set_property_use_gstpay(&self, use_gstpay: bool) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "use-gstpay".to_glib_none().0, Value::from(&use_gstpay).to_glib_none().0); + } + } + + fn connect_property_uri_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::uri", + transmute(notify_uri_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_use_gstpay_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::use-gstpay", + transmute(notify_use_gstpay_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_uri_trampoline

(this: *mut ffi::GstRTSPMediaFactoryURI, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactoryURI::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_use_gstpay_trampoline

(this: *mut ffi::GstRTSPMediaFactoryURI, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPMediaFactoryURI::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_mount_points.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_mount_points.rs new file mode 100644 index 000000000..a00856561 --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_mount_points.rs @@ -0,0 +1,77 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPMediaFactory; +use ffi; +use glib::object::IsA; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst_rtsp; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct RTSPMountPoints(Object); + + match fn { + get_type => || ffi::gst_rtsp_mount_points_get_type(), + } +} + +impl RTSPMountPoints { + pub fn new() -> RTSPMountPoints { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_mount_points_new()) + } + } +} + +impl Default for RTSPMountPoints { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Send for RTSPMountPoints {} +unsafe impl Sync for RTSPMountPoints {} + +pub trait RTSPMountPointsExt { + fn add_factory>(&self, path: &str, factory: &P); + + fn make_path(&self, url: &gst_rtsp::RTSPUrl) -> Option; + + fn match_(&self, path: &str) -> (RTSPMediaFactory, i32); + + fn remove_factory(&self, path: &str); +} + +impl> RTSPMountPointsExt for O { + fn add_factory>(&self, path: &str, factory: &P) { + unsafe { + ffi::gst_rtsp_mount_points_add_factory(self.to_glib_none().0, path.to_glib_none().0, factory.to_glib_full()); + } + } + + fn make_path(&self, url: &gst_rtsp::RTSPUrl) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_mount_points_make_path(self.to_glib_none().0, url.to_glib_none().0)) + } + } + + fn match_(&self, path: &str) -> (RTSPMediaFactory, i32) { + unsafe { + let mut matched = mem::uninitialized(); + let ret = from_glib_full(ffi::gst_rtsp_mount_points_match(self.to_glib_none().0, path.to_glib_none().0, &mut matched)); + (ret, matched) + } + } + + fn remove_factory(&self, path: &str) { + unsafe { + ffi::gst_rtsp_mount_points_remove_factory(self.to_glib_none().0, path.to_glib_none().0); + } + } +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_server.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_server.rs new file mode 100644 index 000000000..8506faa11 --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_server.rs @@ -0,0 +1,348 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use Error; +use RTSPAuth; +use RTSPClient; +use RTSPMountPoints; +use RTSPSessionPool; +use RTSPThreadPool; +use ffi; +use gio; +use glib; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct RTSPServer(Object); + + match fn { + get_type => || ffi::gst_rtsp_server_get_type(), + } +} + +impl RTSPServer { + pub fn new() -> RTSPServer { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_server_new()) + } + } + + pub fn io_func(socket: &gio::Socket, condition: glib::IOCondition, server: &RTSPServer) -> bool { + skip_assert_initialized!(); + unsafe { + from_glib(ffi::gst_rtsp_server_io_func(socket.to_glib_none().0, condition.to_glib(), server.to_glib_none().0)) + } + } +} + +impl Default for RTSPServer { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Send for RTSPServer {} +unsafe impl Sync for RTSPServer {} + +pub trait RTSPServerExt { + //fn client_filter<'a, P: Into>, Q: Into>>(&self, func: P, user_data: Q) -> Vec; + + fn create_socket<'a, P: Into>>(&self, cancellable: P) -> Result; + + fn create_source<'a, P: Into>>(&self, cancellable: P) -> Result; + + fn get_address(&self) -> Option; + + fn get_auth(&self) -> Option; + + fn get_backlog(&self) -> i32; + + fn get_bound_port(&self) -> i32; + + fn get_mount_points(&self) -> Option; + + fn get_service(&self) -> Option; + + fn get_session_pool(&self) -> Option; + + fn get_thread_pool(&self) -> Option; + + fn set_address(&self, address: &str); + + fn set_auth<'a, P: Into>>(&self, auth: P); + + fn set_backlog(&self, backlog: i32); + + fn set_mount_points<'a, P: Into>>(&self, mounts: P); + + fn set_service(&self, service: &str); + + fn set_session_pool<'a, P: Into>>(&self, pool: P); + + fn set_thread_pool<'a, P: Into>>(&self, pool: P); + + fn transfer_connection<'a, P: Into>>(&self, socket: &gio::Socket, ip: &str, port: i32, initial_buffer: P) -> bool; + + fn connect_client_connected(&self, f: F) -> SignalHandlerId; + + fn connect_property_address_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_backlog_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_bound_port_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_mount_points_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_service_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_session_pool_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> RTSPServerExt for O { + //fn client_filter<'a, P: Into>, Q: Into>>(&self, func: P, user_data: Q) -> Vec { + // unsafe { TODO: call ffi::gst_rtsp_server_client_filter() } + //} + + fn create_socket<'a, P: Into>>(&self, cancellable: P) -> Result { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::gst_rtsp_server_create_socket(self.to_glib_none().0, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } + + fn create_source<'a, P: Into>>(&self, cancellable: P) -> Result { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::gst_rtsp_server_create_source(self.to_glib_none().0, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } + + fn get_address(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_server_get_address(self.to_glib_none().0)) + } + } + + fn get_auth(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_server_get_auth(self.to_glib_none().0)) + } + } + + fn get_backlog(&self) -> i32 { + unsafe { + ffi::gst_rtsp_server_get_backlog(self.to_glib_none().0) + } + } + + fn get_bound_port(&self) -> i32 { + unsafe { + ffi::gst_rtsp_server_get_bound_port(self.to_glib_none().0) + } + } + + fn get_mount_points(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_server_get_mount_points(self.to_glib_none().0)) + } + } + + fn get_service(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_server_get_service(self.to_glib_none().0)) + } + } + + fn get_session_pool(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_server_get_session_pool(self.to_glib_none().0)) + } + } + + fn get_thread_pool(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_server_get_thread_pool(self.to_glib_none().0)) + } + } + + fn set_address(&self, address: &str) { + unsafe { + ffi::gst_rtsp_server_set_address(self.to_glib_none().0, address.to_glib_none().0); + } + } + + fn set_auth<'a, P: Into>>(&self, auth: P) { + let auth = auth.into(); + let auth = auth.to_glib_none(); + unsafe { + ffi::gst_rtsp_server_set_auth(self.to_glib_none().0, auth.0); + } + } + + fn set_backlog(&self, backlog: i32) { + unsafe { + ffi::gst_rtsp_server_set_backlog(self.to_glib_none().0, backlog); + } + } + + fn set_mount_points<'a, P: Into>>(&self, mounts: P) { + let mounts = mounts.into(); + let mounts = mounts.to_glib_none(); + unsafe { + ffi::gst_rtsp_server_set_mount_points(self.to_glib_none().0, mounts.0); + } + } + + fn set_service(&self, service: &str) { + unsafe { + ffi::gst_rtsp_server_set_service(self.to_glib_none().0, service.to_glib_none().0); + } + } + + fn set_session_pool<'a, P: Into>>(&self, pool: P) { + let pool = pool.into(); + let pool = pool.to_glib_none(); + unsafe { + ffi::gst_rtsp_server_set_session_pool(self.to_glib_none().0, pool.0); + } + } + + fn set_thread_pool<'a, P: Into>>(&self, pool: P) { + let pool = pool.into(); + let pool = pool.to_glib_none(); + unsafe { + ffi::gst_rtsp_server_set_thread_pool(self.to_glib_none().0, pool.0); + } + } + + fn transfer_connection<'a, P: Into>>(&self, socket: &gio::Socket, ip: &str, port: i32, initial_buffer: P) -> bool { + let initial_buffer = initial_buffer.into(); + let initial_buffer = initial_buffer.to_glib_none(); + unsafe { + from_glib(ffi::gst_rtsp_server_transfer_connection(self.to_glib_none().0, socket.to_glib_full(), ip.to_glib_none().0, port, initial_buffer.0)) + } + } + + fn connect_client_connected(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "client-connected", + transmute(client_connected_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_address_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::address", + transmute(notify_address_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_backlog_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::backlog", + transmute(notify_backlog_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_bound_port_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::bound-port", + transmute(notify_bound_port_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_mount_points_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::mount-points", + transmute(notify_mount_points_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_service_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::service", + transmute(notify_service_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_session_pool_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::session-pool", + transmute(notify_session_pool_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn client_connected_trampoline

(this: *mut ffi::GstRTSPServer, object: *mut ffi::GstRTSPClient, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &RTSPClient) + Send + Sync + 'static) = transmute(f); + f(&RTSPServer::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object)) +} + +unsafe extern "C" fn notify_address_trampoline

(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPServer::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_backlog_trampoline

(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPServer::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_bound_port_trampoline

(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPServer::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_mount_points_trampoline

(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPServer::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_service_trampoline

(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPServer::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_session_pool_trampoline

(this: *mut ffi::GstRTSPServer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPServer::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_session.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_session.rs new file mode 100644 index 000000000..1ba7f32e3 --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_session.rs @@ -0,0 +1,230 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPMedia; +use RTSPSessionMedia; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct RTSPSession(Object); + + match fn { + get_type => || ffi::gst_rtsp_session_get_type(), + } +} + +impl RTSPSession { + pub fn new(sessionid: &str) -> RTSPSession { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_session_new(sessionid.to_glib_none().0)) + } + } +} + +unsafe impl Send for RTSPSession {} +unsafe impl Sync for RTSPSession {} + +pub trait RTSPSessionExt { + fn allow_expire(&self); + + //fn filter<'a, P: Into>, Q: Into>>(&self, func: P, user_data: Q) -> Vec; + + fn get_header(&self) -> Option; + + fn get_media(&self, path: &str) -> (Option, i32); + + fn get_sessionid(&self) -> Option; + + fn get_timeout(&self) -> u32; + + //fn is_expired(&self, now: /*Ignored*/&mut glib::TimeVal) -> bool; + + fn is_expired_usec(&self, now: i64) -> bool; + + fn manage_media(&self, path: &str, media: &RTSPMedia) -> Option; + + //fn next_timeout(&self, now: /*Ignored*/&mut glib::TimeVal) -> i32; + + fn next_timeout_usec(&self, now: i64) -> i32; + + fn prevent_expire(&self); + + fn release_media(&self, media: &RTSPSessionMedia) -> bool; + + fn set_timeout(&self, timeout: u32); + + fn touch(&self); + + fn get_property_timeout_always_visible(&self) -> bool; + + fn set_property_timeout_always_visible(&self, timeout_always_visible: bool); + + fn connect_property_sessionid_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_timeout_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_timeout_always_visible_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> RTSPSessionExt for O { + fn allow_expire(&self) { + unsafe { + ffi::gst_rtsp_session_allow_expire(self.to_glib_none().0); + } + } + + //fn filter<'a, P: Into>, Q: Into>>(&self, func: P, user_data: Q) -> Vec { + // unsafe { TODO: call ffi::gst_rtsp_session_filter() } + //} + + fn get_header(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_session_get_header(self.to_glib_none().0)) + } + } + + fn get_media(&self, path: &str) -> (Option, i32) { + unsafe { + let mut matched = mem::uninitialized(); + let ret = from_glib_none(ffi::gst_rtsp_session_get_media(self.to_glib_none().0, path.to_glib_none().0, &mut matched)); + (ret, matched) + } + } + + fn get_sessionid(&self) -> Option { + unsafe { + from_glib_none(ffi::gst_rtsp_session_get_sessionid(self.to_glib_none().0)) + } + } + + fn get_timeout(&self) -> u32 { + unsafe { + ffi::gst_rtsp_session_get_timeout(self.to_glib_none().0) + } + } + + //fn is_expired(&self, now: /*Ignored*/&mut glib::TimeVal) -> bool { + // unsafe { TODO: call ffi::gst_rtsp_session_is_expired() } + //} + + fn is_expired_usec(&self, now: i64) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_session_is_expired_usec(self.to_glib_none().0, now)) + } + } + + fn manage_media(&self, path: &str, media: &RTSPMedia) -> Option { + unsafe { + from_glib_none(ffi::gst_rtsp_session_manage_media(self.to_glib_none().0, path.to_glib_none().0, media.to_glib_full())) + } + } + + //fn next_timeout(&self, now: /*Ignored*/&mut glib::TimeVal) -> i32 { + // unsafe { TODO: call ffi::gst_rtsp_session_next_timeout() } + //} + + fn next_timeout_usec(&self, now: i64) -> i32 { + unsafe { + ffi::gst_rtsp_session_next_timeout_usec(self.to_glib_none().0, now) + } + } + + fn prevent_expire(&self) { + unsafe { + ffi::gst_rtsp_session_prevent_expire(self.to_glib_none().0); + } + } + + fn release_media(&self, media: &RTSPSessionMedia) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_session_release_media(self.to_glib_none().0, media.to_glib_none().0)) + } + } + + fn set_timeout(&self, timeout: u32) { + unsafe { + ffi::gst_rtsp_session_set_timeout(self.to_glib_none().0, timeout); + } + } + + fn touch(&self) { + unsafe { + ffi::gst_rtsp_session_touch(self.to_glib_none().0); + } + } + + fn get_property_timeout_always_visible(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "timeout-always-visible".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn set_property_timeout_always_visible(&self, timeout_always_visible: bool) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "timeout-always-visible".to_glib_none().0, Value::from(&timeout_always_visible).to_glib_none().0); + } + } + + fn connect_property_sessionid_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::sessionid", + transmute(notify_sessionid_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_timeout_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::timeout", + transmute(notify_timeout_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_timeout_always_visible_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::timeout-always-visible", + transmute(notify_timeout_always_visible_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_sessionid_trampoline

(this: *mut ffi::GstRTSPSession, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPSession::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_timeout_trampoline

(this: *mut ffi::GstRTSPSession, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPSession::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_timeout_always_visible_trampoline

(this: *mut ffi::GstRTSPSession, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPSession::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_session_media.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_session_media.rs new file mode 100644 index 000000000..5cc6b4fa2 --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_session_media.rs @@ -0,0 +1,113 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPMedia; +use RTSPStreamTransport; +use ffi; +use glib; +use glib::object::IsA; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct RTSPSessionMedia(Object); + + match fn { + get_type => || ffi::gst_rtsp_session_media_get_type(), + } +} + +impl RTSPSessionMedia { + pub fn new(path: &str, media: &RTSPMedia) -> RTSPSessionMedia { + skip_assert_initialized!(); + unsafe { + from_glib_full(ffi::gst_rtsp_session_media_new(path.to_glib_none().0, media.to_glib_full())) + } + } +} + +unsafe impl Send for RTSPSessionMedia {} +unsafe impl Sync for RTSPSessionMedia {} + +pub trait RTSPSessionMediaExt { + //fn alloc_channels(&self, range: /*Ignored*/gst_rtsp::RTSPRange) -> bool; + + fn get_base_time(&self) -> gst::ClockTime; + + fn get_media(&self) -> Option; + + fn get_rtpinfo(&self) -> Option; + + //fn get_rtsp_state(&self) -> /*Ignored*/gst_rtsp::RTSPState; + + fn get_transport(&self, idx: u32) -> Option; + + fn matches(&self, path: &str) -> Option; + + //fn set_rtsp_state(&self, state: /*Ignored*/gst_rtsp::RTSPState); + + fn set_state(&self, state: gst::State) -> Result<(), glib::error::BoolError>; + + //fn set_transport(&self, stream: &RTSPStream, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> Option; +} + +impl> RTSPSessionMediaExt for O { + //fn alloc_channels(&self, range: /*Ignored*/gst_rtsp::RTSPRange) -> bool { + // unsafe { TODO: call ffi::gst_rtsp_session_media_alloc_channels() } + //} + + fn get_base_time(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::gst_rtsp_session_media_get_base_time(self.to_glib_none().0)) + } + } + + fn get_media(&self) -> Option { + unsafe { + from_glib_none(ffi::gst_rtsp_session_media_get_media(self.to_glib_none().0)) + } + } + + fn get_rtpinfo(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_session_media_get_rtpinfo(self.to_glib_none().0)) + } + } + + //fn get_rtsp_state(&self) -> /*Ignored*/gst_rtsp::RTSPState { + // unsafe { TODO: call ffi::gst_rtsp_session_media_get_rtsp_state() } + //} + + fn get_transport(&self, idx: u32) -> Option { + unsafe { + from_glib_none(ffi::gst_rtsp_session_media_get_transport(self.to_glib_none().0, idx)) + } + } + + fn matches(&self, path: &str) -> Option { + unsafe { + let mut matched = mem::uninitialized(); + let ret = from_glib(ffi::gst_rtsp_session_media_matches(self.to_glib_none().0, path.to_glib_none().0, &mut matched)); + if ret { Some(matched) } else { None } + } + } + + //fn set_rtsp_state(&self, state: /*Ignored*/gst_rtsp::RTSPState) { + // unsafe { TODO: call ffi::gst_rtsp_session_media_set_rtsp_state() } + //} + + fn set_state(&self, state: gst::State) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_session_media_set_state(self.to_glib_none().0, state.to_glib()), "Failed to set state of session media") + } + } + + //fn set_transport(&self, stream: &RTSPStream, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> Option { + // unsafe { TODO: call ffi::gst_rtsp_session_media_set_transport() } + //} +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_session_pool.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_session_pool.rs new file mode 100644 index 000000000..bc0377a8b --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_session_pool.rs @@ -0,0 +1,144 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPSession; +use ffi; +use glib; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct RTSPSessionPool(Object); + + match fn { + get_type => || ffi::gst_rtsp_session_pool_get_type(), + } +} + +impl RTSPSessionPool { + pub fn new() -> RTSPSessionPool { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_session_pool_new()) + } + } +} + +impl Default for RTSPSessionPool { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Send for RTSPSessionPool {} +unsafe impl Sync for RTSPSessionPool {} + +pub trait RTSPSessionPoolExt { + fn cleanup(&self) -> u32; + + fn create(&self) -> Option; + + //fn filter<'a, P: Into>, Q: Into>>(&self, func: P, user_data: Q) -> Vec; + + fn find(&self, sessionid: &str) -> Option; + + fn get_max_sessions(&self) -> u32; + + fn get_n_sessions(&self) -> u32; + + fn remove(&self, sess: &RTSPSession) -> Result<(), glib::error::BoolError>; + + fn set_max_sessions(&self, max: u32); + + fn connect_session_removed(&self, f: F) -> SignalHandlerId; + + fn connect_property_max_sessions_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> RTSPSessionPoolExt for O { + fn cleanup(&self) -> u32 { + unsafe { + ffi::gst_rtsp_session_pool_cleanup(self.to_glib_none().0) + } + } + + fn create(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_session_pool_create(self.to_glib_none().0)) + } + } + + //fn filter<'a, P: Into>, Q: Into>>(&self, func: P, user_data: Q) -> Vec { + // unsafe { TODO: call ffi::gst_rtsp_session_pool_filter() } + //} + + fn find(&self, sessionid: &str) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_session_pool_find(self.to_glib_none().0, sessionid.to_glib_none().0)) + } + } + + fn get_max_sessions(&self) -> u32 { + unsafe { + ffi::gst_rtsp_session_pool_get_max_sessions(self.to_glib_none().0) + } + } + + fn get_n_sessions(&self) -> u32 { + unsafe { + ffi::gst_rtsp_session_pool_get_n_sessions(self.to_glib_none().0) + } + } + + fn remove(&self, sess: &RTSPSession) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_session_pool_remove(self.to_glib_none().0, sess.to_glib_none().0), "Failed to remove session from pool") + } + } + + fn set_max_sessions(&self, max: u32) { + unsafe { + ffi::gst_rtsp_session_pool_set_max_sessions(self.to_glib_none().0, max); + } + } + + fn connect_session_removed(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "session-removed", + transmute(session_removed_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_max_sessions_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::max-sessions", + transmute(notify_max_sessions_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn session_removed_trampoline

(this: *mut ffi::GstRTSPSessionPool, object: *mut ffi::GstRTSPSession, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &RTSPSession) + Send + Sync + 'static) = transmute(f); + f(&RTSPSessionPool::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object)) +} + +unsafe extern "C" fn notify_max_sessions_trampoline

(this: *mut ffi::GstRTSPSessionPool, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPSessionPool::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_stream.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_stream.rs new file mode 100644 index 000000000..06e8c4eae --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_stream.rs @@ -0,0 +1,591 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPAddress; +use RTSPAddressPool; +use RTSPPublishClockMode; +use RTSPStreamTransport; +use ffi; +use gio; +use glib; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use gst_ffi; +use gst_rtsp; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct RTSPStream(Object); + + match fn { + get_type => || ffi::gst_rtsp_stream_get_type(), + } +} + +impl RTSPStream { + pub fn new, Q: IsA>(idx: u32, payloader: &P, pad: &Q) -> RTSPStream { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_stream_new(idx, payloader.to_glib_none().0, pad.to_glib_none().0)) + } + } +} + +unsafe impl Send for RTSPStream {} +unsafe impl Sync for RTSPStream {} + +pub trait RTSPStreamExt { + fn add_transport(&self, trans: &RTSPStreamTransport) -> Result<(), glib::error::BoolError>; + + //fn allocate_udp_sockets(&self, family: gio::SocketFamily, transport: /*Ignored*/&mut gst_rtsp::RTSPTransport, use_client_setttings: bool) -> bool; + + fn get_address_pool(&self) -> Option; + + fn get_buffer_size(&self) -> u32; + + fn get_caps(&self) -> Option; + + fn get_control(&self) -> Option; + + fn get_current_seqnum(&self) -> u16; + + fn get_dscp_qos(&self) -> i32; + + fn get_index(&self) -> u32; + + fn get_joined_bin(&self) -> Option; + + fn get_mtu(&self) -> u32; + + fn get_multicast_address(&self, family: gio::SocketFamily) -> Option; + + fn get_multicast_iface(&self) -> Option; + + fn get_profiles(&self) -> gst_rtsp::RTSPProfile; + + fn get_protocols(&self) -> gst_rtsp::RTSPLowerTrans; + + fn get_pt(&self) -> u32; + + fn get_publish_clock_mode(&self) -> RTSPPublishClockMode; + + fn get_retransmission_pt(&self) -> u32; + + fn get_retransmission_time(&self) -> gst::ClockTime; + + fn get_rtcp_socket(&self, family: gio::SocketFamily) -> Option; + + fn get_rtp_socket(&self, family: gio::SocketFamily) -> Option; + + fn get_rtpinfo(&self) -> Option<(u32, u32, u32, gst::ClockTime)>; + + fn get_rtpsession(&self) -> Option; + + //fn get_server_port(&self, server_port: /*Ignored*/gst_rtsp::RTSPRange, family: gio::SocketFamily); + + fn get_sinkpad(&self) -> Option; + + fn get_srcpad(&self) -> Option; + + fn get_srtp_encoder(&self) -> Option; + + fn get_ssrc(&self) -> u32; + + fn has_control<'a, P: Into>>(&self, control: P) -> bool; + + fn is_blocking(&self) -> bool; + + fn is_client_side(&self) -> bool; + + //fn is_transport_supported(&self, transport: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> bool; + + fn join_bin, Q: IsA>(&self, bin: &P, rtpbin: &Q, state: gst::State) -> Result<(), glib::error::BoolError>; + + fn leave_bin, Q: IsA>(&self, bin: &P, rtpbin: &Q) -> Result<(), glib::error::BoolError>; + + fn recv_rtcp(&self, buffer: &gst::Buffer) -> gst::FlowReturn; + + fn recv_rtp(&self, buffer: &gst::Buffer) -> gst::FlowReturn; + + fn remove_transport(&self, trans: &RTSPStreamTransport) -> Result<(), glib::error::BoolError>; + + fn request_aux_sender(&self, sessid: u32) -> Option; + + fn reserve_address(&self, address: &str, port: u32, n_ports: u32, ttl: u32) -> Option; + + fn set_address_pool<'a, P: Into>>(&self, pool: P); + + fn set_blocked(&self, blocked: bool) -> bool; + + fn set_buffer_size(&self, size: u32); + + fn set_client_side(&self, client_side: bool); + + fn set_control<'a, P: Into>>(&self, control: P); + + fn set_dscp_qos(&self, dscp_qos: i32); + + fn set_mtu(&self, mtu: u32); + + fn set_multicast_iface<'a, P: Into>>(&self, multicast_iface: P); + + fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile); + + fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans); + + fn set_pt_map(&self, pt: u32, caps: &gst::Caps); + + fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode); + + fn set_retransmission_pt(&self, rtx_pt: u32); + + fn set_retransmission_time(&self, time: gst::ClockTime); + + fn set_seqnum_offset(&self, seqnum: u16); + + //fn transport_filter<'a, P: Into>, Q: Into>>(&self, func: P, user_data: Q) -> Vec; + + fn update_crypto<'a, P: Into>>(&self, ssrc: u32, crypto: P) -> bool; + + fn connect_new_rtcp_encoder(&self, f: F) -> SignalHandlerId; + + fn connect_new_rtp_encoder(&self, f: F) -> SignalHandlerId; + + fn connect_property_control_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_profiles_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_protocols_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> RTSPStreamExt for O { + fn add_transport(&self, trans: &RTSPStreamTransport) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_stream_add_transport(self.to_glib_none().0, trans.to_glib_none().0), "Failed to add transport") + } + } + + //fn allocate_udp_sockets(&self, family: gio::SocketFamily, transport: /*Ignored*/&mut gst_rtsp::RTSPTransport, use_client_setttings: bool) -> bool { + // unsafe { TODO: call ffi::gst_rtsp_stream_allocate_udp_sockets() } + //} + + fn get_address_pool(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_address_pool(self.to_glib_none().0)) + } + } + + fn get_buffer_size(&self) -> u32 { + unsafe { + ffi::gst_rtsp_stream_get_buffer_size(self.to_glib_none().0) + } + } + + fn get_caps(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_caps(self.to_glib_none().0)) + } + } + + fn get_control(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_control(self.to_glib_none().0)) + } + } + + fn get_current_seqnum(&self) -> u16 { + unsafe { + ffi::gst_rtsp_stream_get_current_seqnum(self.to_glib_none().0) + } + } + + fn get_dscp_qos(&self) -> i32 { + unsafe { + ffi::gst_rtsp_stream_get_dscp_qos(self.to_glib_none().0) + } + } + + fn get_index(&self) -> u32 { + unsafe { + ffi::gst_rtsp_stream_get_index(self.to_glib_none().0) + } + } + + fn get_joined_bin(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_joined_bin(self.to_glib_none().0)) + } + } + + fn get_mtu(&self) -> u32 { + unsafe { + ffi::gst_rtsp_stream_get_mtu(self.to_glib_none().0) + } + } + + fn get_multicast_address(&self, family: gio::SocketFamily) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_multicast_address(self.to_glib_none().0, family.to_glib())) + } + } + + fn get_multicast_iface(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_multicast_iface(self.to_glib_none().0)) + } + } + + fn get_profiles(&self) -> gst_rtsp::RTSPProfile { + unsafe { + from_glib(ffi::gst_rtsp_stream_get_profiles(self.to_glib_none().0)) + } + } + + fn get_protocols(&self) -> gst_rtsp::RTSPLowerTrans { + unsafe { + from_glib(ffi::gst_rtsp_stream_get_protocols(self.to_glib_none().0)) + } + } + + fn get_pt(&self) -> u32 { + unsafe { + ffi::gst_rtsp_stream_get_pt(self.to_glib_none().0) + } + } + + fn get_publish_clock_mode(&self) -> RTSPPublishClockMode { + unsafe { + from_glib(ffi::gst_rtsp_stream_get_publish_clock_mode(self.to_glib_none().0)) + } + } + + fn get_retransmission_pt(&self) -> u32 { + unsafe { + ffi::gst_rtsp_stream_get_retransmission_pt(self.to_glib_none().0) + } + } + + fn get_retransmission_time(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::gst_rtsp_stream_get_retransmission_time(self.to_glib_none().0)) + } + } + + fn get_rtcp_socket(&self, family: gio::SocketFamily) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_rtcp_socket(self.to_glib_none().0, family.to_glib())) + } + } + + fn get_rtp_socket(&self, family: gio::SocketFamily) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_rtp_socket(self.to_glib_none().0, family.to_glib())) + } + } + + fn get_rtpinfo(&self) -> Option<(u32, u32, u32, gst::ClockTime)> { + unsafe { + let mut rtptime = mem::uninitialized(); + let mut seq = mem::uninitialized(); + let mut clock_rate = mem::uninitialized(); + let mut running_time = mem::uninitialized(); + let ret = from_glib(ffi::gst_rtsp_stream_get_rtpinfo(self.to_glib_none().0, &mut rtptime, &mut seq, &mut clock_rate, &mut running_time)); + if ret { Some((rtptime, seq, clock_rate, from_glib(running_time))) } else { None } + } + } + + fn get_rtpsession(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_rtpsession(self.to_glib_none().0)) + } + } + + //fn get_server_port(&self, server_port: /*Ignored*/gst_rtsp::RTSPRange, family: gio::SocketFamily) { + // unsafe { TODO: call ffi::gst_rtsp_stream_get_server_port() } + //} + + fn get_sinkpad(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_sinkpad(self.to_glib_none().0)) + } + } + + fn get_srcpad(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_srcpad(self.to_glib_none().0)) + } + } + + fn get_srtp_encoder(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_get_srtp_encoder(self.to_glib_none().0)) + } + } + + fn get_ssrc(&self) -> u32 { + unsafe { + let mut ssrc = mem::uninitialized(); + ffi::gst_rtsp_stream_get_ssrc(self.to_glib_none().0, &mut ssrc); + ssrc + } + } + + fn has_control<'a, P: Into>>(&self, control: P) -> bool { + let control = control.into(); + let control = control.to_glib_none(); + unsafe { + from_glib(ffi::gst_rtsp_stream_has_control(self.to_glib_none().0, control.0)) + } + } + + fn is_blocking(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_stream_is_blocking(self.to_glib_none().0)) + } + } + + fn is_client_side(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_stream_is_client_side(self.to_glib_none().0)) + } + } + + //fn is_transport_supported(&self, transport: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> bool { + // unsafe { TODO: call ffi::gst_rtsp_stream_is_transport_supported() } + //} + + fn join_bin, Q: IsA>(&self, bin: &P, rtpbin: &Q, state: gst::State) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_stream_join_bin(self.to_glib_none().0, bin.to_glib_none().0, rtpbin.to_glib_none().0, state.to_glib()), "Failed to join bin") + } + } + + fn leave_bin, Q: IsA>(&self, bin: &P, rtpbin: &Q) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_stream_leave_bin(self.to_glib_none().0, bin.to_glib_none().0, rtpbin.to_glib_none().0), "Failed to leave bin") + } + } + + fn recv_rtcp(&self, buffer: &gst::Buffer) -> gst::FlowReturn { + unsafe { + from_glib(ffi::gst_rtsp_stream_recv_rtcp(self.to_glib_none().0, buffer.to_glib_full())) + } + } + + fn recv_rtp(&self, buffer: &gst::Buffer) -> gst::FlowReturn { + unsafe { + from_glib(ffi::gst_rtsp_stream_recv_rtp(self.to_glib_none().0, buffer.to_glib_full())) + } + } + + fn remove_transport(&self, trans: &RTSPStreamTransport) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_stream_remove_transport(self.to_glib_none().0, trans.to_glib_none().0), "Failed to remove transport") + } + } + + fn request_aux_sender(&self, sessid: u32) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_request_aux_sender(self.to_glib_none().0, sessid)) + } + } + + fn reserve_address(&self, address: &str, port: u32, n_ports: u32, ttl: u32) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_reserve_address(self.to_glib_none().0, address.to_glib_none().0, port, n_ports, ttl)) + } + } + + fn set_address_pool<'a, P: Into>>(&self, pool: P) { + let pool = pool.into(); + let pool = pool.to_glib_none(); + unsafe { + ffi::gst_rtsp_stream_set_address_pool(self.to_glib_none().0, pool.0); + } + } + + fn set_blocked(&self, blocked: bool) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_stream_set_blocked(self.to_glib_none().0, blocked.to_glib())) + } + } + + fn set_buffer_size(&self, size: u32) { + unsafe { + ffi::gst_rtsp_stream_set_buffer_size(self.to_glib_none().0, size); + } + } + + fn set_client_side(&self, client_side: bool) { + unsafe { + ffi::gst_rtsp_stream_set_client_side(self.to_glib_none().0, client_side.to_glib()); + } + } + + fn set_control<'a, P: Into>>(&self, control: P) { + let control = control.into(); + let control = control.to_glib_none(); + unsafe { + ffi::gst_rtsp_stream_set_control(self.to_glib_none().0, control.0); + } + } + + fn set_dscp_qos(&self, dscp_qos: i32) { + unsafe { + ffi::gst_rtsp_stream_set_dscp_qos(self.to_glib_none().0, dscp_qos); + } + } + + fn set_mtu(&self, mtu: u32) { + unsafe { + ffi::gst_rtsp_stream_set_mtu(self.to_glib_none().0, mtu); + } + } + + fn set_multicast_iface<'a, P: Into>>(&self, multicast_iface: P) { + let multicast_iface = multicast_iface.into(); + let multicast_iface = multicast_iface.to_glib_none(); + unsafe { + ffi::gst_rtsp_stream_set_multicast_iface(self.to_glib_none().0, multicast_iface.0); + } + } + + fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) { + unsafe { + ffi::gst_rtsp_stream_set_profiles(self.to_glib_none().0, profiles.to_glib()); + } + } + + fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) { + unsafe { + ffi::gst_rtsp_stream_set_protocols(self.to_glib_none().0, protocols.to_glib()); + } + } + + fn set_pt_map(&self, pt: u32, caps: &gst::Caps) { + unsafe { + ffi::gst_rtsp_stream_set_pt_map(self.to_glib_none().0, pt, caps.to_glib_none().0); + } + } + + fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) { + unsafe { + ffi::gst_rtsp_stream_set_publish_clock_mode(self.to_glib_none().0, mode.to_glib()); + } + } + + fn set_retransmission_pt(&self, rtx_pt: u32) { + unsafe { + ffi::gst_rtsp_stream_set_retransmission_pt(self.to_glib_none().0, rtx_pt); + } + } + + fn set_retransmission_time(&self, time: gst::ClockTime) { + unsafe { + ffi::gst_rtsp_stream_set_retransmission_time(self.to_glib_none().0, time.to_glib()); + } + } + + fn set_seqnum_offset(&self, seqnum: u16) { + unsafe { + ffi::gst_rtsp_stream_set_seqnum_offset(self.to_glib_none().0, seqnum); + } + } + + //fn transport_filter<'a, P: Into>, Q: Into>>(&self, func: P, user_data: Q) -> Vec { + // unsafe { TODO: call ffi::gst_rtsp_stream_transport_filter() } + //} + + fn update_crypto<'a, P: Into>>(&self, ssrc: u32, crypto: P) -> bool { + let crypto = crypto.into(); + let crypto = crypto.to_glib_none(); + unsafe { + from_glib(ffi::gst_rtsp_stream_update_crypto(self.to_glib_none().0, ssrc, crypto.0)) + } + } + + fn connect_new_rtcp_encoder(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "new-rtcp-encoder", + transmute(new_rtcp_encoder_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_new_rtp_encoder(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "new-rtp-encoder", + transmute(new_rtp_encoder_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_control_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::control", + transmute(notify_control_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_profiles_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::profiles", + transmute(notify_profiles_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_protocols_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::protocols", + transmute(notify_protocols_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn new_rtcp_encoder_trampoline

(this: *mut ffi::GstRTSPStream, object: *mut gst_ffi::GstElement, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &gst::Element) + Send + Sync + 'static) = transmute(f); + f(&RTSPStream::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object)) +} + +unsafe extern "C" fn new_rtp_encoder_trampoline

(this: *mut ffi::GstRTSPStream, object: *mut gst_ffi::GstElement, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P, &gst::Element) + Send + Sync + 'static) = transmute(f); + f(&RTSPStream::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object)) +} + +unsafe extern "C" fn notify_control_trampoline

(this: *mut ffi::GstRTSPStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPStream::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_profiles_trampoline

(this: *mut ffi::GstRTSPStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPStream::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_protocols_trampoline

(this: *mut ffi::GstRTSPStream, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPStream::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_stream_transport.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_stream_transport.rs new file mode 100644 index 000000000..fea5dc79f --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_stream_transport.rs @@ -0,0 +1,147 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPStream; +use ffi; +use glib; +use glib::object::IsA; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use gst_rtsp; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct RTSPStreamTransport(Object); + + match fn { + get_type => || ffi::gst_rtsp_stream_transport_get_type(), + } +} + +impl RTSPStreamTransport { + //pub fn new(stream: &RTSPStream, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> RTSPStreamTransport { + // unsafe { TODO: call ffi::gst_rtsp_stream_transport_new() } + //} +} + +pub trait RTSPStreamTransportExt { + fn get_rtpinfo(&self, start_time: gst::ClockTime) -> Option; + + fn get_stream(&self) -> Option; + + //fn get_transport(&self) -> /*Ignored*/Option; + + fn get_url(&self) -> Option; + + fn is_timed_out(&self) -> bool; + + fn keep_alive(&self); + + fn recv_data(&self, channel: u32, buffer: &gst::Buffer) -> gst::FlowReturn; + + fn send_rtcp(&self, buffer: &gst::Buffer) -> Result<(), glib::error::BoolError>; + + fn send_rtp(&self, buffer: &gst::Buffer) -> Result<(), glib::error::BoolError>; + + fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError>; + + //fn set_callbacks<'a, P: Into>, Q: Into>>(&self, send_rtp: /*Unknown conversion*//*Unimplemented*/RTSPSendFunc, send_rtcp: /*Unknown conversion*//*Unimplemented*/RTSPSendFunc, user_data: P, notify: Q); + + //fn set_keepalive<'a, P: Into>, Q: Into>>(&self, keep_alive: /*Unknown conversion*//*Unimplemented*/RTSPKeepAliveFunc, user_data: P, notify: Q); + + fn set_timed_out(&self, timedout: bool); + + //fn set_transport(&self, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport); + + fn set_url<'a, P: Into>>(&self, url: P); +} + +impl> RTSPStreamTransportExt for O { + fn get_rtpinfo(&self, start_time: gst::ClockTime) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_stream_transport_get_rtpinfo(self.to_glib_none().0, start_time.to_glib())) + } + } + + fn get_stream(&self) -> Option { + unsafe { + from_glib_none(ffi::gst_rtsp_stream_transport_get_stream(self.to_glib_none().0)) + } + } + + //fn get_transport(&self) -> /*Ignored*/Option { + // unsafe { TODO: call ffi::gst_rtsp_stream_transport_get_transport() } + //} + + fn get_url(&self) -> Option { + unsafe { + from_glib_none(ffi::gst_rtsp_stream_transport_get_url(self.to_glib_none().0)) + } + } + + fn is_timed_out(&self) -> bool { + unsafe { + from_glib(ffi::gst_rtsp_stream_transport_is_timed_out(self.to_glib_none().0)) + } + } + + fn keep_alive(&self) { + unsafe { + ffi::gst_rtsp_stream_transport_keep_alive(self.to_glib_none().0); + } + } + + fn recv_data(&self, channel: u32, buffer: &gst::Buffer) -> gst::FlowReturn { + unsafe { + from_glib(ffi::gst_rtsp_stream_transport_recv_data(self.to_glib_none().0, channel, buffer.to_glib_full())) + } + } + + fn send_rtcp(&self, buffer: &gst::Buffer) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_stream_transport_send_rtcp(self.to_glib_none().0, buffer.to_glib_none().0), "Failed to send rtcp") + } + } + + fn send_rtp(&self, buffer: &gst::Buffer) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_stream_transport_send_rtp(self.to_glib_none().0, buffer.to_glib_none().0), "Failed to send rtp") + } + } + + fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::gst_rtsp_stream_transport_set_active(self.to_glib_none().0, active.to_glib()), "Failed to set active") + } + } + + //fn set_callbacks<'a, P: Into>, Q: Into>>(&self, send_rtp: /*Unknown conversion*//*Unimplemented*/RTSPSendFunc, send_rtcp: /*Unknown conversion*//*Unimplemented*/RTSPSendFunc, user_data: P, notify: Q) { + // unsafe { TODO: call ffi::gst_rtsp_stream_transport_set_callbacks() } + //} + + //fn set_keepalive<'a, P: Into>, Q: Into>>(&self, keep_alive: /*Unknown conversion*//*Unimplemented*/RTSPKeepAliveFunc, user_data: P, notify: Q) { + // unsafe { TODO: call ffi::gst_rtsp_stream_transport_set_keepalive() } + //} + + fn set_timed_out(&self, timedout: bool) { + unsafe { + ffi::gst_rtsp_stream_transport_set_timed_out(self.to_glib_none().0, timedout.to_glib()); + } + } + + //fn set_transport(&self, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) { + // unsafe { TODO: call ffi::gst_rtsp_stream_transport_set_transport() } + //} + + fn set_url<'a, P: Into>>(&self, url: P) { + let url = url.into(); + let url = url.to_glib_none(); + unsafe { + ffi::gst_rtsp_stream_transport_set_url(self.to_glib_none().0, url.0); + } + } +} diff --git a/gstreamer-rtsp-server/src/auto/r_t_s_p_thread_pool.rs b/gstreamer-rtsp-server/src/auto/r_t_s_p_thread_pool.rs new file mode 100644 index 000000000..3163aef1c --- /dev/null +++ b/gstreamer-rtsp-server/src/auto/r_t_s_p_thread_pool.rs @@ -0,0 +1,93 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct RTSPThreadPool(Object); + + match fn { + get_type => || ffi::gst_rtsp_thread_pool_get_type(), + } +} + +impl RTSPThreadPool { + pub fn new() -> RTSPThreadPool { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_rtsp_thread_pool_new()) + } + } + + pub fn cleanup() { + assert_initialized_main_thread!(); + unsafe { + ffi::gst_rtsp_thread_pool_cleanup(); + } + } +} + +impl Default for RTSPThreadPool { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Send for RTSPThreadPool {} +unsafe impl Sync for RTSPThreadPool {} + +pub trait RTSPThreadPoolExt { + fn get_max_threads(&self) -> i32; + + //fn get_thread(&self, type_: RTSPThreadType, ctx: /*Ignored*/&mut RTSPContext) -> /*Ignored*/Option; + + fn set_max_threads(&self, max_threads: i32); + + fn connect_property_max_threads_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> RTSPThreadPoolExt for O { + fn get_max_threads(&self) -> i32 { + unsafe { + ffi::gst_rtsp_thread_pool_get_max_threads(self.to_glib_none().0) + } + } + + //fn get_thread(&self, type_: RTSPThreadType, ctx: /*Ignored*/&mut RTSPContext) -> /*Ignored*/Option { + // unsafe { TODO: call ffi::gst_rtsp_thread_pool_get_thread() } + //} + + fn set_max_threads(&self, max_threads: i32) { + unsafe { + ffi::gst_rtsp_thread_pool_set_max_threads(self.to_glib_none().0, max_threads); + } + } + + fn connect_property_max_threads_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::max-threads", + transmute(notify_max_threads_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_max_threads_trampoline

(this: *mut ffi::GstRTSPThreadPool, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + callback_guard!(); + let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); + f(&RTSPThreadPool::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-rtsp-server/src/lib.rs b/gstreamer-rtsp-server/src/lib.rs new file mode 100644 index 000000000..7990954dd --- /dev/null +++ b/gstreamer-rtsp-server/src/lib.rs @@ -0,0 +1,77 @@ +// Copyright (C) 2018 Mathieu Duponchelle +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[macro_use] +extern crate bitflags; +extern crate libc; + +#[macro_use] +extern crate glib; +extern crate glib_sys as glib_ffi; +extern crate gio; +extern crate gio_sys as gio_ffi; +extern crate gobject_sys as gobject_ffi; +extern crate gstreamer as gst; +extern crate gstreamer_sys as gst_ffi; +extern crate gstreamer_rtsp as gst_rtsp; +extern crate gstreamer_rtsp_sys as gst_rtsp_ffi; +extern crate gstreamer_net as gst_net; +extern crate gstreamer_net_sys as gst_net_ffi; +extern crate gstreamer_rtsp_server_sys as ffi; + +macro_rules! callback_guard { + () => ( + let _guard = ::glib::CallbackGuard::new(); + ) +} + +macro_rules! assert_initialized_main_thread { + () => ( + if unsafe {::gst_ffi::gst_is_initialized()} != ::glib_ffi::GTRUE { + panic!("GStreamer has not been initialized. Call `gst::init` first."); + } + ) +} + +macro_rules! skip_assert_initialized { + () => ( + ) +} + +pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; + +#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] +#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] +#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] +#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +mod auto; +pub use auto::*; + +mod r_t_s_p_server; +mod r_t_s_p_address_pool; +mod r_t_s_p_client; +mod r_t_s_p_session_pool; + +pub use r_t_s_p_server::RTSPServerExtManual; +pub use r_t_s_p_address_pool::RTSPAddressPoolExtManual; +pub use r_t_s_p_client::RTSPClientExtManual; +pub use r_t_s_p_session_pool::RTSPSessionPoolExtManual; + +// Re-export all the traits in a prelude module, so that applications +// can always "use gst::prelude::*" without getting conflicts +pub mod prelude { + pub use glib::prelude::*; + pub use gst::prelude::*; + + pub use auto::traits::*; + + pub use r_t_s_p_server::RTSPServerExtManual; + pub use r_t_s_p_address_pool::RTSPAddressPoolExtManual; + pub use r_t_s_p_client::RTSPClientExtManual; + pub use r_t_s_p_session_pool::RTSPSessionPoolExtManual; +} diff --git a/gstreamer-rtsp-server/src/r_t_s_p_address_pool.rs b/gstreamer-rtsp-server/src/r_t_s_p_address_pool.rs new file mode 100644 index 000000000..a37389cc9 --- /dev/null +++ b/gstreamer-rtsp-server/src/r_t_s_p_address_pool.rs @@ -0,0 +1,24 @@ +use RTSPAddress; +use RTSPAddressPool; +use RTSPAddressPoolResult; +use ffi; +use glib::object::IsA; +use glib::translate::*; +use std::ptr; + +pub trait RTSPAddressPoolExtManual { + fn reserve_address(&self, ip_address: &str, port: u32, n_ports: u32, ttl: u32) -> Result; +} + +impl> RTSPAddressPoolExtManual for O { + fn reserve_address(&self, ip_address: &str, port: u32, n_ports: u32, ttl: u32) -> Result { + unsafe { + let mut address = ptr::null_mut(); + let ret = from_glib(ffi::gst_rtsp_address_pool_reserve_address(self.to_glib_none().0, ip_address.to_glib_none().0, port, n_ports, ttl, &mut address)); + match ret { + RTSPAddressPoolResult::Ok => Ok(from_glib_full(address)), + _ => Err(ret) + } + } + } +} diff --git a/gstreamer-rtsp-server/src/r_t_s_p_client.rs b/gstreamer-rtsp-server/src/r_t_s_p_client.rs new file mode 100644 index 000000000..9f5186491 --- /dev/null +++ b/gstreamer-rtsp-server/src/r_t_s_p_client.rs @@ -0,0 +1,20 @@ +use RTSPClient; +use ffi; +use glib; +use glib::object::IsA; +use glib::translate::*; +use glib::source::SourceId; + +pub trait RTSPClientExtManual { + fn attach<'a, P: Into>>(&self, context: P) -> SourceId; +} + +impl> RTSPClientExtManual for O { + fn attach<'a, P: Into>>(&self, context: P) -> SourceId { + let context = context.into(); + let context = context.to_glib_none(); + unsafe { + from_glib(ffi::gst_rtsp_client_attach(self.to_glib_none().0, context.0)) + } + } +} diff --git a/gstreamer-rtsp-server/src/r_t_s_p_server.rs b/gstreamer-rtsp-server/src/r_t_s_p_server.rs new file mode 100644 index 000000000..f813e7655 --- /dev/null +++ b/gstreamer-rtsp-server/src/r_t_s_p_server.rs @@ -0,0 +1,20 @@ +use RTSPServer; +use ffi; +use glib; +use glib::object::IsA; +use glib::translate::*; +use glib::source::SourceId; + +pub trait RTSPServerExtManual { + fn attach<'a, P: Into>>(&self, context: P) -> SourceId; +} + +impl> RTSPServerExtManual for O { + fn attach<'a, P: Into>>(&self, context: P) -> SourceId { + let context = context.into(); + let context = context.to_glib_none(); + unsafe { + from_glib(ffi::gst_rtsp_server_attach(self.to_glib_none().0, context.0)) + } + } +} diff --git a/gstreamer-rtsp-server/src/r_t_s_p_session_pool.rs b/gstreamer-rtsp-server/src/r_t_s_p_session_pool.rs new file mode 100644 index 000000000..5ecc89e6a --- /dev/null +++ b/gstreamer-rtsp-server/src/r_t_s_p_session_pool.rs @@ -0,0 +1,77 @@ +use std::cell::RefCell; +use std::mem::transmute; +use RTSPSessionPool; +use ffi; +use glib; +use glib_ffi; +use glib::object::IsA; +use glib::translate::*; +use glib::source::{CallbackGuard, Continue, Priority}; +use glib_ffi::{gboolean, gpointer}; + +unsafe extern "C" fn trampoline_watch( + pool: *mut ffi::GstRTSPSessionPool, + func: gpointer, +) -> gboolean { + let _guard = CallbackGuard::new(); + #[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] + let func: &RefCell Continue + Send + 'static>> = transmute(func); + (&mut *func.borrow_mut())(&from_glib_borrow(pool)).to_glib() +} + +unsafe extern "C" fn destroy_closure_watch(ptr: gpointer) { + let _guard = CallbackGuard::new(); + Box:: Continue + Send + 'static>>>::from_raw( + ptr as *mut _, + ); +} + +fn into_raw_watch Continue + Send + 'static>(func: F) -> gpointer { + #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + let func: Box Continue + Send + 'static>>> = + Box::new(RefCell::new(Box::new(func))); + Box::into_raw(func) as gpointer +} + +pub trait RTSPSessionPoolExtManual { + fn create_watch<'a, N: Into>, F>( + &self, + name: N, + priority: Priority, + func: F, + ) -> glib::Source + where + F: FnMut(&RTSPSessionPool) -> Continue + Send + 'static; +} + +impl> RTSPSessionPoolExtManual for O { + fn create_watch<'a, N: Into>, F>( + &self, + name: N, + priority: Priority, + func: F, + ) -> glib::Source + where + F: FnMut(&RTSPSessionPool) -> Continue + Send + 'static + { + skip_assert_initialized!(); + unsafe { + let source = ffi::gst_rtsp_session_pool_create_watch(self.to_glib_none().0); + let trampoline = trampoline_watch as gpointer; + glib_ffi::g_source_set_callback( + source, + Some(transmute(trampoline)), + into_raw_watch(func), + Some(destroy_closure_watch), + ); + glib_ffi::g_source_set_priority(source, priority.to_glib()); + + let name = name.into(); + if let Some(name) = name { + glib_ffi::g_source_set_name(source, name.to_glib_none().0); + } + + from_glib_full(source) + } + } +} diff --git a/gstreamer-rtsp/CHANGELOG.md b/gstreamer-rtsp/CHANGELOG.md new file mode 100644 index 000000000..614f2ff50 --- /dev/null +++ b/gstreamer-rtsp/CHANGELOG.md @@ -0,0 +1,218 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html), +specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field). + +## [0.10.1] - 2018-01-03 +### Fixed +- Don't require &mut self for TagSetterExtManual::add() + +### Added +- A TagSetter example application +- Bindings for gst_video::convert_sample() and ::convert_sample_async() +- Bindings for gst_video::VideoRectangle +- Debug impl for Sample and ::with_buffer_list() constructor +- A borrowing version of VideoFrame: VideoFrameRef +- Bindings for GstVideoFilter + +### Changed +- Deprecated Sample::get_info() in favour of ::get_structure() +- Player has gst::Object as another parent class now + +## [0.10.0] - 2017-12-22 +### Fixed +- Various clippy warnings +- Memory leak of the tag list in Toc::merge_tags() +- Property getters use Values of the correct type +- Event::get_structure(), Message::get_structure() and + Query::get_structure() can return None for the structure +- Various other nullability fixes all over the API, changing functions to + accept Option<> or returning Option<>, or only plain types +- Functions taking paths/filenames now actually take Paths instead of &strs +- Element::remove_pad() is not giving away a new reference to the pad + anymore, which caused a memory leak of all pads ever removed +- Precision handling in ClockTime's Display impl +- Video/AudioInfo are only Send, not Sync + +### Added +- Various enums now also derive useful traits like Copy, Clone and Hash in + addition to PartialEq, Eq and Debug +- TagList::merge() and insert() for combining tag lists +- EventType gained many useful functions to work with event types and + a PartialOrd impl to check expected event order of event types where it matters +- MessageRef/EventRef/QueryRef implement ToOwned +- Bindings for Registry and PluginFeature +- Event::set_running_time_offset() for adjusting the offset while events + pass through the pipeline +- Event/Message GroupIds and Seqnums now have a newtype wrapper around u32 + instead of the plain value, making usage of them slightly more typesafe. + Also add an "invalid" value for both, as exists in latest GStreamer now. +- FormattedValue, GenericFormattedValue and related types were + implemented now, which allows more convenient and type-safe usage of + formatted values (time, bytes, etc) +- Bindings for force-keyunit and still-frame events were added +- MappedBuffer/BufferMap now implement various other useful traits, including + AsRef<[u8]>, AsMut, Deref, DerefMut, Debug, PartialEq and Eq +- Add VideoMultiviewFramePacking enum, and use it in Player +- Bindings for the GStreamer Net library, including PTP/NTP/network client + clocks and the GStreamer NetClock provider for network synchronization of + pipelines +- IteratorError implements std::error:Error +- Plugin::add_dependency() and ::add_dependency_simple() was added +- Rank and TypeFindProbability implement PartialOrd/Ord now +- Bindings for TypeFind, TypeFindFactory and the typefind helpers +- StreamCollection::iter() for iterating over all contained streams +- ErrorMessage type that can be used e.g. in a Result for passing an error + message from somewhere to upper layers to then be posted on an element the + same way gst_element_error!() would've done + +### Changed +- Sample::new(), TagList::add(), Structure::set() and similar + functions take the values (ToSendValue impls) by reference instead of value. + They were not consumed by the function before. +- The Debug impls of various types, including Event/Buffer/Message/Query/Structure + were improved to print all the fields, similar to what GST_PTR_FORMAT would + do in C +- Switched to lazy_static 1.0 +- Gap event and Duration tag are using ClockTimes now, as well as various + Player signals +- Segment is now based on a generic type FormattedSegment that can + take any format (time, bytes, etc) or a GenericFormattedValue for more + type-safety and convenience. Also functions for "casting" between a generic + segment and a segment with a specific format exist on this now +- AppSrc and AppSink now have a builder for the callbacks, making it + unnecessary to always provide all callbacks even if only one is actually + needed +- Various functions that returned bool for errors, are now returning a Result +- Player configuration is now a custom type with more convenient API +- Player VideoInfo uses a Fraction instead of (u32,u32) for the framerate and + pixel-aspect-ratio +- VideoFrame API has more consistent API between writable and read-only + variants +- Buffer::copy_into() was added, and ::copy_region() now takes a + BufferCopyFlags parameter instead of always using the default flags +- ChildProxy::set_child_property() takes a &ToValue now to follow the API of + Object::set_property() and improve usability +- Proxy/GhostPad default pad functions use the correct specific pad type now + instead of a generic Pad +- Bus::add_signal_watch_full() takes a Priority for the priority instead of u32 +- Clock::(un)adjust_with_calibration() takes no clock parameter anymore + +### Removed +- FormatValue was removed in favour of GenericFormattedValue and the + connected traits and specific format impls + +## [0.9.1] - 2017-11-26 +### Fixed +- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`, + `PadLinkError`/`PadLinkSuccess` too + +## [0.9.0] - 2017-11-26 +### Added +- Bindings for (outputting to) the GStreamer logging system +- Bindings for the GStreamer base library +- Bindings for all the `Pad` functions to override pad behaviour, and pad task + functions +- Bindings for `StaticCaps` and `StaticPadTemplate` +- Bindings for `deep-notify` signal on `Object` +- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them + from an element with context information (file, line, module, etc.) similar + to the C `GST_ELEMENT_ERROR` macro +- Support for setting custom fields in `Messages`/`Events` during construction +- Support for creating Buffers out of anything that is `AsRef<[u8]>` or + `AsMut<[u8]>` +- Support for using the `Read` trait on `Adapter` +- Functions for getting all sink/src/all pads of an `Element`, and all children + of a `Bin` +- Builder for `Caps` and `Structures` in addition to the existing functions +- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler` +- Rust ports of the basic tutorials 1 to 8 from + https://gstreamer.freedesktop.org/documentation/tutorials/ +- "Getting started" and "Installation" sections to the README.md +- "dox" feature for generating documentation for all available configurations + +### Fixed +- `StackTraceFlags` are only available since 1.12 +- Worked around macOS requiring a `NSRunLoop` running on the main thread in all + examples and tutorials, to be able to show a window or anything else + +### Changed +- `ClockTime` is now a wrapper around `Option` to handle the + `CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic + and other traits as needed and ensures that no accidential calculations with + `CLOCK_TIME_NONE` can happen +- "Values with format", like in `Duration`/`Position`/`Convert` queries or + `Seek` events now return a `FormatValue` type. This contains the actual + `Format` together with the value and does any required conversions. This + also makes it harder to accidentially mix e.g. values in bytes and time +- `PadProbeId` does not implement `Clone`/`Copy` anymore +- Property notify watches return a custom type instead of ulong +- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of + `glib::Error` now. Using arbitrary ones does not work +- `Iterator` bindings were completely rewritten and provide the item type as a + generic type parameter now, greatly simplifying its usage +- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and + `Structures`, as their content must be possible to send to different threads + safely +- `Message::get_src()` can return `None` +- Allow `None` as `Caps` in `AppSrc`/`AppSink` +- Allow everything implementing `Into>` to be used as a pad name +- Moved `copy()` from `GstRc` directly to `MiniObject` +- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now + implement an `into_result()` function that splits them into a `Result` with + the good and bad cases. Also mark them as `#[must_use]` to make it harder to + accidentially ignore errors. +- Error enums implement the `Error` trait + +- Many examples use the `failure` crate for error handling now, cleaning up the + error handling code quite a bit +- Lots of other code cleanup, compiler/clippy warning cleanup, etc. + +## [0.8.2] - 2017-11-11 +### Fixed +- Implement StaticType of BufferRef instead of Buffer. Buffer aka + GstRc already implements StaticType if BufferRef does, and + without this it was not possible to use Buffers in GValues. +- Free memory of the appsink/appsrc callbacks with the correct type. It was + crashing because of using the wrong type before. +- Fix documentation URLs in Cargo.toml. + +### Added +- Installation instructions and links to documentation for getting started to + README.md. + +## [0.8.1] - 2017-09-15 +### Added +- Implement Send+Sync for Query, Message and Event, and their corresponding + Ref types. + +### Fixed +- Constructor for gst_player::Player now works properly with GStreamer 1.12 + when passing a video renderer or signal dispatcher. There was a reference + counting bug. +- Instead of returning &'static references from functions, return references + with a generic, unbound lifetime instead. + See https://github.com/rust-lang/rust/pull/42417#issue-233404573 +- Various "unused external crate" warnings and clippy warnings everywhere. + +### Changed +- Remove Cargo.lock from GIT, it's not very useful for library crates. +- Run everything through latest rustfmt-nightly. +- Use while-let (instead of loop and if-let) and CLOCK_TIME_NONE (instead of + u64::MAX) in the examples. + +## [0.8.0] - 2017-08-31 + +- Initial release of the autogenerated GStreamer bindings. Older versions + (< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs). + The API of the two is incompatible. + +[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...HEAD +[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1 +[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0 +[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1 +[0.9.0]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.9.0 +[0.8.2]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.8.2 +[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1 diff --git a/gstreamer-rtsp/Cargo.toml b/gstreamer-rtsp/Cargo.toml new file mode 100644 index 000000000..4ed44b630 --- /dev/null +++ b/gstreamer-rtsp/Cargo.toml @@ -0,0 +1,42 @@ +[package] +name = "gstreamer-rtsp" +version = "0.11.0" +authors = ["Mathieu Duponchelle ", "Sebastian Dröge "] +categories = ["api-bindings", "multimedia"] +description = "Rust bindings for GStreamer Rtsp library" +repository = "https://github.com/sdroege/gstreamer-rs" +license = "MIT/Apache-2.0" +readme = "README.md" +homepage = "https://gstreamer.freedesktop.org" +documentation = "https://sdroege.github.io/rustdoc/gstreamer/gstreamer_rtsp" +keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"] +build = "build.rs" + +[dependencies] +bitflags = "1.0" +libc = "0.2" +glib-sys = { git = "https://github.com/gtk-rs/sys" } +gobject-sys = { git = "https://github.com/gtk-rs/sys" } +gio-sys = { git = "https://github.com/gtk-rs/sys" } +gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } +gstreamer-rtsp-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } +gstreamer-sdp-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } +glib = { git = "https://github.com/gtk-rs/glib" } +gio = { git = "https://github.com/gtk-rs/gio" } +gstreamer = { path = "../gstreamer" } +gstreamer-sdp = { path = "../gstreamer-sdp" } + +[build-dependencies.rustdoc-stripper] +version = "0.1" +optional = true + +[features] +v1_10 = ["gstreamer-sys/v1_10", "gstreamer-rtsp-sys/v1_10", "gstreamer-sdp-sys/v1_10"] +v1_12 = ["gstreamer-sys/v1_12", "gstreamer-rtsp-sys/v1_12", "gstreamer-sdp-sys/v1_12", "v1_10"] +embed-lgpl-docs = ["rustdoc-stripper"] +purge-lgpl-docs = ["rustdoc-stripper"] +dox = ["gstreamer-rtsp-sys/dox", "glib/dox", "gstreamer/dox"] +default-features = [] + +[badges] +travis-ci = { repository = "sdroege/gstreamer-rs", branch = "master" } diff --git a/gstreamer-rtsp/LICENSE-APACHE b/gstreamer-rtsp/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/gstreamer-rtsp/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/gstreamer-rtsp/LICENSE-MIT b/gstreamer-rtsp/LICENSE-MIT new file mode 100644 index 000000000..31aa79387 --- /dev/null +++ b/gstreamer-rtsp/LICENSE-MIT @@ -0,0 +1,23 @@ +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. diff --git a/gstreamer-rtsp/README.md b/gstreamer-rtsp/README.md new file mode 100644 index 000000000..2fd4bf995 --- /dev/null +++ b/gstreamer-rtsp/README.md @@ -0,0 +1,170 @@ +# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-sdp.svg)](https://crates.io/crates/gstreamer-sdp) [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs) + +[GStreamer](https://gstreamer.freedesktop.org/) (Sdp library) bindings for Rust. +Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/). + +These bindings are providing a safe API that can be used to interface with +GStreamer, e.g. for writing GStreamer-based applications. + +For background and motivation, see the [announcement blogpost](https://coaxion.net/blog/2017/07/writing-gstreamer-applications-in-rust/). + +The bindings (since 0.8.0) are autogenerated with [gir](https://github.com/gtk-rs/gir/) +based on the [GObject-Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection/) +API metadata provided by the GStreamer project. Older versions before 0.8.0 were manually +written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs). +The API of the two is incompatible. + +A crate for writing GStreamer plugins in Rust can be found here: https://github.com/sdroege/gst-plugin-rs + +## Table of Contents +1. [Installation](#installation) + 1. [Linux/BSDs](#installation-linux) + 1. [macOS](#installation-macos) + 1. [Windows](#installation-windows) +1. [Getting Started](#getting-started) +1. [License](#license) +1. [Contribution](#contribution) + + + +## Installation + +To build the GStreamer bindings or anything depending on them, you need to +have at least GStreamer 1.8 and gst-plugins-base 1.8 installed. In addition, +some of the examples/tutorials require various GStreamer plugins to be +available, which can be found in gst-plugins-base, gst-plugins-good, +gst-plugins-bad, gst-plugins-ugly and/or gst-libav. + + + +### Linux/BSDs + +You need to install the above mentioned packages with your distributions +package manager, or build them from source. + +On Debian/Ubuntu they can be installed with + +``` +$ apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \ + gstreamer1.0-libav +``` + +Package names on other distributions should be similar. +Please submit a pull request with instructions for yours. + + + +### macOS + +You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or +by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/) +provided by the GStreamer project. + +#### Homebrew + +``` +$ brew install gstreamer gst-plugins-base gst-plugins-good \ + gst-plugins-bad gst-plugins-ugly gst-libav +``` + +#### GStreamer Binaries + +You need to download the *two* `.pkg` files from the GStreamer website and +install them, e.g. `gstreamer-1.0-1.12.3-x86_64.pkg` and +`gstreamer-1.0-devel-1.12.3-x86_64.pkg`. + +After installation, you also need to install `pkg-config` (e.g. via Homebrew) +and set the `PKG_CONFIG_PATH` environment variable + +``` +$ export PKG_CONFIG_PATH="/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" +``` + + + +### Windows + +You can install GStreamer and the plugins via [MSYS2](http://www.msys2.org/) +with `pacman` or by installing the +[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by +the GStreamer project. + +#### MSYS2 / pacman + +``` +$ pacman -S pkg-config mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base \ + mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad \ + mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav +``` + +#### GStreamer Binaries + +You need to download the *two* `.msi` files for your platform from the +GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.12.3.msi` and +`gstreamer-1.0-devel-x86_64-1.12.3.msi`. + +After installation, you also need to install `pkg-config` (e.g. via MSYS2 or +from [here](https://sourceforge.net/projects/pkgconfiglite/)) +and set the `PKG_CONFIG_PATH` environment variable + +``` +$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" +``` + + + +## Getting Started + +The API reference can be found +[here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/), however it is +only the Rust API reference and does not explain any of the concepts. + +For getting started with GStreamer development, the best would be to follow +the [documentation](https://gstreamer.freedesktop.org/documentation/) on the +GStreamer website, especially the [Application Development +Manual](https://gstreamer.freedesktop.org/documentation/application-development/). +While being C-centric, it explains all the fundamental concepts of GStreamer +and the code examples should be relatively easily translatable to Rust. The +API is basically the same, function/struct names are the same and everything +is only more convenient (hopefully) and safer. + +In addition there are +[tutorials](https://gstreamer.freedesktop.org/documentation/tutorials/) on the +GStreamer website. Many of them were ported to Rust already and the code can +be found in the +[tutorials](https://github.com/sdroege/gstreamer-rs/tree/master/tutorials) +directory. + +Some further examples for various aspects of GStreamer and how to use it from +Rust can be found in the +[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples) +directory. + + + +## LICENSE + +gstreamer-rs and all crates contained in here are licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) + +at your option. + +GStreamer itself is licensed under the Lesser General Public License version +2.1 or (at your option) any later version: +https://www.gnu.org/licenses/lgpl-2.1.html + + + +## Contribution + +Any kinds of contributions are welcome as a pull request. + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in gstreamer-rs by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. diff --git a/gstreamer-rtsp/build.rs b/gstreamer-rtsp/build.rs new file mode 100644 index 000000000..4c9b0db5b --- /dev/null +++ b/gstreamer-rtsp/build.rs @@ -0,0 +1,34 @@ +fn main() { + manage_docs(); +} + +#[cfg(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs"))] +fn manage_docs() { + extern crate stripper_lib; + use std::io; + + let path = "src"; + let ignores: &[&str] = &[]; + + stripper_lib::loop_over_files( + path.as_ref(), + &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), + &ignores, + false, + ); + + #[cfg(feature = "embed-lgpl-docs")] + { + let docs = include_str!("../docs/gstreamer-rtsp/docs.md"); + let mut infos = stripper_lib::parse_cmts(docs.lines(), true); + stripper_lib::loop_over_files( + path.as_ref(), + &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), + &ignores, + false, + ); + } +} + +#[cfg(not(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")))] +fn manage_docs() {} diff --git a/gstreamer-rtsp/src/auto/enums.rs b/gstreamer-rtsp/src/auto/enums.rs new file mode 100644 index 000000000..abd20eb68 --- /dev/null +++ b/gstreamer-rtsp/src/auto/enums.rs @@ -0,0 +1,1001 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::StaticType; +use glib::Type; +use glib::translate::*; +use glib::value::FromValue; +use glib::value::FromValueOptional; +use glib::value::SetValue; +use glib::value::Value; +use gobject_ffi; + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPAuthMethod { + None, + Basic, + Digest, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPAuthMethod { + type GlibType = ffi::GstRTSPAuthMethod; + + fn to_glib(&self) -> ffi::GstRTSPAuthMethod { + match *self { + RTSPAuthMethod::None => ffi::GST_RTSP_AUTH_NONE, + RTSPAuthMethod::Basic => ffi::GST_RTSP_AUTH_BASIC, + RTSPAuthMethod::Digest => ffi::GST_RTSP_AUTH_DIGEST, + RTSPAuthMethod::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPAuthMethod { + fn from_glib(value: ffi::GstRTSPAuthMethod) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPAuthMethod::None, + 1 => RTSPAuthMethod::Basic, + 2 => RTSPAuthMethod::Digest, + value => RTSPAuthMethod::__Unknown(value), + } + } +} + +impl StaticType for RTSPAuthMethod { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_auth_method_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPAuthMethod { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPAuthMethod { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for RTSPAuthMethod { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPFamily { + None, + Inet, + Inet6, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPFamily { + type GlibType = ffi::GstRTSPFamily; + + fn to_glib(&self) -> ffi::GstRTSPFamily { + match *self { + RTSPFamily::None => ffi::GST_RTSP_FAM_NONE, + RTSPFamily::Inet => ffi::GST_RTSP_FAM_INET, + RTSPFamily::Inet6 => ffi::GST_RTSP_FAM_INET6, + RTSPFamily::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPFamily { + fn from_glib(value: ffi::GstRTSPFamily) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPFamily::None, + 1 => RTSPFamily::Inet, + 2 => RTSPFamily::Inet6, + value => RTSPFamily::__Unknown(value), + } + } +} + +impl StaticType for RTSPFamily { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_family_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPFamily { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPFamily { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for RTSPFamily { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPHeaderField { + Invalid, + Accept, + AcceptEncoding, + AcceptLanguage, + Allow, + Authorization, + Bandwidth, + Blocksize, + CacheControl, + Conference, + Connection, + ContentBase, + ContentEncoding, + ContentLanguage, + ContentLength, + ContentLocation, + ContentType, + Cseq, + Date, + Expires, + From, + IfModifiedSince, + LastModified, + ProxyAuthenticate, + ProxyRequire, + Public, + Range, + Referer, + Require, + RetryAfter, + RtpInfo, + Scale, + Session, + Server, + Speed, + Transport, + Unsupported, + UserAgent, + Via, + WwwAuthenticate, + ClientChallenge, + RealChallenge1, + RealChallenge2, + RealChallenge3, + Subscribe, + Alert, + ClientId, + CompanyId, + Guid, + RegionData, + MaxAsmWidth, + Language, + PlayerStartTime, + Location, + Etag, + IfMatch, + AcceptCharset, + Supported, + Vary, + XAccelerateStreaming, + XAcceptAuthent, + XAcceptProxyAuthent, + XBroadcastId, + XBurstStreaming, + XNotice, + XPlayerLagTime, + XPlaylist, + XPlaylistChangeNotice, + XPlaylistGenId, + XPlaylistSeekId, + XProxyClientAgent, + XProxyClientVerb, + XRecedingPlaylistchange, + XRtpInfo, + XStartupprofile, + Timestamp, + AuthenticationInfo, + Host, + Pragma, + XServerIpAddress, + XSessioncookie, + RtcpInterval, + Keymgmt, + Last, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPHeaderField { + type GlibType = ffi::GstRTSPHeaderField; + + fn to_glib(&self) -> ffi::GstRTSPHeaderField { + match *self { + RTSPHeaderField::Invalid => ffi::GST_RTSP_HDR_INVALID, + RTSPHeaderField::Accept => ffi::GST_RTSP_HDR_ACCEPT, + RTSPHeaderField::AcceptEncoding => ffi::GST_RTSP_HDR_ACCEPT_ENCODING, + RTSPHeaderField::AcceptLanguage => ffi::GST_RTSP_HDR_ACCEPT_LANGUAGE, + RTSPHeaderField::Allow => ffi::GST_RTSP_HDR_ALLOW, + RTSPHeaderField::Authorization => ffi::GST_RTSP_HDR_AUTHORIZATION, + RTSPHeaderField::Bandwidth => ffi::GST_RTSP_HDR_BANDWIDTH, + RTSPHeaderField::Blocksize => ffi::GST_RTSP_HDR_BLOCKSIZE, + RTSPHeaderField::CacheControl => ffi::GST_RTSP_HDR_CACHE_CONTROL, + RTSPHeaderField::Conference => ffi::GST_RTSP_HDR_CONFERENCE, + RTSPHeaderField::Connection => ffi::GST_RTSP_HDR_CONNECTION, + RTSPHeaderField::ContentBase => ffi::GST_RTSP_HDR_CONTENT_BASE, + RTSPHeaderField::ContentEncoding => ffi::GST_RTSP_HDR_CONTENT_ENCODING, + RTSPHeaderField::ContentLanguage => ffi::GST_RTSP_HDR_CONTENT_LANGUAGE, + RTSPHeaderField::ContentLength => ffi::GST_RTSP_HDR_CONTENT_LENGTH, + RTSPHeaderField::ContentLocation => ffi::GST_RTSP_HDR_CONTENT_LOCATION, + RTSPHeaderField::ContentType => ffi::GST_RTSP_HDR_CONTENT_TYPE, + RTSPHeaderField::Cseq => ffi::GST_RTSP_HDR_CSEQ, + RTSPHeaderField::Date => ffi::GST_RTSP_HDR_DATE, + RTSPHeaderField::Expires => ffi::GST_RTSP_HDR_EXPIRES, + RTSPHeaderField::From => ffi::GST_RTSP_HDR_FROM, + RTSPHeaderField::IfModifiedSince => ffi::GST_RTSP_HDR_IF_MODIFIED_SINCE, + RTSPHeaderField::LastModified => ffi::GST_RTSP_HDR_LAST_MODIFIED, + RTSPHeaderField::ProxyAuthenticate => ffi::GST_RTSP_HDR_PROXY_AUTHENTICATE, + RTSPHeaderField::ProxyRequire => ffi::GST_RTSP_HDR_PROXY_REQUIRE, + RTSPHeaderField::Public => ffi::GST_RTSP_HDR_PUBLIC, + RTSPHeaderField::Range => ffi::GST_RTSP_HDR_RANGE, + RTSPHeaderField::Referer => ffi::GST_RTSP_HDR_REFERER, + RTSPHeaderField::Require => ffi::GST_RTSP_HDR_REQUIRE, + RTSPHeaderField::RetryAfter => ffi::GST_RTSP_HDR_RETRY_AFTER, + RTSPHeaderField::RtpInfo => ffi::GST_RTSP_HDR_RTP_INFO, + RTSPHeaderField::Scale => ffi::GST_RTSP_HDR_SCALE, + RTSPHeaderField::Session => ffi::GST_RTSP_HDR_SESSION, + RTSPHeaderField::Server => ffi::GST_RTSP_HDR_SERVER, + RTSPHeaderField::Speed => ffi::GST_RTSP_HDR_SPEED, + RTSPHeaderField::Transport => ffi::GST_RTSP_HDR_TRANSPORT, + RTSPHeaderField::Unsupported => ffi::GST_RTSP_HDR_UNSUPPORTED, + RTSPHeaderField::UserAgent => ffi::GST_RTSP_HDR_USER_AGENT, + RTSPHeaderField::Via => ffi::GST_RTSP_HDR_VIA, + RTSPHeaderField::WwwAuthenticate => ffi::GST_RTSP_HDR_WWW_AUTHENTICATE, + RTSPHeaderField::ClientChallenge => ffi::GST_RTSP_HDR_CLIENT_CHALLENGE, + RTSPHeaderField::RealChallenge1 => ffi::GST_RTSP_HDR_REAL_CHALLENGE1, + RTSPHeaderField::RealChallenge2 => ffi::GST_RTSP_HDR_REAL_CHALLENGE2, + RTSPHeaderField::RealChallenge3 => ffi::GST_RTSP_HDR_REAL_CHALLENGE3, + RTSPHeaderField::Subscribe => ffi::GST_RTSP_HDR_SUBSCRIBE, + RTSPHeaderField::Alert => ffi::GST_RTSP_HDR_ALERT, + RTSPHeaderField::ClientId => ffi::GST_RTSP_HDR_CLIENT_ID, + RTSPHeaderField::CompanyId => ffi::GST_RTSP_HDR_COMPANY_ID, + RTSPHeaderField::Guid => ffi::GST_RTSP_HDR_GUID, + RTSPHeaderField::RegionData => ffi::GST_RTSP_HDR_REGION_DATA, + RTSPHeaderField::MaxAsmWidth => ffi::GST_RTSP_HDR_MAX_ASM_WIDTH, + RTSPHeaderField::Language => ffi::GST_RTSP_HDR_LANGUAGE, + RTSPHeaderField::PlayerStartTime => ffi::GST_RTSP_HDR_PLAYER_START_TIME, + RTSPHeaderField::Location => ffi::GST_RTSP_HDR_LOCATION, + RTSPHeaderField::Etag => ffi::GST_RTSP_HDR_ETAG, + RTSPHeaderField::IfMatch => ffi::GST_RTSP_HDR_IF_MATCH, + RTSPHeaderField::AcceptCharset => ffi::GST_RTSP_HDR_ACCEPT_CHARSET, + RTSPHeaderField::Supported => ffi::GST_RTSP_HDR_SUPPORTED, + RTSPHeaderField::Vary => ffi::GST_RTSP_HDR_VARY, + RTSPHeaderField::XAccelerateStreaming => ffi::GST_RTSP_HDR_X_ACCELERATE_STREAMING, + RTSPHeaderField::XAcceptAuthent => ffi::GST_RTSP_HDR_X_ACCEPT_AUTHENT, + RTSPHeaderField::XAcceptProxyAuthent => ffi::GST_RTSP_HDR_X_ACCEPT_PROXY_AUTHENT, + RTSPHeaderField::XBroadcastId => ffi::GST_RTSP_HDR_X_BROADCAST_ID, + RTSPHeaderField::XBurstStreaming => ffi::GST_RTSP_HDR_X_BURST_STREAMING, + RTSPHeaderField::XNotice => ffi::GST_RTSP_HDR_X_NOTICE, + RTSPHeaderField::XPlayerLagTime => ffi::GST_RTSP_HDR_X_PLAYER_LAG_TIME, + RTSPHeaderField::XPlaylist => ffi::GST_RTSP_HDR_X_PLAYLIST, + RTSPHeaderField::XPlaylistChangeNotice => ffi::GST_RTSP_HDR_X_PLAYLIST_CHANGE_NOTICE, + RTSPHeaderField::XPlaylistGenId => ffi::GST_RTSP_HDR_X_PLAYLIST_GEN_ID, + RTSPHeaderField::XPlaylistSeekId => ffi::GST_RTSP_HDR_X_PLAYLIST_SEEK_ID, + RTSPHeaderField::XProxyClientAgent => ffi::GST_RTSP_HDR_X_PROXY_CLIENT_AGENT, + RTSPHeaderField::XProxyClientVerb => ffi::GST_RTSP_HDR_X_PROXY_CLIENT_VERB, + RTSPHeaderField::XRecedingPlaylistchange => ffi::GST_RTSP_HDR_X_RECEDING_PLAYLISTCHANGE, + RTSPHeaderField::XRtpInfo => ffi::GST_RTSP_HDR_X_RTP_INFO, + RTSPHeaderField::XStartupprofile => ffi::GST_RTSP_HDR_X_STARTUPPROFILE, + RTSPHeaderField::Timestamp => ffi::GST_RTSP_HDR_TIMESTAMP, + RTSPHeaderField::AuthenticationInfo => ffi::GST_RTSP_HDR_AUTHENTICATION_INFO, + RTSPHeaderField::Host => ffi::GST_RTSP_HDR_HOST, + RTSPHeaderField::Pragma => ffi::GST_RTSP_HDR_PRAGMA, + RTSPHeaderField::XServerIpAddress => ffi::GST_RTSP_HDR_X_SERVER_IP_ADDRESS, + RTSPHeaderField::XSessioncookie => ffi::GST_RTSP_HDR_X_SESSIONCOOKIE, + RTSPHeaderField::RtcpInterval => ffi::GST_RTSP_HDR_RTCP_INTERVAL, + RTSPHeaderField::Keymgmt => ffi::GST_RTSP_HDR_KEYMGMT, + RTSPHeaderField::Last => ffi::GST_RTSP_HDR_LAST, + RTSPHeaderField::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPHeaderField { + fn from_glib(value: ffi::GstRTSPHeaderField) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPHeaderField::Invalid, + 1 => RTSPHeaderField::Accept, + 2 => RTSPHeaderField::AcceptEncoding, + 3 => RTSPHeaderField::AcceptLanguage, + 4 => RTSPHeaderField::Allow, + 5 => RTSPHeaderField::Authorization, + 6 => RTSPHeaderField::Bandwidth, + 7 => RTSPHeaderField::Blocksize, + 8 => RTSPHeaderField::CacheControl, + 9 => RTSPHeaderField::Conference, + 10 => RTSPHeaderField::Connection, + 11 => RTSPHeaderField::ContentBase, + 12 => RTSPHeaderField::ContentEncoding, + 13 => RTSPHeaderField::ContentLanguage, + 14 => RTSPHeaderField::ContentLength, + 15 => RTSPHeaderField::ContentLocation, + 16 => RTSPHeaderField::ContentType, + 17 => RTSPHeaderField::Cseq, + 18 => RTSPHeaderField::Date, + 19 => RTSPHeaderField::Expires, + 20 => RTSPHeaderField::From, + 21 => RTSPHeaderField::IfModifiedSince, + 22 => RTSPHeaderField::LastModified, + 23 => RTSPHeaderField::ProxyAuthenticate, + 24 => RTSPHeaderField::ProxyRequire, + 25 => RTSPHeaderField::Public, + 26 => RTSPHeaderField::Range, + 27 => RTSPHeaderField::Referer, + 28 => RTSPHeaderField::Require, + 29 => RTSPHeaderField::RetryAfter, + 30 => RTSPHeaderField::RtpInfo, + 31 => RTSPHeaderField::Scale, + 32 => RTSPHeaderField::Session, + 33 => RTSPHeaderField::Server, + 34 => RTSPHeaderField::Speed, + 35 => RTSPHeaderField::Transport, + 36 => RTSPHeaderField::Unsupported, + 37 => RTSPHeaderField::UserAgent, + 38 => RTSPHeaderField::Via, + 39 => RTSPHeaderField::WwwAuthenticate, + 40 => RTSPHeaderField::ClientChallenge, + 41 => RTSPHeaderField::RealChallenge1, + 42 => RTSPHeaderField::RealChallenge2, + 43 => RTSPHeaderField::RealChallenge3, + 44 => RTSPHeaderField::Subscribe, + 45 => RTSPHeaderField::Alert, + 46 => RTSPHeaderField::ClientId, + 47 => RTSPHeaderField::CompanyId, + 48 => RTSPHeaderField::Guid, + 49 => RTSPHeaderField::RegionData, + 50 => RTSPHeaderField::MaxAsmWidth, + 51 => RTSPHeaderField::Language, + 52 => RTSPHeaderField::PlayerStartTime, + 53 => RTSPHeaderField::Location, + 54 => RTSPHeaderField::Etag, + 55 => RTSPHeaderField::IfMatch, + 56 => RTSPHeaderField::AcceptCharset, + 57 => RTSPHeaderField::Supported, + 58 => RTSPHeaderField::Vary, + 59 => RTSPHeaderField::XAccelerateStreaming, + 60 => RTSPHeaderField::XAcceptAuthent, + 61 => RTSPHeaderField::XAcceptProxyAuthent, + 62 => RTSPHeaderField::XBroadcastId, + 63 => RTSPHeaderField::XBurstStreaming, + 64 => RTSPHeaderField::XNotice, + 65 => RTSPHeaderField::XPlayerLagTime, + 66 => RTSPHeaderField::XPlaylist, + 67 => RTSPHeaderField::XPlaylistChangeNotice, + 68 => RTSPHeaderField::XPlaylistGenId, + 69 => RTSPHeaderField::XPlaylistSeekId, + 70 => RTSPHeaderField::XProxyClientAgent, + 71 => RTSPHeaderField::XProxyClientVerb, + 72 => RTSPHeaderField::XRecedingPlaylistchange, + 73 => RTSPHeaderField::XRtpInfo, + 74 => RTSPHeaderField::XStartupprofile, + 75 => RTSPHeaderField::Timestamp, + 76 => RTSPHeaderField::AuthenticationInfo, + 77 => RTSPHeaderField::Host, + 78 => RTSPHeaderField::Pragma, + 79 => RTSPHeaderField::XServerIpAddress, + 80 => RTSPHeaderField::XSessioncookie, + 81 => RTSPHeaderField::RtcpInterval, + 82 => RTSPHeaderField::Keymgmt, + 83 => RTSPHeaderField::Last, + value => RTSPHeaderField::__Unknown(value), + } + } +} + +impl StaticType for RTSPHeaderField { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_header_field_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPHeaderField { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPHeaderField { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for RTSPHeaderField { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPMsgType { + Invalid, + Request, + Response, + HttpRequest, + HttpResponse, + Data, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPMsgType { + type GlibType = ffi::GstRTSPMsgType; + + fn to_glib(&self) -> ffi::GstRTSPMsgType { + match *self { + RTSPMsgType::Invalid => ffi::GST_RTSP_MESSAGE_INVALID, + RTSPMsgType::Request => ffi::GST_RTSP_MESSAGE_REQUEST, + RTSPMsgType::Response => ffi::GST_RTSP_MESSAGE_RESPONSE, + RTSPMsgType::HttpRequest => ffi::GST_RTSP_MESSAGE_HTTP_REQUEST, + RTSPMsgType::HttpResponse => ffi::GST_RTSP_MESSAGE_HTTP_RESPONSE, + RTSPMsgType::Data => ffi::GST_RTSP_MESSAGE_DATA, + RTSPMsgType::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPMsgType { + fn from_glib(value: ffi::GstRTSPMsgType) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPMsgType::Invalid, + 1 => RTSPMsgType::Request, + 2 => RTSPMsgType::Response, + 3 => RTSPMsgType::HttpRequest, + 4 => RTSPMsgType::HttpResponse, + 5 => RTSPMsgType::Data, + value => RTSPMsgType::__Unknown(value), + } + } +} + +impl StaticType for RTSPMsgType { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_msg_type_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPMsgType { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPMsgType { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for RTSPMsgType { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPRangeUnit { + Smpte, + Smpte30Drop, + Smpte25, + Npt, + Clock, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPRangeUnit { + type GlibType = ffi::GstRTSPRangeUnit; + + fn to_glib(&self) -> ffi::GstRTSPRangeUnit { + match *self { + RTSPRangeUnit::Smpte => ffi::GST_RTSP_RANGE_SMPTE, + RTSPRangeUnit::Smpte30Drop => ffi::GST_RTSP_RANGE_SMPTE_30_DROP, + RTSPRangeUnit::Smpte25 => ffi::GST_RTSP_RANGE_SMPTE_25, + RTSPRangeUnit::Npt => ffi::GST_RTSP_RANGE_NPT, + RTSPRangeUnit::Clock => ffi::GST_RTSP_RANGE_CLOCK, + RTSPRangeUnit::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPRangeUnit { + fn from_glib(value: ffi::GstRTSPRangeUnit) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPRangeUnit::Smpte, + 1 => RTSPRangeUnit::Smpte30Drop, + 2 => RTSPRangeUnit::Smpte25, + 3 => RTSPRangeUnit::Npt, + 4 => RTSPRangeUnit::Clock, + value => RTSPRangeUnit::__Unknown(value), + } + } +} + +impl StaticType for RTSPRangeUnit { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_range_unit_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPRangeUnit { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPRangeUnit { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for RTSPRangeUnit { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPResult { + Ok, + Error, + Einval, + Eintr, + Enomem, + Eresolv, + Enotimpl, + Esys, + Eparse, + Ewsastart, + Ewsaversion, + Eeof, + Enet, + Enotip, + Etimeout, + Etget, + Etpost, + Elast, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPResult { + type GlibType = ffi::GstRTSPResult; + + fn to_glib(&self) -> ffi::GstRTSPResult { + match *self { + RTSPResult::Ok => ffi::GST_RTSP_OK, + RTSPResult::Error => ffi::GST_RTSP_ERROR, + RTSPResult::Einval => ffi::GST_RTSP_EINVAL, + RTSPResult::Eintr => ffi::GST_RTSP_EINTR, + RTSPResult::Enomem => ffi::GST_RTSP_ENOMEM, + RTSPResult::Eresolv => ffi::GST_RTSP_ERESOLV, + RTSPResult::Enotimpl => ffi::GST_RTSP_ENOTIMPL, + RTSPResult::Esys => ffi::GST_RTSP_ESYS, + RTSPResult::Eparse => ffi::GST_RTSP_EPARSE, + RTSPResult::Ewsastart => ffi::GST_RTSP_EWSASTART, + RTSPResult::Ewsaversion => ffi::GST_RTSP_EWSAVERSION, + RTSPResult::Eeof => ffi::GST_RTSP_EEOF, + RTSPResult::Enet => ffi::GST_RTSP_ENET, + RTSPResult::Enotip => ffi::GST_RTSP_ENOTIP, + RTSPResult::Etimeout => ffi::GST_RTSP_ETIMEOUT, + RTSPResult::Etget => ffi::GST_RTSP_ETGET, + RTSPResult::Etpost => ffi::GST_RTSP_ETPOST, + RTSPResult::Elast => ffi::GST_RTSP_ELAST, + RTSPResult::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPResult { + fn from_glib(value: ffi::GstRTSPResult) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPResult::Ok, + -1 => RTSPResult::Error, + -2 => RTSPResult::Einval, + -3 => RTSPResult::Eintr, + -4 => RTSPResult::Enomem, + -5 => RTSPResult::Eresolv, + -6 => RTSPResult::Enotimpl, + -7 => RTSPResult::Esys, + -8 => RTSPResult::Eparse, + -9 => RTSPResult::Ewsastart, + -10 => RTSPResult::Ewsaversion, + -11 => RTSPResult::Eeof, + -12 => RTSPResult::Enet, + -13 => RTSPResult::Enotip, + -14 => RTSPResult::Etimeout, + -15 => RTSPResult::Etget, + -16 => RTSPResult::Etpost, + -17 => RTSPResult::Elast, + value => RTSPResult::__Unknown(value), + } + } +} + +impl StaticType for RTSPResult { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_result_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPResult { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPResult { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for RTSPResult { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPState { + Invalid, + Init, + Ready, + Seeking, + Playing, + Recording, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPState { + type GlibType = ffi::GstRTSPState; + + fn to_glib(&self) -> ffi::GstRTSPState { + match *self { + RTSPState::Invalid => ffi::GST_RTSP_STATE_INVALID, + RTSPState::Init => ffi::GST_RTSP_STATE_INIT, + RTSPState::Ready => ffi::GST_RTSP_STATE_READY, + RTSPState::Seeking => ffi::GST_RTSP_STATE_SEEKING, + RTSPState::Playing => ffi::GST_RTSP_STATE_PLAYING, + RTSPState::Recording => ffi::GST_RTSP_STATE_RECORDING, + RTSPState::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPState { + fn from_glib(value: ffi::GstRTSPState) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPState::Invalid, + 1 => RTSPState::Init, + 2 => RTSPState::Ready, + 3 => RTSPState::Seeking, + 4 => RTSPState::Playing, + 5 => RTSPState::Recording, + value => RTSPState::__Unknown(value), + } + } +} + +impl StaticType for RTSPState { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_state_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPState { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPState { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for RTSPState { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPStatusCode { + Invalid, + Continue, + Ok, + Created, + LowOnStorage, + MultipleChoices, + MovedPermanently, + MoveTemporarily, + SeeOther, + NotModified, + UseProxy, + BadRequest, + Unauthorized, + PaymentRequired, + Forbidden, + NotFound, + MethodNotAllowed, + NotAcceptable, + ProxyAuthRequired, + RequestTimeout, + Gone, + LengthRequired, + PreconditionFailed, + RequestEntityTooLarge, + RequestUriTooLarge, + UnsupportedMediaType, + ParameterNotUnderstood, + ConferenceNotFound, + NotEnoughBandwidth, + SessionNotFound, + MethodNotValidInThisState, + HeaderFieldNotValidForResource, + InvalidRange, + ParameterIsReadonly, + AggregateOperationNotAllowed, + OnlyAggregateOperationAllowed, + UnsupportedTransport, + DestinationUnreachable, + KeyManagementFailure, + InternalServerError, + NotImplemented, + BadGateway, + ServiceUnavailable, + GatewayTimeout, + RtspVersionNotSupported, + OptionNotSupported, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPStatusCode { + type GlibType = ffi::GstRTSPStatusCode; + + fn to_glib(&self) -> ffi::GstRTSPStatusCode { + match *self { + RTSPStatusCode::Invalid => ffi::GST_RTSP_STS_INVALID, + RTSPStatusCode::Continue => ffi::GST_RTSP_STS_CONTINUE, + RTSPStatusCode::Ok => ffi::GST_RTSP_STS_OK, + RTSPStatusCode::Created => ffi::GST_RTSP_STS_CREATED, + RTSPStatusCode::LowOnStorage => ffi::GST_RTSP_STS_LOW_ON_STORAGE, + RTSPStatusCode::MultipleChoices => ffi::GST_RTSP_STS_MULTIPLE_CHOICES, + RTSPStatusCode::MovedPermanently => ffi::GST_RTSP_STS_MOVED_PERMANENTLY, + RTSPStatusCode::MoveTemporarily => ffi::GST_RTSP_STS_MOVE_TEMPORARILY, + RTSPStatusCode::SeeOther => ffi::GST_RTSP_STS_SEE_OTHER, + RTSPStatusCode::NotModified => ffi::GST_RTSP_STS_NOT_MODIFIED, + RTSPStatusCode::UseProxy => ffi::GST_RTSP_STS_USE_PROXY, + RTSPStatusCode::BadRequest => ffi::GST_RTSP_STS_BAD_REQUEST, + RTSPStatusCode::Unauthorized => ffi::GST_RTSP_STS_UNAUTHORIZED, + RTSPStatusCode::PaymentRequired => ffi::GST_RTSP_STS_PAYMENT_REQUIRED, + RTSPStatusCode::Forbidden => ffi::GST_RTSP_STS_FORBIDDEN, + RTSPStatusCode::NotFound => ffi::GST_RTSP_STS_NOT_FOUND, + RTSPStatusCode::MethodNotAllowed => ffi::GST_RTSP_STS_METHOD_NOT_ALLOWED, + RTSPStatusCode::NotAcceptable => ffi::GST_RTSP_STS_NOT_ACCEPTABLE, + RTSPStatusCode::ProxyAuthRequired => ffi::GST_RTSP_STS_PROXY_AUTH_REQUIRED, + RTSPStatusCode::RequestTimeout => ffi::GST_RTSP_STS_REQUEST_TIMEOUT, + RTSPStatusCode::Gone => ffi::GST_RTSP_STS_GONE, + RTSPStatusCode::LengthRequired => ffi::GST_RTSP_STS_LENGTH_REQUIRED, + RTSPStatusCode::PreconditionFailed => ffi::GST_RTSP_STS_PRECONDITION_FAILED, + RTSPStatusCode::RequestEntityTooLarge => ffi::GST_RTSP_STS_REQUEST_ENTITY_TOO_LARGE, + RTSPStatusCode::RequestUriTooLarge => ffi::GST_RTSP_STS_REQUEST_URI_TOO_LARGE, + RTSPStatusCode::UnsupportedMediaType => ffi::GST_RTSP_STS_UNSUPPORTED_MEDIA_TYPE, + RTSPStatusCode::ParameterNotUnderstood => ffi::GST_RTSP_STS_PARAMETER_NOT_UNDERSTOOD, + RTSPStatusCode::ConferenceNotFound => ffi::GST_RTSP_STS_CONFERENCE_NOT_FOUND, + RTSPStatusCode::NotEnoughBandwidth => ffi::GST_RTSP_STS_NOT_ENOUGH_BANDWIDTH, + RTSPStatusCode::SessionNotFound => ffi::GST_RTSP_STS_SESSION_NOT_FOUND, + RTSPStatusCode::MethodNotValidInThisState => ffi::GST_RTSP_STS_METHOD_NOT_VALID_IN_THIS_STATE, + RTSPStatusCode::HeaderFieldNotValidForResource => ffi::GST_RTSP_STS_HEADER_FIELD_NOT_VALID_FOR_RESOURCE, + RTSPStatusCode::InvalidRange => ffi::GST_RTSP_STS_INVALID_RANGE, + RTSPStatusCode::ParameterIsReadonly => ffi::GST_RTSP_STS_PARAMETER_IS_READONLY, + RTSPStatusCode::AggregateOperationNotAllowed => ffi::GST_RTSP_STS_AGGREGATE_OPERATION_NOT_ALLOWED, + RTSPStatusCode::OnlyAggregateOperationAllowed => ffi::GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, + RTSPStatusCode::UnsupportedTransport => ffi::GST_RTSP_STS_UNSUPPORTED_TRANSPORT, + RTSPStatusCode::DestinationUnreachable => ffi::GST_RTSP_STS_DESTINATION_UNREACHABLE, + RTSPStatusCode::KeyManagementFailure => ffi::GST_RTSP_STS_KEY_MANAGEMENT_FAILURE, + RTSPStatusCode::InternalServerError => ffi::GST_RTSP_STS_INTERNAL_SERVER_ERROR, + RTSPStatusCode::NotImplemented => ffi::GST_RTSP_STS_NOT_IMPLEMENTED, + RTSPStatusCode::BadGateway => ffi::GST_RTSP_STS_BAD_GATEWAY, + RTSPStatusCode::ServiceUnavailable => ffi::GST_RTSP_STS_SERVICE_UNAVAILABLE, + RTSPStatusCode::GatewayTimeout => ffi::GST_RTSP_STS_GATEWAY_TIMEOUT, + RTSPStatusCode::RtspVersionNotSupported => ffi::GST_RTSP_STS_RTSP_VERSION_NOT_SUPPORTED, + RTSPStatusCode::OptionNotSupported => ffi::GST_RTSP_STS_OPTION_NOT_SUPPORTED, + RTSPStatusCode::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPStatusCode { + fn from_glib(value: ffi::GstRTSPStatusCode) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPStatusCode::Invalid, + 100 => RTSPStatusCode::Continue, + 200 => RTSPStatusCode::Ok, + 201 => RTSPStatusCode::Created, + 250 => RTSPStatusCode::LowOnStorage, + 300 => RTSPStatusCode::MultipleChoices, + 301 => RTSPStatusCode::MovedPermanently, + 302 => RTSPStatusCode::MoveTemporarily, + 303 => RTSPStatusCode::SeeOther, + 304 => RTSPStatusCode::NotModified, + 305 => RTSPStatusCode::UseProxy, + 400 => RTSPStatusCode::BadRequest, + 401 => RTSPStatusCode::Unauthorized, + 402 => RTSPStatusCode::PaymentRequired, + 403 => RTSPStatusCode::Forbidden, + 404 => RTSPStatusCode::NotFound, + 405 => RTSPStatusCode::MethodNotAllowed, + 406 => RTSPStatusCode::NotAcceptable, + 407 => RTSPStatusCode::ProxyAuthRequired, + 408 => RTSPStatusCode::RequestTimeout, + 410 => RTSPStatusCode::Gone, + 411 => RTSPStatusCode::LengthRequired, + 412 => RTSPStatusCode::PreconditionFailed, + 413 => RTSPStatusCode::RequestEntityTooLarge, + 414 => RTSPStatusCode::RequestUriTooLarge, + 415 => RTSPStatusCode::UnsupportedMediaType, + 451 => RTSPStatusCode::ParameterNotUnderstood, + 452 => RTSPStatusCode::ConferenceNotFound, + 453 => RTSPStatusCode::NotEnoughBandwidth, + 454 => RTSPStatusCode::SessionNotFound, + 455 => RTSPStatusCode::MethodNotValidInThisState, + 456 => RTSPStatusCode::HeaderFieldNotValidForResource, + 457 => RTSPStatusCode::InvalidRange, + 458 => RTSPStatusCode::ParameterIsReadonly, + 459 => RTSPStatusCode::AggregateOperationNotAllowed, + 460 => RTSPStatusCode::OnlyAggregateOperationAllowed, + 461 => RTSPStatusCode::UnsupportedTransport, + 462 => RTSPStatusCode::DestinationUnreachable, + 463 => RTSPStatusCode::KeyManagementFailure, + 500 => RTSPStatusCode::InternalServerError, + 501 => RTSPStatusCode::NotImplemented, + 502 => RTSPStatusCode::BadGateway, + 503 => RTSPStatusCode::ServiceUnavailable, + 504 => RTSPStatusCode::GatewayTimeout, + 505 => RTSPStatusCode::RtspVersionNotSupported, + 551 => RTSPStatusCode::OptionNotSupported, + value => RTSPStatusCode::__Unknown(value), + } + } +} + +impl StaticType for RTSPStatusCode { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_status_code_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPStatusCode { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPStatusCode { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for RTSPStatusCode { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum RTSPTimeType { + Seconds, + Now, + End, + Frames, + Utc, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RTSPTimeType { + type GlibType = ffi::GstRTSPTimeType; + + fn to_glib(&self) -> ffi::GstRTSPTimeType { + match *self { + RTSPTimeType::Seconds => ffi::GST_RTSP_TIME_SECONDS, + RTSPTimeType::Now => ffi::GST_RTSP_TIME_NOW, + RTSPTimeType::End => ffi::GST_RTSP_TIME_END, + RTSPTimeType::Frames => ffi::GST_RTSP_TIME_FRAMES, + RTSPTimeType::Utc => ffi::GST_RTSP_TIME_UTC, + RTSPTimeType::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RTSPTimeType { + fn from_glib(value: ffi::GstRTSPTimeType) -> Self { + skip_assert_initialized!(); + match value { + 0 => RTSPTimeType::Seconds, + 1 => RTSPTimeType::Now, + 2 => RTSPTimeType::End, + 3 => RTSPTimeType::Frames, + 4 => RTSPTimeType::Utc, + value => RTSPTimeType::__Unknown(value), + } + } +} + +impl StaticType for RTSPTimeType { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_time_type_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPTimeType { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPTimeType { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for RTSPTimeType { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + diff --git a/gstreamer-rtsp/src/auto/flags.rs b/gstreamer-rtsp/src/auto/flags.rs new file mode 100644 index 000000000..71c679f1d --- /dev/null +++ b/gstreamer-rtsp/src/auto/flags.rs @@ -0,0 +1,274 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::StaticType; +use glib::Type; +use glib::translate::*; +use glib::value::FromValue; +use glib::value::FromValueOptional; +use glib::value::SetValue; +use glib::value::Value; +use gobject_ffi; + +bitflags! { + pub struct RTSPEvent: u32 { + const READ = 1; + const WRITE = 2; + } +} + +#[doc(hidden)] +impl ToGlib for RTSPEvent { + type GlibType = ffi::GstRTSPEvent; + + fn to_glib(&self) -> ffi::GstRTSPEvent { + ffi::GstRTSPEvent::from_bits_truncate(self.bits()) + } +} + +#[doc(hidden)] +impl FromGlib for RTSPEvent { + fn from_glib(value: ffi::GstRTSPEvent) -> RTSPEvent { + skip_assert_initialized!(); + RTSPEvent::from_bits_truncate(value.bits()) + } +} + +impl StaticType for RTSPEvent { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_event_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPEvent { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPEvent { + unsafe fn from_value(value: &Value) -> Self { + from_glib(ffi::GstRTSPEvent::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0))) + } +} + +impl SetValue for RTSPEvent { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits()) + } +} + +bitflags! { + pub struct RTSPLowerTrans: u32 { + const UNKNOWN = 0; + const UDP = 1; + const UDP_MCAST = 2; + const TCP = 4; + const HTTP = 16; + const TLS = 32; + } +} + +#[doc(hidden)] +impl ToGlib for RTSPLowerTrans { + type GlibType = ffi::GstRTSPLowerTrans; + + fn to_glib(&self) -> ffi::GstRTSPLowerTrans { + ffi::GstRTSPLowerTrans::from_bits_truncate(self.bits()) + } +} + +#[doc(hidden)] +impl FromGlib for RTSPLowerTrans { + fn from_glib(value: ffi::GstRTSPLowerTrans) -> RTSPLowerTrans { + skip_assert_initialized!(); + RTSPLowerTrans::from_bits_truncate(value.bits()) + } +} + +impl StaticType for RTSPLowerTrans { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_lower_trans_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPLowerTrans { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPLowerTrans { + unsafe fn from_value(value: &Value) -> Self { + from_glib(ffi::GstRTSPLowerTrans::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0))) + } +} + +impl SetValue for RTSPLowerTrans { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits()) + } +} + +bitflags! { + pub struct RTSPMethod: u32 { + const INVALID = 0; + const DESCRIBE = 1; + const ANNOUNCE = 2; + const GET_PARAMETER = 4; + const OPTIONS = 8; + const PAUSE = 16; + const PLAY = 32; + const RECORD = 64; + const REDIRECT = 128; + const SETUP = 256; + const SET_PARAMETER = 512; + const TEARDOWN = 1024; + const GET = 2048; + const POST = 4096; + } +} + +#[doc(hidden)] +impl ToGlib for RTSPMethod { + type GlibType = ffi::GstRTSPMethod; + + fn to_glib(&self) -> ffi::GstRTSPMethod { + ffi::GstRTSPMethod::from_bits_truncate(self.bits()) + } +} + +#[doc(hidden)] +impl FromGlib for RTSPMethod { + fn from_glib(value: ffi::GstRTSPMethod) -> RTSPMethod { + skip_assert_initialized!(); + RTSPMethod::from_bits_truncate(value.bits()) + } +} + +impl StaticType for RTSPMethod { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_method_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPMethod { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPMethod { + unsafe fn from_value(value: &Value) -> Self { + from_glib(ffi::GstRTSPMethod::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0))) + } +} + +impl SetValue for RTSPMethod { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits()) + } +} + +bitflags! { + pub struct RTSPProfile: u32 { + const UNKNOWN = 0; + const AVP = 1; + const SAVP = 2; + const AVPF = 4; + const SAVPF = 8; + } +} + +#[doc(hidden)] +impl ToGlib for RTSPProfile { + type GlibType = ffi::GstRTSPProfile; + + fn to_glib(&self) -> ffi::GstRTSPProfile { + ffi::GstRTSPProfile::from_bits_truncate(self.bits()) + } +} + +#[doc(hidden)] +impl FromGlib for RTSPProfile { + fn from_glib(value: ffi::GstRTSPProfile) -> RTSPProfile { + skip_assert_initialized!(); + RTSPProfile::from_bits_truncate(value.bits()) + } +} + +impl StaticType for RTSPProfile { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_profile_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPProfile { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPProfile { + unsafe fn from_value(value: &Value) -> Self { + from_glib(ffi::GstRTSPProfile::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0))) + } +} + +impl SetValue for RTSPProfile { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits()) + } +} + +bitflags! { + pub struct RTSPTransMode: u32 { + const UNKNOWN = 0; + const RTP = 1; + const RDT = 2; + } +} + +#[doc(hidden)] +impl ToGlib for RTSPTransMode { + type GlibType = ffi::GstRTSPTransMode; + + fn to_glib(&self) -> ffi::GstRTSPTransMode { + ffi::GstRTSPTransMode::from_bits_truncate(self.bits()) + } +} + +#[doc(hidden)] +impl FromGlib for RTSPTransMode { + fn from_glib(value: ffi::GstRTSPTransMode) -> RTSPTransMode { + skip_assert_initialized!(); + RTSPTransMode::from_bits_truncate(value.bits()) + } +} + +impl StaticType for RTSPTransMode { + fn static_type() -> Type { + unsafe { from_glib(ffi::gst_rtsp_trans_mode_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for RTSPTransMode { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for RTSPTransMode { + unsafe fn from_value(value: &Value) -> Self { + from_glib(ffi::GstRTSPTransMode::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0))) + } +} + +impl SetValue for RTSPTransMode { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits()) + } +} + diff --git a/gstreamer-rtsp/src/auto/mod.rs b/gstreamer-rtsp/src/auto/mod.rs new file mode 100644 index 000000000..6634c037b --- /dev/null +++ b/gstreamer-rtsp/src/auto/mod.rs @@ -0,0 +1,31 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +mod r_t_s_p_auth_param; +pub use self::r_t_s_p_auth_param::RTSPAuthParam; + +mod r_t_s_p_url; +pub use self::r_t_s_p_url::RTSPUrl; + +mod enums; +pub use self::enums::RTSPAuthMethod; +pub use self::enums::RTSPFamily; +pub use self::enums::RTSPHeaderField; +pub use self::enums::RTSPMsgType; +pub use self::enums::RTSPRangeUnit; +pub use self::enums::RTSPResult; +pub use self::enums::RTSPState; +pub use self::enums::RTSPStatusCode; +pub use self::enums::RTSPTimeType; + +mod flags; +pub use self::flags::RTSPEvent; +pub use self::flags::RTSPLowerTrans; +pub use self::flags::RTSPMethod; +pub use self::flags::RTSPProfile; +pub use self::flags::RTSPTransMode; + +#[doc(hidden)] +pub mod traits { +} diff --git a/gstreamer-rtsp/src/auto/r_t_s_p_auth_param.rs b/gstreamer-rtsp/src/auto/r_t_s_p_auth_param.rs new file mode 100644 index 000000000..019ffcbd1 --- /dev/null +++ b/gstreamer-rtsp/src/auto/r_t_s_p_auth_param.rs @@ -0,0 +1,22 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct RTSPAuthParam(Boxed); + + match fn { + copy => |ptr| ffi::gst_rtsp_auth_param_copy(mut_override(ptr)), + free => |ptr| ffi::gst_rtsp_auth_param_free(ptr), + get_type => || ffi::gst_rtsp_auth_param_get_type(), + } +} + +unsafe impl Send for RTSPAuthParam {} diff --git a/gstreamer-rtsp/src/auto/r_t_s_p_url.rs b/gstreamer-rtsp/src/auto/r_t_s_p_url.rs new file mode 100644 index 000000000..b05d40995 --- /dev/null +++ b/gstreamer-rtsp/src/auto/r_t_s_p_url.rs @@ -0,0 +1,52 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use RTSPResult; +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct RTSPUrl(Boxed); + + match fn { + copy => |ptr| ffi::gst_rtsp_url_copy(mut_override(ptr)), + free => |ptr| ffi::gst_rtsp_url_free(ptr), + get_type => || ffi::gst_rtsp_url_get_type(), + } +} + +impl RTSPUrl { + pub fn decode_path_components(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_url_decode_path_components(self.to_glib_none().0)) + } + } + + pub fn get_request_uri(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_rtsp_url_get_request_uri(self.to_glib_none().0)) + } + } + + pub fn set_port(&mut self, port: u16) -> RTSPResult { + unsafe { + from_glib(ffi::gst_rtsp_url_set_port(self.to_glib_none_mut().0, port)) + } + } + + pub fn parse(urlstr: &str) -> (RTSPResult, RTSPUrl) { + assert_initialized_main_thread!(); + unsafe { + let mut url = ptr::null_mut(); + let ret = from_glib(ffi::gst_rtsp_url_parse(urlstr.to_glib_none().0, &mut url)); + (ret, from_glib_full(url)) + } + } +} + +unsafe impl Send for RTSPUrl {} diff --git a/gstreamer-rtsp/src/lib.rs b/gstreamer-rtsp/src/lib.rs new file mode 100644 index 000000000..213618661 --- /dev/null +++ b/gstreamer-rtsp/src/lib.rs @@ -0,0 +1,52 @@ +// Copyright (C) 2018 Mathieu Duponchelle +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[macro_use] +extern crate bitflags; +extern crate libc; + +#[macro_use] +extern crate glib; +extern crate glib_sys as glib_ffi; +extern crate gobject_sys as gobject_ffi; +extern crate gstreamer as gst; +extern crate gstreamer_sys as gst_ffi; +extern crate gstreamer_sdp as gst_sdp; +extern crate gstreamer_sdp_sys as gst_sdp_ffi; +extern crate gstreamer_rtsp_sys as ffi; + +macro_rules! assert_initialized_main_thread { + () => ( + if unsafe {::gst_ffi::gst_is_initialized()} != ::glib_ffi::GTRUE { + panic!("GStreamer has not been initialized. Call `gst::init` first."); + } + ) +} + +macro_rules! skip_assert_initialized { + () => ( + ) +} + +pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; + +#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] +#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] +#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] +#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +mod auto; +pub use auto::*; + +// Re-export all the traits in a prelude module, so that applications +// can always "use gst::prelude::*" without getting conflicts +pub mod prelude { + pub use glib::prelude::*; + pub use gst::prelude::*; + + pub use auto::traits::*; +} diff --git a/gstreamer-sdp/CHANGELOG.md b/gstreamer-sdp/CHANGELOG.md new file mode 100644 index 000000000..614f2ff50 --- /dev/null +++ b/gstreamer-sdp/CHANGELOG.md @@ -0,0 +1,218 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html), +specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field). + +## [0.10.1] - 2018-01-03 +### Fixed +- Don't require &mut self for TagSetterExtManual::add() + +### Added +- A TagSetter example application +- Bindings for gst_video::convert_sample() and ::convert_sample_async() +- Bindings for gst_video::VideoRectangle +- Debug impl for Sample and ::with_buffer_list() constructor +- A borrowing version of VideoFrame: VideoFrameRef +- Bindings for GstVideoFilter + +### Changed +- Deprecated Sample::get_info() in favour of ::get_structure() +- Player has gst::Object as another parent class now + +## [0.10.0] - 2017-12-22 +### Fixed +- Various clippy warnings +- Memory leak of the tag list in Toc::merge_tags() +- Property getters use Values of the correct type +- Event::get_structure(), Message::get_structure() and + Query::get_structure() can return None for the structure +- Various other nullability fixes all over the API, changing functions to + accept Option<> or returning Option<>, or only plain types +- Functions taking paths/filenames now actually take Paths instead of &strs +- Element::remove_pad() is not giving away a new reference to the pad + anymore, which caused a memory leak of all pads ever removed +- Precision handling in ClockTime's Display impl +- Video/AudioInfo are only Send, not Sync + +### Added +- Various enums now also derive useful traits like Copy, Clone and Hash in + addition to PartialEq, Eq and Debug +- TagList::merge() and insert() for combining tag lists +- EventType gained many useful functions to work with event types and + a PartialOrd impl to check expected event order of event types where it matters +- MessageRef/EventRef/QueryRef implement ToOwned +- Bindings for Registry and PluginFeature +- Event::set_running_time_offset() for adjusting the offset while events + pass through the pipeline +- Event/Message GroupIds and Seqnums now have a newtype wrapper around u32 + instead of the plain value, making usage of them slightly more typesafe. + Also add an "invalid" value for both, as exists in latest GStreamer now. +- FormattedValue, GenericFormattedValue and related types were + implemented now, which allows more convenient and type-safe usage of + formatted values (time, bytes, etc) +- Bindings for force-keyunit and still-frame events were added +- MappedBuffer/BufferMap now implement various other useful traits, including + AsRef<[u8]>, AsMut, Deref, DerefMut, Debug, PartialEq and Eq +- Add VideoMultiviewFramePacking enum, and use it in Player +- Bindings for the GStreamer Net library, including PTP/NTP/network client + clocks and the GStreamer NetClock provider for network synchronization of + pipelines +- IteratorError implements std::error:Error +- Plugin::add_dependency() and ::add_dependency_simple() was added +- Rank and TypeFindProbability implement PartialOrd/Ord now +- Bindings for TypeFind, TypeFindFactory and the typefind helpers +- StreamCollection::iter() for iterating over all contained streams +- ErrorMessage type that can be used e.g. in a Result for passing an error + message from somewhere to upper layers to then be posted on an element the + same way gst_element_error!() would've done + +### Changed +- Sample::new(), TagList::add(), Structure::set() and similar + functions take the values (ToSendValue impls) by reference instead of value. + They were not consumed by the function before. +- The Debug impls of various types, including Event/Buffer/Message/Query/Structure + were improved to print all the fields, similar to what GST_PTR_FORMAT would + do in C +- Switched to lazy_static 1.0 +- Gap event and Duration tag are using ClockTimes now, as well as various + Player signals +- Segment is now based on a generic type FormattedSegment that can + take any format (time, bytes, etc) or a GenericFormattedValue for more + type-safety and convenience. Also functions for "casting" between a generic + segment and a segment with a specific format exist on this now +- AppSrc and AppSink now have a builder for the callbacks, making it + unnecessary to always provide all callbacks even if only one is actually + needed +- Various functions that returned bool for errors, are now returning a Result +- Player configuration is now a custom type with more convenient API +- Player VideoInfo uses a Fraction instead of (u32,u32) for the framerate and + pixel-aspect-ratio +- VideoFrame API has more consistent API between writable and read-only + variants +- Buffer::copy_into() was added, and ::copy_region() now takes a + BufferCopyFlags parameter instead of always using the default flags +- ChildProxy::set_child_property() takes a &ToValue now to follow the API of + Object::set_property() and improve usability +- Proxy/GhostPad default pad functions use the correct specific pad type now + instead of a generic Pad +- Bus::add_signal_watch_full() takes a Priority for the priority instead of u32 +- Clock::(un)adjust_with_calibration() takes no clock parameter anymore + +### Removed +- FormatValue was removed in favour of GenericFormattedValue and the + connected traits and specific format impls + +## [0.9.1] - 2017-11-26 +### Fixed +- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`, + `PadLinkError`/`PadLinkSuccess` too + +## [0.9.0] - 2017-11-26 +### Added +- Bindings for (outputting to) the GStreamer logging system +- Bindings for the GStreamer base library +- Bindings for all the `Pad` functions to override pad behaviour, and pad task + functions +- Bindings for `StaticCaps` and `StaticPadTemplate` +- Bindings for `deep-notify` signal on `Object` +- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them + from an element with context information (file, line, module, etc.) similar + to the C `GST_ELEMENT_ERROR` macro +- Support for setting custom fields in `Messages`/`Events` during construction +- Support for creating Buffers out of anything that is `AsRef<[u8]>` or + `AsMut<[u8]>` +- Support for using the `Read` trait on `Adapter` +- Functions for getting all sink/src/all pads of an `Element`, and all children + of a `Bin` +- Builder for `Caps` and `Structures` in addition to the existing functions +- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler` +- Rust ports of the basic tutorials 1 to 8 from + https://gstreamer.freedesktop.org/documentation/tutorials/ +- "Getting started" and "Installation" sections to the README.md +- "dox" feature for generating documentation for all available configurations + +### Fixed +- `StackTraceFlags` are only available since 1.12 +- Worked around macOS requiring a `NSRunLoop` running on the main thread in all + examples and tutorials, to be able to show a window or anything else + +### Changed +- `ClockTime` is now a wrapper around `Option` to handle the + `CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic + and other traits as needed and ensures that no accidential calculations with + `CLOCK_TIME_NONE` can happen +- "Values with format", like in `Duration`/`Position`/`Convert` queries or + `Seek` events now return a `FormatValue` type. This contains the actual + `Format` together with the value and does any required conversions. This + also makes it harder to accidentially mix e.g. values in bytes and time +- `PadProbeId` does not implement `Clone`/`Copy` anymore +- Property notify watches return a custom type instead of ulong +- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of + `glib::Error` now. Using arbitrary ones does not work +- `Iterator` bindings were completely rewritten and provide the item type as a + generic type parameter now, greatly simplifying its usage +- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and + `Structures`, as their content must be possible to send to different threads + safely +- `Message::get_src()` can return `None` +- Allow `None` as `Caps` in `AppSrc`/`AppSink` +- Allow everything implementing `Into>` to be used as a pad name +- Moved `copy()` from `GstRc` directly to `MiniObject` +- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now + implement an `into_result()` function that splits them into a `Result` with + the good and bad cases. Also mark them as `#[must_use]` to make it harder to + accidentially ignore errors. +- Error enums implement the `Error` trait + +- Many examples use the `failure` crate for error handling now, cleaning up the + error handling code quite a bit +- Lots of other code cleanup, compiler/clippy warning cleanup, etc. + +## [0.8.2] - 2017-11-11 +### Fixed +- Implement StaticType of BufferRef instead of Buffer. Buffer aka + GstRc already implements StaticType if BufferRef does, and + without this it was not possible to use Buffers in GValues. +- Free memory of the appsink/appsrc callbacks with the correct type. It was + crashing because of using the wrong type before. +- Fix documentation URLs in Cargo.toml. + +### Added +- Installation instructions and links to documentation for getting started to + README.md. + +## [0.8.1] - 2017-09-15 +### Added +- Implement Send+Sync for Query, Message and Event, and their corresponding + Ref types. + +### Fixed +- Constructor for gst_player::Player now works properly with GStreamer 1.12 + when passing a video renderer or signal dispatcher. There was a reference + counting bug. +- Instead of returning &'static references from functions, return references + with a generic, unbound lifetime instead. + See https://github.com/rust-lang/rust/pull/42417#issue-233404573 +- Various "unused external crate" warnings and clippy warnings everywhere. + +### Changed +- Remove Cargo.lock from GIT, it's not very useful for library crates. +- Run everything through latest rustfmt-nightly. +- Use while-let (instead of loop and if-let) and CLOCK_TIME_NONE (instead of + u64::MAX) in the examples. + +## [0.8.0] - 2017-08-31 + +- Initial release of the autogenerated GStreamer bindings. Older versions + (< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs). + The API of the two is incompatible. + +[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...HEAD +[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1 +[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0 +[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1 +[0.9.0]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.9.0 +[0.8.2]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.8.2 +[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1 diff --git a/gstreamer-sdp/Cargo.toml b/gstreamer-sdp/Cargo.toml new file mode 100644 index 000000000..45e67af94 --- /dev/null +++ b/gstreamer-sdp/Cargo.toml @@ -0,0 +1,39 @@ +[package] +name = "gstreamer-sdp" +version = "0.11.0" +authors = ["Mathieu Duponchelle ", "Sebastian Dröge "] +categories = ["api-bindings", "multimedia"] +description = "Rust bindings for GStreamer Sdp library" +repository = "https://github.com/sdroege/gstreamer-rs" +license = "MIT/Apache-2.0" +readme = "README.md" +homepage = "https://gstreamer.freedesktop.org" +documentation = "https://sdroege.github.io/rustdoc/gstreamer/gstreamer_sdp" +keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"] +build = "build.rs" + +[dependencies] +bitflags = "1.0" +libc = "0.2" +glib-sys = { git = "https://github.com/gtk-rs/sys" } +gobject-sys = { git = "https://github.com/gtk-rs/sys" } +gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } +gstreamer-sdp-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } +glib = { git = "https://github.com/gtk-rs/glib" } +gstreamer = { path = "../gstreamer" } + +[build-dependencies.rustdoc-stripper] +version = "0.1" +optional = true + +[features] +v1_8_1 = ["gstreamer-sdp-sys/v1_8_1"] +v1_10 = ["gstreamer-sys/v1_10", "gstreamer-sdp-sys/v1_10", "v1_8_1"] +v1_12 = ["gstreamer-sys/v1_12", "gstreamer-sdp-sys/v1_12", "v1_10"] +embed-lgpl-docs = ["rustdoc-stripper"] +purge-lgpl-docs = ["rustdoc-stripper"] +dox = ["gstreamer-sdp-sys/dox", "glib/dox", "gstreamer/dox"] +default-features = [] + +[badges] +travis-ci = { repository = "sdroege/gstreamer-rs", branch = "master" } diff --git a/gstreamer-sdp/LICENSE-APACHE b/gstreamer-sdp/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/gstreamer-sdp/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/gstreamer-sdp/LICENSE-MIT b/gstreamer-sdp/LICENSE-MIT new file mode 100644 index 000000000..31aa79387 --- /dev/null +++ b/gstreamer-sdp/LICENSE-MIT @@ -0,0 +1,23 @@ +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. diff --git a/gstreamer-sdp/README.md b/gstreamer-sdp/README.md new file mode 100644 index 000000000..2fd4bf995 --- /dev/null +++ b/gstreamer-sdp/README.md @@ -0,0 +1,170 @@ +# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-sdp.svg)](https://crates.io/crates/gstreamer-sdp) [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs) + +[GStreamer](https://gstreamer.freedesktop.org/) (Sdp library) bindings for Rust. +Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/). + +These bindings are providing a safe API that can be used to interface with +GStreamer, e.g. for writing GStreamer-based applications. + +For background and motivation, see the [announcement blogpost](https://coaxion.net/blog/2017/07/writing-gstreamer-applications-in-rust/). + +The bindings (since 0.8.0) are autogenerated with [gir](https://github.com/gtk-rs/gir/) +based on the [GObject-Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection/) +API metadata provided by the GStreamer project. Older versions before 0.8.0 were manually +written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs). +The API of the two is incompatible. + +A crate for writing GStreamer plugins in Rust can be found here: https://github.com/sdroege/gst-plugin-rs + +## Table of Contents +1. [Installation](#installation) + 1. [Linux/BSDs](#installation-linux) + 1. [macOS](#installation-macos) + 1. [Windows](#installation-windows) +1. [Getting Started](#getting-started) +1. [License](#license) +1. [Contribution](#contribution) + + + +## Installation + +To build the GStreamer bindings or anything depending on them, you need to +have at least GStreamer 1.8 and gst-plugins-base 1.8 installed. In addition, +some of the examples/tutorials require various GStreamer plugins to be +available, which can be found in gst-plugins-base, gst-plugins-good, +gst-plugins-bad, gst-plugins-ugly and/or gst-libav. + + + +### Linux/BSDs + +You need to install the above mentioned packages with your distributions +package manager, or build them from source. + +On Debian/Ubuntu they can be installed with + +``` +$ apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \ + gstreamer1.0-libav +``` + +Package names on other distributions should be similar. +Please submit a pull request with instructions for yours. + + + +### macOS + +You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or +by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/) +provided by the GStreamer project. + +#### Homebrew + +``` +$ brew install gstreamer gst-plugins-base gst-plugins-good \ + gst-plugins-bad gst-plugins-ugly gst-libav +``` + +#### GStreamer Binaries + +You need to download the *two* `.pkg` files from the GStreamer website and +install them, e.g. `gstreamer-1.0-1.12.3-x86_64.pkg` and +`gstreamer-1.0-devel-1.12.3-x86_64.pkg`. + +After installation, you also need to install `pkg-config` (e.g. via Homebrew) +and set the `PKG_CONFIG_PATH` environment variable + +``` +$ export PKG_CONFIG_PATH="/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" +``` + + + +### Windows + +You can install GStreamer and the plugins via [MSYS2](http://www.msys2.org/) +with `pacman` or by installing the +[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by +the GStreamer project. + +#### MSYS2 / pacman + +``` +$ pacman -S pkg-config mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base \ + mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad \ + mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav +``` + +#### GStreamer Binaries + +You need to download the *two* `.msi` files for your platform from the +GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.12.3.msi` and +`gstreamer-1.0-devel-x86_64-1.12.3.msi`. + +After installation, you also need to install `pkg-config` (e.g. via MSYS2 or +from [here](https://sourceforge.net/projects/pkgconfiglite/)) +and set the `PKG_CONFIG_PATH` environment variable + +``` +$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" +``` + + + +## Getting Started + +The API reference can be found +[here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/), however it is +only the Rust API reference and does not explain any of the concepts. + +For getting started with GStreamer development, the best would be to follow +the [documentation](https://gstreamer.freedesktop.org/documentation/) on the +GStreamer website, especially the [Application Development +Manual](https://gstreamer.freedesktop.org/documentation/application-development/). +While being C-centric, it explains all the fundamental concepts of GStreamer +and the code examples should be relatively easily translatable to Rust. The +API is basically the same, function/struct names are the same and everything +is only more convenient (hopefully) and safer. + +In addition there are +[tutorials](https://gstreamer.freedesktop.org/documentation/tutorials/) on the +GStreamer website. Many of them were ported to Rust already and the code can +be found in the +[tutorials](https://github.com/sdroege/gstreamer-rs/tree/master/tutorials) +directory. + +Some further examples for various aspects of GStreamer and how to use it from +Rust can be found in the +[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples) +directory. + + + +## LICENSE + +gstreamer-rs and all crates contained in here are licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) + +at your option. + +GStreamer itself is licensed under the Lesser General Public License version +2.1 or (at your option) any later version: +https://www.gnu.org/licenses/lgpl-2.1.html + + + +## Contribution + +Any kinds of contributions are welcome as a pull request. + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in gstreamer-rs by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. diff --git a/gstreamer-sdp/build.rs b/gstreamer-sdp/build.rs new file mode 100644 index 000000000..b29dd5af9 --- /dev/null +++ b/gstreamer-sdp/build.rs @@ -0,0 +1,34 @@ +fn main() { + manage_docs(); +} + +#[cfg(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs"))] +fn manage_docs() { + extern crate stripper_lib; + use std::io; + + let path = "src"; + let ignores: &[&str] = &[]; + + stripper_lib::loop_over_files( + path.as_ref(), + &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), + &ignores, + false, + ); + + #[cfg(feature = "embed-lgpl-docs")] + { + let docs = include_str!("../docs/gstreamer-sdp/docs.md"); + let mut infos = stripper_lib::parse_cmts(docs.lines(), true); + stripper_lib::loop_over_files( + path.as_ref(), + &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), + &ignores, + false, + ); + } +} + +#[cfg(not(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")))] +fn manage_docs() {} diff --git a/gstreamer-sdp/src/auto/enums.rs b/gstreamer-sdp/src/auto/enums.rs new file mode 100644 index 000000000..aa9181b9d --- /dev/null +++ b/gstreamer-sdp/src/auto/enums.rs @@ -0,0 +1,529 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::translate::*; + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYCacheType { + None, + Always, + ForCsb, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYCacheType { + type GlibType = ffi::GstMIKEYCacheType; + + fn to_glib(&self) -> ffi::GstMIKEYCacheType { + match *self { + MIKEYCacheType::None => ffi::GST_MIKEY_CACHE_NONE, + MIKEYCacheType::Always => ffi::GST_MIKEY_CACHE_ALWAYS, + MIKEYCacheType::ForCsb => ffi::GST_MIKEY_CACHE_FOR_CSB, + MIKEYCacheType::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYCacheType { + fn from_glib(value: ffi::GstMIKEYCacheType) -> Self { + skip_assert_initialized!(); + match value { + 0 => MIKEYCacheType::None, + 1 => MIKEYCacheType::Always, + 2 => MIKEYCacheType::ForCsb, + value => MIKEYCacheType::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYEncAlg { + Null, + AesCm128, + AesKw128, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYEncAlg { + type GlibType = ffi::GstMIKEYEncAlg; + + fn to_glib(&self) -> ffi::GstMIKEYEncAlg { + match *self { + MIKEYEncAlg::Null => ffi::GST_MIKEY_ENC_NULL, + MIKEYEncAlg::AesCm128 => ffi::GST_MIKEY_ENC_AES_CM_128, + MIKEYEncAlg::AesKw128 => ffi::GST_MIKEY_ENC_AES_KW_128, + MIKEYEncAlg::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYEncAlg { + fn from_glib(value: ffi::GstMIKEYEncAlg) -> Self { + skip_assert_initialized!(); + match value { + 0 => MIKEYEncAlg::Null, + 1 => MIKEYEncAlg::AesCm128, + 2 => MIKEYEncAlg::AesKw128, + value => MIKEYEncAlg::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYKVType { + Null, + Spi, + Interval, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYKVType { + type GlibType = ffi::GstMIKEYKVType; + + fn to_glib(&self) -> ffi::GstMIKEYKVType { + match *self { + MIKEYKVType::Null => ffi::GST_MIKEY_KV_NULL, + MIKEYKVType::Spi => ffi::GST_MIKEY_KV_SPI, + MIKEYKVType::Interval => ffi::GST_MIKEY_KV_INTERVAL, + MIKEYKVType::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYKVType { + fn from_glib(value: ffi::GstMIKEYKVType) -> Self { + skip_assert_initialized!(); + match value { + 0 => MIKEYKVType::Null, + 1 => MIKEYKVType::Spi, + 2 => MIKEYKVType::Interval, + value => MIKEYKVType::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYKeyDataType { + Tgk, + Tek, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYKeyDataType { + type GlibType = ffi::GstMIKEYKeyDataType; + + fn to_glib(&self) -> ffi::GstMIKEYKeyDataType { + match *self { + MIKEYKeyDataType::Tgk => ffi::GST_MIKEY_KD_TGK, + MIKEYKeyDataType::Tek => ffi::GST_MIKEY_KD_TEK, + MIKEYKeyDataType::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYKeyDataType { + fn from_glib(value: ffi::GstMIKEYKeyDataType) -> Self { + skip_assert_initialized!(); + match value { + 0 => MIKEYKeyDataType::Tgk, + 2 => MIKEYKeyDataType::Tek, + value => MIKEYKeyDataType::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYMacAlg { + Null, + HmacSha1160, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYMacAlg { + type GlibType = ffi::GstMIKEYMacAlg; + + fn to_glib(&self) -> ffi::GstMIKEYMacAlg { + match *self { + MIKEYMacAlg::Null => ffi::GST_MIKEY_MAC_NULL, + MIKEYMacAlg::HmacSha1160 => ffi::GST_MIKEY_MAC_HMAC_SHA_1_160, + MIKEYMacAlg::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYMacAlg { + fn from_glib(value: ffi::GstMIKEYMacAlg) -> Self { + skip_assert_initialized!(); + match value { + 0 => MIKEYMacAlg::Null, + 1 => MIKEYMacAlg::HmacSha1160, + value => MIKEYMacAlg::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYMapType { + MikeyMapTypeSrtp, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYMapType { + type GlibType = ffi::GstMIKEYMapType; + + fn to_glib(&self) -> ffi::GstMIKEYMapType { + match *self { + MIKEYMapType::MikeyMapTypeSrtp => ffi::GST_MIKEY_MAP_TYPE_SRTP, + MIKEYMapType::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYMapType { + fn from_glib(value: ffi::GstMIKEYMapType) -> Self { + skip_assert_initialized!(); + match value { + 0 => MIKEYMapType::MikeyMapTypeSrtp, + value => MIKEYMapType::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYPRFFunc { + MikeyPrfMikey1, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYPRFFunc { + type GlibType = ffi::GstMIKEYPRFFunc; + + fn to_glib(&self) -> ffi::GstMIKEYPRFFunc { + match *self { + MIKEYPRFFunc::MikeyPrfMikey1 => ffi::GST_MIKEY_PRF_MIKEY_1, + MIKEYPRFFunc::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYPRFFunc { + fn from_glib(value: ffi::GstMIKEYPRFFunc) -> Self { + skip_assert_initialized!(); + match value { + 0 => MIKEYPRFFunc::MikeyPrfMikey1, + value => MIKEYPRFFunc::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYPayloadType { + Last, + Kemac, + Pke, + Dh, + Sign, + T, + Id, + Cert, + Chash, + V, + Sp, + Rand, + Err, + KeyData, + GenExt, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYPayloadType { + type GlibType = ffi::GstMIKEYPayloadType; + + fn to_glib(&self) -> ffi::GstMIKEYPayloadType { + match *self { + MIKEYPayloadType::Last => ffi::GST_MIKEY_PT_LAST, + MIKEYPayloadType::Kemac => ffi::GST_MIKEY_PT_KEMAC, + MIKEYPayloadType::Pke => ffi::GST_MIKEY_PT_PKE, + MIKEYPayloadType::Dh => ffi::GST_MIKEY_PT_DH, + MIKEYPayloadType::Sign => ffi::GST_MIKEY_PT_SIGN, + MIKEYPayloadType::T => ffi::GST_MIKEY_PT_T, + MIKEYPayloadType::Id => ffi::GST_MIKEY_PT_ID, + MIKEYPayloadType::Cert => ffi::GST_MIKEY_PT_CERT, + MIKEYPayloadType::Chash => ffi::GST_MIKEY_PT_CHASH, + MIKEYPayloadType::V => ffi::GST_MIKEY_PT_V, + MIKEYPayloadType::Sp => ffi::GST_MIKEY_PT_SP, + MIKEYPayloadType::Rand => ffi::GST_MIKEY_PT_RAND, + MIKEYPayloadType::Err => ffi::GST_MIKEY_PT_ERR, + MIKEYPayloadType::KeyData => ffi::GST_MIKEY_PT_KEY_DATA, + MIKEYPayloadType::GenExt => ffi::GST_MIKEY_PT_GEN_EXT, + MIKEYPayloadType::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYPayloadType { + fn from_glib(value: ffi::GstMIKEYPayloadType) -> Self { + skip_assert_initialized!(); + match value { + 0 => MIKEYPayloadType::Last, + 1 => MIKEYPayloadType::Kemac, + 2 => MIKEYPayloadType::Pke, + 3 => MIKEYPayloadType::Dh, + 4 => MIKEYPayloadType::Sign, + 5 => MIKEYPayloadType::T, + 6 => MIKEYPayloadType::Id, + 7 => MIKEYPayloadType::Cert, + 8 => MIKEYPayloadType::Chash, + 9 => MIKEYPayloadType::V, + 10 => MIKEYPayloadType::Sp, + 11 => MIKEYPayloadType::Rand, + 12 => MIKEYPayloadType::Err, + 20 => MIKEYPayloadType::KeyData, + 21 => MIKEYPayloadType::GenExt, + value => MIKEYPayloadType::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYSecProto { + MikeySecProtoSrtp, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYSecProto { + type GlibType = ffi::GstMIKEYSecProto; + + fn to_glib(&self) -> ffi::GstMIKEYSecProto { + match *self { + MIKEYSecProto::MikeySecProtoSrtp => ffi::GST_MIKEY_SEC_PROTO_SRTP, + MIKEYSecProto::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYSecProto { + fn from_glib(value: ffi::GstMIKEYSecProto) -> Self { + skip_assert_initialized!(); + match value { + 0 => MIKEYSecProto::MikeySecProtoSrtp, + value => MIKEYSecProto::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYSecSRTP { + EncAlg, + EncKeyLen, + AuthAlg, + AuthKeyLen, + SaltKeyLen, + Prf, + KeyDerivRate, + SrtpEnc, + SrtcpEnc, + FecOrder, + SrtpAuth, + AuthTagLen, + SrtpPrefixLen, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYSecSRTP { + type GlibType = ffi::GstMIKEYSecSRTP; + + fn to_glib(&self) -> ffi::GstMIKEYSecSRTP { + match *self { + MIKEYSecSRTP::EncAlg => ffi::GST_MIKEY_SP_SRTP_ENC_ALG, + MIKEYSecSRTP::EncKeyLen => ffi::GST_MIKEY_SP_SRTP_ENC_KEY_LEN, + MIKEYSecSRTP::AuthAlg => ffi::GST_MIKEY_SP_SRTP_AUTH_ALG, + MIKEYSecSRTP::AuthKeyLen => ffi::GST_MIKEY_SP_SRTP_AUTH_KEY_LEN, + MIKEYSecSRTP::SaltKeyLen => ffi::GST_MIKEY_SP_SRTP_SALT_KEY_LEN, + MIKEYSecSRTP::Prf => ffi::GST_MIKEY_SP_SRTP_PRF, + MIKEYSecSRTP::KeyDerivRate => ffi::GST_MIKEY_SP_SRTP_KEY_DERIV_RATE, + MIKEYSecSRTP::SrtpEnc => ffi::GST_MIKEY_SP_SRTP_SRTP_ENC, + MIKEYSecSRTP::SrtcpEnc => ffi::GST_MIKEY_SP_SRTP_SRTCP_ENC, + MIKEYSecSRTP::FecOrder => ffi::GST_MIKEY_SP_SRTP_FEC_ORDER, + MIKEYSecSRTP::SrtpAuth => ffi::GST_MIKEY_SP_SRTP_SRTP_AUTH, + MIKEYSecSRTP::AuthTagLen => ffi::GST_MIKEY_SP_SRTP_AUTH_TAG_LEN, + MIKEYSecSRTP::SrtpPrefixLen => ffi::GST_MIKEY_SP_SRTP_SRTP_PREFIX_LEN, + MIKEYSecSRTP::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYSecSRTP { + fn from_glib(value: ffi::GstMIKEYSecSRTP) -> Self { + skip_assert_initialized!(); + match value { + 0 => MIKEYSecSRTP::EncAlg, + 1 => MIKEYSecSRTP::EncKeyLen, + 2 => MIKEYSecSRTP::AuthAlg, + 3 => MIKEYSecSRTP::AuthKeyLen, + 4 => MIKEYSecSRTP::SaltKeyLen, + 5 => MIKEYSecSRTP::Prf, + 6 => MIKEYSecSRTP::KeyDerivRate, + 7 => MIKEYSecSRTP::SrtpEnc, + 8 => MIKEYSecSRTP::SrtcpEnc, + 9 => MIKEYSecSRTP::FecOrder, + 10 => MIKEYSecSRTP::SrtpAuth, + 11 => MIKEYSecSRTP::AuthTagLen, + 12 => MIKEYSecSRTP::SrtpPrefixLen, + value => MIKEYSecSRTP::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYTSType { + NtpUtc, + Ntp, + Counter, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYTSType { + type GlibType = ffi::GstMIKEYTSType; + + fn to_glib(&self) -> ffi::GstMIKEYTSType { + match *self { + MIKEYTSType::NtpUtc => ffi::GST_MIKEY_TS_TYPE_NTP_UTC, + MIKEYTSType::Ntp => ffi::GST_MIKEY_TS_TYPE_NTP, + MIKEYTSType::Counter => ffi::GST_MIKEY_TS_TYPE_COUNTER, + MIKEYTSType::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYTSType { + fn from_glib(value: ffi::GstMIKEYTSType) -> Self { + skip_assert_initialized!(); + match value { + 0 => MIKEYTSType::NtpUtc, + 1 => MIKEYTSType::Ntp, + 2 => MIKEYTSType::Counter, + value => MIKEYTSType::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum MIKEYType { + Invalid, + PskInit, + PskVerify, + PkInit, + PkVerify, + DhInit, + DhResp, + Error, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for MIKEYType { + type GlibType = ffi::GstMIKEYType; + + fn to_glib(&self) -> ffi::GstMIKEYType { + match *self { + MIKEYType::Invalid => ffi::GST_MIKEY_TYPE_INVALID, + MIKEYType::PskInit => ffi::GST_MIKEY_TYPE_PSK_INIT, + MIKEYType::PskVerify => ffi::GST_MIKEY_TYPE_PSK_VERIFY, + MIKEYType::PkInit => ffi::GST_MIKEY_TYPE_PK_INIT, + MIKEYType::PkVerify => ffi::GST_MIKEY_TYPE_PK_VERIFY, + MIKEYType::DhInit => ffi::GST_MIKEY_TYPE_DH_INIT, + MIKEYType::DhResp => ffi::GST_MIKEY_TYPE_DH_RESP, + MIKEYType::Error => ffi::GST_MIKEY_TYPE_ERROR, + MIKEYType::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for MIKEYType { + fn from_glib(value: ffi::GstMIKEYType) -> Self { + skip_assert_initialized!(); + match value { + -1 => MIKEYType::Invalid, + 0 => MIKEYType::PskInit, + 1 => MIKEYType::PskVerify, + 2 => MIKEYType::PkInit, + 3 => MIKEYType::PkVerify, + 4 => MIKEYType::DhInit, + 5 => MIKEYType::DhResp, + 6 => MIKEYType::Error, + value => MIKEYType::__Unknown(value), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum SDPResult { + Ok, + Einval, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for SDPResult { + type GlibType = ffi::GstSDPResult; + + fn to_glib(&self) -> ffi::GstSDPResult { + match *self { + SDPResult::Ok => ffi::GST_SDP_OK, + SDPResult::Einval => ffi::GST_SDP_EINVAL, + SDPResult::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for SDPResult { + fn from_glib(value: ffi::GstSDPResult) -> Self { + skip_assert_initialized!(); + match value { + 0 => SDPResult::Ok, + -1 => SDPResult::Einval, + value => SDPResult::__Unknown(value), + } + } +} + diff --git a/gstreamer-sdp/src/auto/flags.rs b/gstreamer-sdp/src/auto/flags.rs new file mode 100644 index 000000000..ea499f475 --- /dev/null +++ b/gstreamer-sdp/src/auto/flags.rs @@ -0,0 +1,7 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::translate::*; + diff --git a/gstreamer-sdp/src/auto/mod.rs b/gstreamer-sdp/src/auto/mod.rs new file mode 100644 index 000000000..b4dc81978 --- /dev/null +++ b/gstreamer-sdp/src/auto/mod.rs @@ -0,0 +1,22 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +mod enums; +pub use self::enums::MIKEYCacheType; +pub use self::enums::MIKEYEncAlg; +pub use self::enums::MIKEYKVType; +pub use self::enums::MIKEYKeyDataType; +pub use self::enums::MIKEYMacAlg; +pub use self::enums::MIKEYMapType; +pub use self::enums::MIKEYPRFFunc; +pub use self::enums::MIKEYPayloadType; +pub use self::enums::MIKEYSecProto; +pub use self::enums::MIKEYSecSRTP; +pub use self::enums::MIKEYTSType; +pub use self::enums::MIKEYType; +pub use self::enums::SDPResult; + +#[doc(hidden)] +pub mod traits { +} diff --git a/gstreamer-sdp/src/lib.rs b/gstreamer-sdp/src/lib.rs new file mode 100644 index 000000000..002e62977 --- /dev/null +++ b/gstreamer-sdp/src/lib.rs @@ -0,0 +1,40 @@ +// Copyright (C) 2017 Sebastian Dröge +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern crate bitflags; +extern crate libc; + +extern crate glib; +extern crate glib_sys as glib_ffi; +extern crate gobject_sys as gobject_ffi; +extern crate gstreamer as gst; +extern crate gstreamer_sys as gst_ffi; +extern crate gstreamer_sdp_sys as ffi; + +macro_rules! skip_assert_initialized { + () => ( + ) +} + +pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; + +#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] +#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] +#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] +#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +mod auto; +pub use auto::*; + +// Re-export all the traits in a prelude module, so that applications +// can always "use gst::prelude::*" without getting conflicts +pub mod prelude { + pub use glib::prelude::*; + pub use gst::prelude::*; + + pub use auto::traits::*; +}