GstElement 是 Gstreamer 的最基础类,几乎所有的 Gstreamer 类都继承于此,它包装了GObject 同时提供了通用能力。
None
GstElement 是不可实例化的类,也是没有外在属性的类,无法通过 g_object_set 来对其设置属性。
- struct _GstElement
- {
- GstObject object;
-
- /*< public >*/ /* with LOCK */
- GRecMutex state_lock;
-
- /* element state */
- GCond state_cond;
- guint32 state_cookie;
- GstState target_state;
- GstState current_state;
- GstState next_state;
- GstState pending_state;
- GstStateChangeReturn last_return;
-
- GstBus *bus;
-
- /* allocated clock */
- GstClock *clock;
- GstClockTimeDiff base_time; /* NULL/READY: 0 - PAUSED: current time - PLAYING: difference to clock */
- GstClockTime start_time;
-
- /* element pads, these lists can only be iterated while holding
- * the LOCK or checking the cookie after each LOCK. */
- guint16 numpads;
- GList *pads;
- guint16 numsrcpads;
- GList *srcpads;
- guint16 numsinkpads;
- GList *sinkpads;
- guint32 pads_cookie;
-
- /* with object LOCK */
- GList *contexts;
-
- /*< private >*/
- gpointer _gst_reserved[GST_PADDING-1];
- };
base_time:
the time of the clock right before the element is set to PLAYING. Subtracting @base_time from the current clock time in the PLAYING state will yield the running_time against the clock.
记录设置 PLAYING 状态前的那一时刻,近似为当前 ELEMENT 在 PLAYING 状态的开始时间点,用当前时钟值减去这个值无限近似于当前 ELEMENT 已经运行了多久。