mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 21:12:26 +00:00
smpte: send stream-start event
This commit is contained in:
parent
8e3c7fa799
commit
ebe0b1887a
2 changed files with 12 additions and 0 deletions
|
@ -98,6 +98,7 @@ enum
|
|||
PROP_LAST,
|
||||
};
|
||||
|
||||
/* FIXME: should use video meta etc. */
|
||||
#define I420_Y_ROWSTRIDE(width) (GST_ROUND_UP_4(width))
|
||||
#define I420_U_ROWSTRIDE(width) (GST_ROUND_UP_8(width)/2)
|
||||
#define I420_V_ROWSTRIDE(width) ((GST_ROUND_UP_8(I420_Y_ROWSTRIDE(width)))/2)
|
||||
|
@ -386,6 +387,7 @@ gst_smpte_reset (GstSMPTE * smpte)
|
|||
smpte->height = -1;
|
||||
smpte->position = 0;
|
||||
smpte->end_position = 0;
|
||||
smpte->send_stream_start = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -467,6 +469,15 @@ gst_smpte_collected (GstCollectPads * pads, GstSMPTE * smpte)
|
|||
!gst_pad_has_current_caps (smpte->sinkpad2))
|
||||
goto not_negotiated;
|
||||
|
||||
if (smpte->send_stream_start) {
|
||||
gchar s_id[32];
|
||||
|
||||
/* stream-start (FIXME: create id based on input ids) */
|
||||
g_snprintf (s_id, sizeof (s_id), "smpte-%08x", g_random_int ());
|
||||
gst_pad_push_event (smpte->srcpad, gst_event_new_stream_start (s_id));
|
||||
smpte->send_stream_start = FALSE;
|
||||
}
|
||||
|
||||
ts = gst_util_uint64_scale_int (smpte->position * GST_SECOND,
|
||||
smpte->fps_denom, smpte->fps_num);
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ struct _GstSMPTE {
|
|||
*sinkpad1,
|
||||
*sinkpad2;
|
||||
GstCollectPads *collect;
|
||||
gboolean send_stream_start;
|
||||
|
||||
/* properties */
|
||||
gint type;
|
||||
|
|
Loading…
Reference in a new issue