+ fs_writer->stream_states = g_hash_table_new_full(g_direct_hash,
+ g_direct_equal, NULL, destroy_stream_state_key);
+
+ /* Set all the existing streams in the unknown state. */
+ nr_stream = bt_ctf_trace_get_stream_count(trace);
+ for (i = 0; i < nr_stream; i++) {
+ stream = bt_ctf_trace_get_stream_by_index(trace, i);
+ if (!stream) {
+ fprintf(writer_component->err,
+ "[error] %s in %s:%d\n", __func__,
+ __FILE__, __LINE__);
+ goto error;
+ }
+ insert_new_stream_state(writer_component, fs_writer, stream);
+ BT_PUT(stream);
+ }
+
+ /* Check if the trace is already static or register a listener. */