mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
timecodestamper: Modify ltc-add to tc-add
It is more general now and also adds TC to internal counter
This commit is contained in:
parent
c01afab9f7
commit
6552981b79
2 changed files with 12 additions and 14 deletions
|
@ -64,7 +64,7 @@ enum
|
||||||
PROP_FIRST_TIMECODE,
|
PROP_FIRST_TIMECODE,
|
||||||
PROP_FIRST_NOW,
|
PROP_FIRST_NOW,
|
||||||
PROP_LTC_MAX_OFFSET,
|
PROP_LTC_MAX_OFFSET,
|
||||||
PROP_LTC_ADD
|
PROP_TC_ADD
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DEFAULT_OVERRIDE_EXISTING FALSE
|
#define DEFAULT_OVERRIDE_EXISTING FALSE
|
||||||
|
@ -211,10 +211,10 @@ gst_timecodestamper_class_init (GstTimeCodeStamperClass * klass)
|
||||||
"or behind the video. Buffers not in this range are ignored.",
|
"or behind the video. Buffers not in this range are ignored.",
|
||||||
0, G_MAXUINT64, DEFAULT_LTC_MAX_OFFSET,
|
0, G_MAXUINT64, DEFAULT_LTC_MAX_OFFSET,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
g_object_class_install_property (gobject_class, PROP_LTC_ADD,
|
g_object_class_install_property (gobject_class, PROP_TC_ADD,
|
||||||
g_param_spec_int ("ltc-add",
|
g_param_spec_int ("tc-add",
|
||||||
"Add this number of frames to LTC timecode.",
|
"Add this number of frames to LTC or internal timecode.",
|
||||||
"Add this number of frames to LTC timecode, "
|
"Add this number of frames to LTC or internal timecode, "
|
||||||
"useful if there is an offset between your LTC source and video.",
|
"useful if there is an offset between your LTC source and video.",
|
||||||
G_MININT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_MININT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ gst_timecodestamper_init (GstTimeCodeStamper * timecodestamper)
|
||||||
#if HAVE_LTC
|
#if HAVE_LTC
|
||||||
timecodestamper->ltc_dec = NULL;
|
timecodestamper->ltc_dec = NULL;
|
||||||
timecodestamper->ltc_max_offset = DEFAULT_LTC_MAX_OFFSET;
|
timecodestamper->ltc_max_offset = DEFAULT_LTC_MAX_OFFSET;
|
||||||
timecodestamper->ltc_add = 0;
|
timecodestamper->tc_add = 0;
|
||||||
timecodestamper->ltc_first_runtime = 0;
|
timecodestamper->ltc_first_runtime = 0;
|
||||||
timecodestamper->ltc_audio_endtime = 0;
|
timecodestamper->ltc_audio_endtime = 0;
|
||||||
|
|
||||||
|
@ -341,8 +341,8 @@ gst_timecodestamper_set_property (GObject * object, guint prop_id,
|
||||||
case PROP_LTC_MAX_OFFSET:
|
case PROP_LTC_MAX_OFFSET:
|
||||||
timecodestamper->ltc_max_offset = g_value_get_uint64 (value);
|
timecodestamper->ltc_max_offset = g_value_get_uint64 (value);
|
||||||
break;
|
break;
|
||||||
case PROP_LTC_ADD:
|
case PROP_TC_ADD:
|
||||||
timecodestamper->ltc_add = g_value_get_int (value);
|
timecodestamper->tc_add = g_value_get_int (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);
|
||||||
|
@ -379,8 +379,8 @@ gst_timecodestamper_get_property (GObject * object, guint prop_id,
|
||||||
case PROP_LTC_MAX_OFFSET:
|
case PROP_LTC_MAX_OFFSET:
|
||||||
g_value_set_uint64 (value, timecodestamper->ltc_max_offset);
|
g_value_set_uint64 (value, timecodestamper->ltc_max_offset);
|
||||||
break;
|
break;
|
||||||
case PROP_LTC_ADD:
|
case PROP_TC_ADD:
|
||||||
g_value_set_int (value, timecodestamper->ltc_add);
|
g_value_set_int (value, timecodestamper->tc_add);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
@ -688,7 +688,6 @@ gst_timecodestamper_transform_ip (GstBaseTransform * vfilter,
|
||||||
timecodestamper->current_tc->config.latest_daily_jam,
|
timecodestamper->current_tc->config.latest_daily_jam,
|
||||||
timecodestamper->current_tc->config.flags, stc.hours, stc.mins,
|
timecodestamper->current_tc->config.flags, stc.hours, stc.mins,
|
||||||
stc.secs, stc.frame, 0);
|
stc.secs, stc.frame, 0);
|
||||||
gst_video_time_code_add_frames (<c_intern_tc, timecodestamper->ltc_add);
|
|
||||||
if (!timecodestamper->ltc_intern_tc
|
if (!timecodestamper->ltc_intern_tc
|
||||||
|| gst_video_time_code_compare (timecodestamper->ltc_intern_tc,
|
|| gst_video_time_code_compare (timecodestamper->ltc_intern_tc,
|
||||||
<c_intern_tc) != 0) {
|
<c_intern_tc) != 0) {
|
||||||
|
@ -713,8 +712,6 @@ gst_timecodestamper_transform_ip (GstBaseTransform * vfilter,
|
||||||
timecodestamper->current_tc->config.latest_daily_jam,
|
timecodestamper->current_tc->config.latest_daily_jam,
|
||||||
timecodestamper->current_tc->config.flags,
|
timecodestamper->current_tc->config.flags,
|
||||||
stc.hours, stc.mins, stc.secs, stc.frame * fps_n_div, 0);
|
stc.hours, stc.mins, stc.secs, stc.frame * fps_n_div, 0);
|
||||||
gst_video_time_code_add_frames (timecodestamper->ltc_current_tc,
|
|
||||||
timecodestamper->ltc_add);
|
|
||||||
GST_INFO_OBJECT (timecodestamper, "Resynced internal LTC counter");
|
GST_INFO_OBJECT (timecodestamper, "Resynced internal LTC counter");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -767,6 +764,7 @@ gst_timecodestamper_transform_ip (GstBaseTransform * vfilter,
|
||||||
|
|
||||||
if (timecodestamper->tc_source != GST_TIME_CODE_STAMPER_EXISTING && !tc_meta) {
|
if (timecodestamper->tc_source != GST_TIME_CODE_STAMPER_EXISTING && !tc_meta) {
|
||||||
gst_buffer_foreach_meta (buffer, remove_timecode_meta, NULL);
|
gst_buffer_foreach_meta (buffer, remove_timecode_meta, NULL);
|
||||||
|
gst_video_time_code_add_frames (tc, timecodestamper->tc_add);
|
||||||
gst_buffer_add_video_time_code_meta (buffer, tc);
|
gst_buffer_add_video_time_code_meta (buffer, tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ struct _GstTimeCodeStamper
|
||||||
GstVideoTimeCode *ltc_current_tc;
|
GstVideoTimeCode *ltc_current_tc;
|
||||||
GstVideoTimeCode *ltc_intern_tc;
|
GstVideoTimeCode *ltc_intern_tc;
|
||||||
GstClockTime ltc_max_offset;
|
GstClockTime ltc_max_offset;
|
||||||
gint ltc_add;
|
gint tc_add;
|
||||||
GstSegment ltc_segment;
|
GstSegment ltc_segment;
|
||||||
GstVideoInfo vinfo;
|
GstVideoInfo vinfo;
|
||||||
gboolean post_messages;
|
gboolean post_messages;
|
||||||
|
|
Loading…
Reference in a new issue