splitmuxsink: Don't leak old muxer/sink in async mode
[platform/upstream/gst-plugins-good.git] / gst / multifile / gstsplitmuxsink.h
index 1e4a91e..d06b410 100644 (file)
@@ -68,20 +68,21 @@ typedef struct _MqStreamBuf
 
 typedef struct _MqStreamCtx
 {
-  gint refcount;
-
   GstSplitMuxSink *splitmux;
 
   guint q_overrun_id;
   guint sink_pad_block_id;
   guint src_pad_block_id;
+  gulong fragment_block_id;
 
   gboolean is_reference;
 
   gboolean flushing;
   gboolean in_eos;
   gboolean out_eos;
+  gboolean out_eos_async_done;
   gboolean need_unblock;
+  gboolean caps_change;
 
   GstSegment in_segment;
   GstSegment out_segment;
@@ -117,6 +118,9 @@ struct _GstSplitMuxSink
   gboolean send_keyframe_requests;
   gchar *threshold_timecode_str;
   GstClockTime next_max_tc_time;
+  GstClockTime alignment_threshold;
+
+  gboolean reset_muxer;
 
   GstElement *muxer;
   GstElement *sink;
@@ -150,9 +154,7 @@ struct _GstSplitMuxSink
 
   SplitMuxOutputState output_state;
   GstClockTimeDiff max_out_running_time;
-  GstClockTimeDiff next_max_out_running_time;
 
-  GstClockTimeDiff muxed_out_time;
   guint64 muxed_out_bytes;
 
   MqStreamCtx *reference_ctx;
@@ -165,11 +167,26 @@ struct _GstSplitMuxSink
 
   gboolean need_async_start;
   gboolean async_pending;
+
+  gboolean use_robust_muxing;
+  gboolean muxer_has_reserved_props;
+
+  gboolean split_now;
+
+  /* Async finalize options */
+  gboolean async_finalize;
+  gchar *muxer_factory;
+  GstStructure *muxer_properties;
+  gchar *sink_factory;
+  GstStructure *sink_properties;
 };
 
 struct _GstSplitMuxSinkClass
 {
   GstBinClass parent_class;
+
+  /* actions */
+  void     (*split_now)   (GstSplitMuxSink * splitmux);
 };
 
 G_END_DECLS