Exemplo n.º 1
0
static void
gst_mxf_mux_reset (GstMXFMux * mux)
{
  GSList *sl;

  while ((sl = mux->collect->data) != NULL) {
    GstMXFMuxPad *cpad = (GstMXFMuxPad *) sl->data;

    g_object_unref (cpad->adapter);
    g_free (cpad->mapping_data);

    gst_collect_pads_remove_pad (mux->collect, cpad->collect.pad);
  }

  mux->state = GST_MXF_MUX_STATE_HEADER;
  mux->n_pads = 0;

  if (mux->metadata) {
    g_hash_table_destroy (mux->metadata);
    mux->preface = NULL;
    g_list_free (mux->metadata_list);
    mux->metadata_list = NULL;
  }
  mux->metadata = mxf_metadata_hash_table_new ();

  mxf_partition_pack_reset (&mux->partition);
  mxf_primer_pack_reset (&mux->primer);
  memset (&mux->min_edit_rate, 0, sizeof (MXFFraction));
  mux->last_gc_timestamp = 0;
  mux->last_gc_position = 0;
  mux->offset = 0;
}
Exemplo n.º 2
0
static void
gst_mxf_mux_reset (GstMXFMux * mux)
{
  GList *l;

  GST_OBJECT_LOCK (mux);
  while ((l = GST_ELEMENT_CAST (mux)->sinkpads) != NULL) {
    GstPad *pad = (GstPad *) l->data;

    gst_object_ref (pad);
    GST_OBJECT_UNLOCK (mux);
    gst_element_release_request_pad (GST_ELEMENT_CAST (mux), pad);
    gst_object_unref (pad);
    GST_OBJECT_LOCK (mux);
  }
  GST_OBJECT_UNLOCK (mux);

  mux->state = GST_MXF_MUX_STATE_HEADER;
  mux->n_pads = 0;

  if (mux->metadata) {
    g_hash_table_destroy (mux->metadata);
    mux->preface = NULL;
    g_list_free (mux->metadata_list);
    mux->metadata_list = NULL;
  }
  mux->metadata = mxf_metadata_hash_table_new ();

  mxf_partition_pack_reset (&mux->partition);
  mxf_primer_pack_reset (&mux->primer);
  memset (&mux->min_edit_rate, 0, sizeof (MXFFraction));
  mux->last_gc_timestamp = 0;
  mux->last_gc_position = 0;
  mux->offset = 0;
}