| 1 |
/* gstreamermm - a C++ wrapper for gstreamer |
| 2 |
* |
| 3 |
* Copyright 2016 The gstreamermm Development Team |
| 4 |
* |
| 5 |
* This library is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU Lesser General Public |
| 7 |
* License as published by the Free Software Foundation; either |
| 8 |
* version 2.1 of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This library is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* Lesser General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU Lesser General Public |
| 16 |
* License along with this library; if not, write to the Free |
| 17 |
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#include <gstreamermm/systemclock.h> |
| 21 |
|
| 22 |
_DEFS(gstreamermm,gst) |
| 23 |
|
| 24 |
namespace Gst |
| 25 |
{ |
| 26 |
|
| 27 |
class Bus; |
| 28 |
|
| 29 |
/** Special clock that synchronizes to a remote time provider. |
| 30 |
* |
| 31 |
* Gst::NetClientClock implements a custom Gst::Clock that synchronizes its time |
| 32 |
* to a remote time provider such as Gst::NetTimeProvider. Gst::NtpClock |
| 33 |
* implements a Gst::Clock that synchronizes its time to a remote NTPv4 server. |
| 34 |
* |
| 35 |
* A new clock is created with create() or gst_ntp_clock_new(), which takes |
| 36 |
* the address and port of the remote time provider along with a name and an |
| 37 |
* initial time. |
| 38 |
* |
| 39 |
* This clock will poll the time provider and will update its calibration |
| 40 |
* parameters based on the local and remote observations. |
| 41 |
* |
| 42 |
* The "round-trip" property limits the maximum round trip packets can take. |
| 43 |
* |
| 44 |
* Various parameters of the clock can be configured with the parent Gst::Clock |
| 45 |
* "timeout", "window-size" and "window-threshold" object properties. |
| 46 |
* |
| 47 |
* A Gst::NetClientClock and Gst::NtpClock is typically set on a Gst::Pipeline with |
| 48 |
* Gst::Pipeline::use_clock(). |
| 49 |
* |
| 50 |
* If you set a Gst::Bus on the clock via the "bus" object property, it will |
| 51 |
* send Gst::MESSAGE_ELEMENT messages with an attached Gst::Structure containing |
| 52 |
* statistics about clock accuracy and network traffic. |
| 53 |
* |
| 54 |
* Last reviewed on 2016-12-02 (1.8.1) |
| 55 |
*/ |
| 56 |
class NetClientClock : public SystemClock |
| 57 |
{ |
| 58 |
_CLASS_GOBJECT(NetClientClock, GstNetClientClock, GST_NET_CLIENT_CLOCK, SystemClock, GstSystemClock) |
| 59 |
|
| 60 |
protected: |
| 61 |
NetClientClock(const Glib::ustring& name, const Glib::ustring& address, int remote_port, Gst::ClockTime base_time); |
| 62 |
|
| 63 |
public: |
| 64 |
_WRAP_CREATE(const Glib::ustring& name, const Glib::ustring& remote_address, int remote_port, Gst::ClockTime base_time) |
| 65 |
|
| 66 |
_WRAP_PROPERTY("address", Glib::ustring) |
| 67 |
_WRAP_PROPERTY("base-time", guint64) |
| 68 |
_WRAP_PROPERTY("bus", Glib::RefPtr<Gst::Bus>) |
| 69 |
_WRAP_PROPERTY("internal-clock", Glib::RefPtr<Gst::Clock>) |
| 70 |
_WRAP_PROPERTY("minimum-update-interval", guint64) |
| 71 |
_WRAP_PROPERTY("port", int) |
| 72 |
_WRAP_PROPERTY("round-trip-limit", guint64) |
| 73 |
}; |
| 74 |
|
| 75 |
} //namespace Gst |