avtp: rename tstamp-mode to timestamp-mode

I thnk w cn spre the xtra lttrs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1397>
This commit is contained in:
Tim-Philipp Müller 2020-07-01 18:42:18 +01:00
parent 13376f88fe
commit 395ecb3d2f
5 changed files with 33 additions and 31 deletions

View file

@ -1715,7 +1715,7 @@
} }
}, },
"properties": { "properties": {
"tstamp-mode": { "timestamp-mode": {
"blurb": "AAF timestamping mode", "blurb": "AAF timestamping mode",
"conditionally-available": false, "conditionally-available": false,
"construct": false, "construct": false,
@ -1724,7 +1724,7 @@
"default": "normal (0)", "default": "normal (0)",
"mutable": "paused", "mutable": "paused",
"readable": true, "readable": true,
"type": "GstAvtpAafTstampMode", "type": "GstAvtpAafTimestampMode",
"writable": true "writable": true
} }
}, },
@ -2003,7 +2003,7 @@
"filename": "gstavtp", "filename": "gstavtp",
"license": "LGPL", "license": "LGPL",
"other-types": { "other-types": {
"GstAvtpAafTstampMode": { "GstAvtpAafTimestampMode": {
"kind": "enum", "kind": "enum",
"values": [ "values": [
{ {

View file

@ -172,7 +172,7 @@
* define the correct presentation time of the packets on the AVTP listener * define the correct presentation time of the packets on the AVTP listener
* side. It should be as low as possible (zero if possible). * side. It should be as low as possible (zero if possible).
* *
* * tstamp-mode (avtpaafpay): AAF timestamping mode, as defined in AVTP spec. * * timestamp-mode (avtpaafpay): AAF timestamping mode, as defined in AVTP spec.
* *
* * mtu (avtpcvfpay): Maximum Transmit Unit of the underlying network, used * * mtu (avtpcvfpay): Maximum Transmit Unit of the underlying network, used
* to determine when to fragment a CVF packet and how big it should be. * to determine when to fragment a CVF packet and how big it should be.

View file

@ -44,12 +44,12 @@
GST_DEBUG_CATEGORY_STATIC (avtpaafpay_debug); GST_DEBUG_CATEGORY_STATIC (avtpaafpay_debug);
#define GST_CAT_DEFAULT (avtpaafpay_debug) #define GST_CAT_DEFAULT (avtpaafpay_debug)
#define DEFAULT_TSTAMP_MODE GST_AVTP_AAF_TSTAMP_MODE_NORMAL #define DEFAULT_TIMESTAMP_MODE GST_AVTP_AAF_TIMESTAMP_MODE_NORMAL
enum enum
{ {
PROP_0, PROP_0,
PROP_TSTAMP_MODE, PROP_TIMESTAMP_MODE,
}; };
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
@ -62,13 +62,13 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
"layout = (string) interleaved") "layout = (string) interleaved")
); );
#define GST_TYPE_AVTP_AAF_TSTAMP_MODE (gst_avtp_aaf_tstamp_mode_get_type()) #define GST_TYPE_AVTP_AAF_TIMESTAMP_MODE (gst_avtp_aaf_timestamp_mode_get_type())
static GType static GType
gst_avtp_aaf_tstamp_mode_get_type (void) gst_avtp_aaf_timestamp_mode_get_type (void)
{ {
static const GEnumValue tstamp_mode_types[] = { static const GEnumValue timestamp_mode_types[] = {
{GST_AVTP_AAF_TSTAMP_MODE_NORMAL, "Normal timestamping mode", "normal"}, {GST_AVTP_AAF_TIMESTAMP_MODE_NORMAL, "Normal timestamping mode", "normal"},
{GST_AVTP_AAF_TSTAMP_MODE_SPARSE, "Sparse timestamping mode", "sparse"}, {GST_AVTP_AAF_TIMESTAMP_MODE_SPARSE, "Sparse timestamping mode", "sparse"},
{0, NULL, NULL}, {0, NULL, NULL},
}; };
static gsize id = 0; static gsize id = 0;
@ -77,7 +77,8 @@ gst_avtp_aaf_tstamp_mode_get_type (void)
GType new_type; GType new_type;
new_type = new_type =
g_enum_register_static ("GstAvtpAafTstampMode", tstamp_mode_types); g_enum_register_static ("GstAvtpAafTimestampMode",
timestamp_mode_types);
g_once_init_leave (&id, (gsize) new_type); g_once_init_leave (&id, (gsize) new_type);
} }
@ -112,10 +113,10 @@ gst_avtp_aaf_pay_class_init (GstAvtpAafPayClass * klass)
object_class->set_property = gst_avtp_aaf_pay_set_property; object_class->set_property = gst_avtp_aaf_pay_set_property;
object_class->get_property = gst_avtp_aaf_pay_get_property; object_class->get_property = gst_avtp_aaf_pay_get_property;
g_object_class_install_property (object_class, PROP_TSTAMP_MODE, g_object_class_install_property (object_class, PROP_TIMESTAMP_MODE,
g_param_spec_enum ("tstamp-mode", "Timestamping Mode", g_param_spec_enum ("timestamp-mode", "Timestamping Mode",
"AAF timestamping mode", GST_TYPE_AVTP_AAF_TSTAMP_MODE, "AAF timestamping mode", GST_TYPE_AVTP_AAF_TIMESTAMP_MODE,
DEFAULT_TSTAMP_MODE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | DEFAULT_TIMESTAMP_MODE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
GST_PARAM_MUTABLE_PAUSED)); GST_PARAM_MUTABLE_PAUSED));
element_class->change_state = element_class->change_state =
@ -136,13 +137,13 @@ gst_avtp_aaf_pay_class_init (GstAvtpAafPayClass * klass)
GST_DEBUG_CATEGORY_INIT (avtpaafpay_debug, "avtpaafpay", 0, GST_DEBUG_CATEGORY_INIT (avtpaafpay_debug, "avtpaafpay", 0,
"AAF AVTP Payloader"); "AAF AVTP Payloader");
gst_type_mark_as_plugin_api (GST_TYPE_AVTP_AAF_TSTAMP_MODE, 0); gst_type_mark_as_plugin_api (GST_TYPE_AVTP_AAF_TIMESTAMP_MODE, 0);
} }
static void static void
gst_avtp_aaf_pay_init (GstAvtpAafPay * avtpaafpay) gst_avtp_aaf_pay_init (GstAvtpAafPay * avtpaafpay)
{ {
avtpaafpay->tstamp_mode = DEFAULT_TSTAMP_MODE; avtpaafpay->timestamp_mode = DEFAULT_TIMESTAMP_MODE;
avtpaafpay->header = NULL; avtpaafpay->header = NULL;
avtpaafpay->channels = 0; avtpaafpay->channels = 0;
@ -160,8 +161,8 @@ gst_avtp_aaf_pay_set_property (GObject * object, guint prop_id,
GST_DEBUG_OBJECT (avtpaafpay, "prop_id %u", prop_id); GST_DEBUG_OBJECT (avtpaafpay, "prop_id %u", prop_id);
switch (prop_id) { switch (prop_id) {
case PROP_TSTAMP_MODE: case PROP_TIMESTAMP_MODE:
avtpaafpay->tstamp_mode = g_value_get_enum (value); avtpaafpay->timestamp_mode = g_value_get_enum (value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -178,8 +179,8 @@ gst_avtp_aaf_pay_get_property (GObject * object, guint prop_id,
GST_DEBUG_OBJECT (avtpaafpay, "prop_id %u", prop_id); GST_DEBUG_OBJECT (avtpaafpay, "prop_id %u", prop_id);
switch (prop_id) { switch (prop_id) {
case PROP_TSTAMP_MODE: case PROP_TIMESTAMP_MODE:
g_value_set_enum (value, avtpaafpay->tstamp_mode); g_value_set_enum (value, avtpaafpay->timestamp_mode);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -230,7 +231,8 @@ gst_avtp_aaf_pay_change_state (GstElement * element, GstStateChange transition)
res = avtp_aaf_pdu_set (pdu, AVTP_AAF_FIELD_STREAM_ID, res = avtp_aaf_pdu_set (pdu, AVTP_AAF_FIELD_STREAM_ID,
avtpbasepayload->streamid); avtpbasepayload->streamid);
g_assert (res == 0); g_assert (res == 0);
res = avtp_aaf_pdu_set (pdu, AVTP_AAF_FIELD_SP, avtpaafpay->tstamp_mode); res =
avtp_aaf_pdu_set (pdu, AVTP_AAF_FIELD_SP, avtpaafpay->timestamp_mode);
g_assert (res == 0); g_assert (res == 0);
gst_memory_unmap (mem, &info); gst_memory_unmap (mem, &info);
break; break;

View file

@ -40,18 +40,18 @@ G_BEGIN_DECLS
typedef struct _GstAvtpAafPay GstAvtpAafPay; typedef struct _GstAvtpAafPay GstAvtpAafPay;
typedef struct _GstAvtpAafPayClass GstAvtpAafPayClass; typedef struct _GstAvtpAafPayClass GstAvtpAafPayClass;
typedef enum _GstAvtpAafTstampMode GstAvtpAafTstampMode; typedef enum _GstAvtpAafTimestampMode GstAvtpAafTimestampMode;
enum _GstAvtpAafTstampMode { enum _GstAvtpAafTimestampMode {
GST_AVTP_AAF_TSTAMP_MODE_NORMAL, GST_AVTP_AAF_TIMESTAMP_MODE_NORMAL,
GST_AVTP_AAF_TSTAMP_MODE_SPARSE, GST_AVTP_AAF_TIMESTAMP_MODE_SPARSE,
}; };
struct _GstAvtpAafPay struct _GstAvtpAafPay
{ {
GstAvtpBasePayload payload; GstAvtpBasePayload payload;
GstAvtpAafTstampMode tstamp_mode; GstAvtpAafTimestampMode timestamp_mode;
GstMemory *header; GstMemory *header;
gint channels; gint channels;

View file

@ -30,7 +30,7 @@ setup_harness (void)
GstHarness *h; GstHarness *h;
h = gst_harness_new_parse h = gst_harness_new_parse
("avtpaafpay streamid=0xDEADC0DEDEADC0DE mtt=1000000 tu=1000000 processing-deadline=1000000 tstamp-mode=normal"); ("avtpaafpay streamid=0xDEADC0DEDEADC0DE mtt=1000000 tu=1000000 processing-deadline=1000000 timestamp-mode=normal");
gst_harness_set_src_caps_str (h, gst_harness_set_src_caps_str (h,
"audio/x-raw,format=S16BE,rate=48000,channels=2,layout=interleaved"); "audio/x-raw,format=S16BE,rate=48000,channels=2,layout=interleaved");
@ -101,8 +101,8 @@ GST_START_TEST (test_properties)
g_object_get (G_OBJECT (element), "tu", &val_uint, NULL); g_object_get (G_OBJECT (element), "tu", &val_uint, NULL);
fail_unless (val_uint == tu); fail_unless (val_uint == tu);
g_object_set (G_OBJECT (element), "tstamp-mode", tstamp_mode, NULL); g_object_set (G_OBJECT (element), "timestamp-mode", tstamp_mode, NULL);
g_object_get (G_OBJECT (element), "tstamp-mode", &val_uint, NULL); g_object_get (G_OBJECT (element), "timestamp-mode", &val_uint, NULL);
fail_unless (val_uint == tstamp_mode); fail_unless (val_uint == tstamp_mode);
g_object_set (G_OBJECT (element), "processing-deadline", processing_deadline, g_object_set (G_OBJECT (element), "processing-deadline", processing_deadline,