mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
timecodestamper: Only allow requesting LTC audio pad in NULL/READY states
And don't introduce any latency at all if not LTC audio pad was requested.
This commit is contained in:
parent
0a499242e9
commit
0a53f6560a
1 changed files with 10 additions and 2 deletions
|
@ -877,7 +877,7 @@ gst_timecodestamper_query (GstBaseTransform * trans,
|
||||||
g_mutex_lock (&timecodestamper->mutex);
|
g_mutex_lock (&timecodestamper->mutex);
|
||||||
if (res && timecodestamper->vinfo.fps_n && timecodestamper->vinfo.fps_d) {
|
if (res && timecodestamper->vinfo.fps_n && timecodestamper->vinfo.fps_d) {
|
||||||
gst_query_parse_latency (query, &live, &min_latency, &max_latency);
|
gst_query_parse_latency (query, &live, &min_latency, &max_latency);
|
||||||
if (live) {
|
if (live && timecodestamper->ltcpad) {
|
||||||
/* Introduce additional 8 frames of latency for LTC processing as
|
/* Introduce additional 8 frames of latency for LTC processing as
|
||||||
* the LTC library seems to usually lag behind 1-6 frames with the
|
* the LTC library seems to usually lag behind 1-6 frames with the
|
||||||
* values reported back to us. */
|
* values reported back to us. */
|
||||||
|
@ -1171,7 +1171,7 @@ gst_timecodestamper_transform_ip (GstBaseTransform * vfilter,
|
||||||
|
|
||||||
/* Update LTC-based timecode as needed */
|
/* Update LTC-based timecode as needed */
|
||||||
#if HAVE_LTC
|
#if HAVE_LTC
|
||||||
{
|
if (timecodestamper->ltcpad) {
|
||||||
GstClockTime frame_duration;
|
GstClockTime frame_duration;
|
||||||
gchar *tc_str;
|
gchar *tc_str;
|
||||||
LTCFrameExt ltc_frame;
|
LTCFrameExt ltc_frame;
|
||||||
|
@ -1520,6 +1520,14 @@ gst_timecodestamper_request_new_pad (GstElement * element,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GST_STATE (timecodestamper) > GST_STATE_READY ||
|
||||||
|
GST_STATE_TARGET (timecodestamper) > GST_STATE_READY) {
|
||||||
|
GST_ERROR_OBJECT (timecodestamper,
|
||||||
|
"LTC audio pad can only be requested in NULL or READY state");
|
||||||
|
GST_OBJECT_UNLOCK (timecodestamper);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
timecodestamper->ltcpad = gst_pad_new_from_static_template
|
timecodestamper->ltcpad = gst_pad_new_from_static_template
|
||||||
(&gst_timecodestamper_ltc_template, "ltc_sink");
|
(&gst_timecodestamper_ltc_template, "ltc_sink");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue