mxfdemux: deprecated GStaticRWLock -> GRWLock

https://bugzilla.gnome.org/show_bug.cgi?id=693322
This commit is contained in:
Marc Leeman 2013-02-07 11:54:38 +01:00 committed by Tim-Philipp Müller
parent f7b16f6185
commit 6aa399ec9f
2 changed files with 27 additions and 27 deletions

View file

@ -211,7 +211,7 @@ gst_mxf_demux_reset_metadata (GstMXFDemux * demux)
{ {
GST_DEBUG_OBJECT (demux, "Resetting metadata"); GST_DEBUG_OBJECT (demux, "Resetting metadata");
g_static_rw_lock_writer_lock (&demux->metadata_lock); g_rw_lock_writer_lock (&demux->metadata_lock);
demux->update_metadata = TRUE; demux->update_metadata = TRUE;
demux->metadata_resolved = FALSE; demux->metadata_resolved = FALSE;
@ -225,7 +225,7 @@ gst_mxf_demux_reset_metadata (GstMXFDemux * demux)
} }
demux->metadata = mxf_metadata_hash_table_new (); demux->metadata = mxf_metadata_hash_table_new ();
g_static_rw_lock_writer_unlock (&demux->metadata_lock); g_rw_lock_writer_unlock (&demux->metadata_lock);
} }
static void static void
@ -509,14 +509,14 @@ gst_mxf_demux_resolve_references (GstMXFDemux * demux)
MXFMetadataBase *m = NULL; MXFMetadataBase *m = NULL;
GstStructure *structure; GstStructure *structure;
g_static_rw_lock_writer_lock (&demux->metadata_lock); g_rw_lock_writer_lock (&demux->metadata_lock);
GST_DEBUG_OBJECT (demux, "Resolve metadata references"); GST_DEBUG_OBJECT (demux, "Resolve metadata references");
demux->update_metadata = FALSE; demux->update_metadata = FALSE;
if (!demux->metadata) { if (!demux->metadata) {
GST_ERROR_OBJECT (demux, "No metadata yet"); GST_ERROR_OBJECT (demux, "No metadata yet");
g_static_rw_lock_writer_unlock (&demux->metadata_lock); g_rw_lock_writer_unlock (&demux->metadata_lock);
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
@ -551,13 +551,13 @@ gst_mxf_demux_resolve_references (GstMXFDemux * demux)
gst_structure_free (structure); gst_structure_free (structure);
g_static_rw_lock_writer_unlock (&demux->metadata_lock); g_rw_lock_writer_unlock (&demux->metadata_lock);
return ret; return ret;
error: error:
demux->metadata_resolved = FALSE; demux->metadata_resolved = FALSE;
g_static_rw_lock_writer_unlock (&demux->metadata_lock); g_rw_lock_writer_unlock (&demux->metadata_lock);
return ret; return ret;
} }
@ -910,7 +910,7 @@ gst_mxf_demux_update_tracks (GstMXFDemux * demux)
GstFlowReturn ret; GstFlowReturn ret;
GList *pads = NULL, *l; GList *pads = NULL, *l;
g_static_rw_lock_writer_lock (&demux->metadata_lock); g_rw_lock_writer_lock (&demux->metadata_lock);
GST_DEBUG_OBJECT (demux, "Updating tracks"); GST_DEBUG_OBJECT (demux, "Updating tracks");
if ((ret = gst_mxf_demux_update_essence_tracks (demux)) != GST_FLOW_OK) { if ((ret = gst_mxf_demux_update_essence_tracks (demux)) != GST_FLOW_OK) {
@ -1230,7 +1230,7 @@ gst_mxf_demux_update_tracks (GstMXFDemux * demux)
goto error; goto error;
} }
g_static_rw_lock_writer_unlock (&demux->metadata_lock); g_rw_lock_writer_unlock (&demux->metadata_lock);
for (l = pads; l; l = l->next) for (l = pads; l; l = l->next)
gst_element_add_pad (GST_ELEMENT_CAST (demux), l->data); gst_element_add_pad (GST_ELEMENT_CAST (demux), l->data);
@ -1242,7 +1242,7 @@ gst_mxf_demux_update_tracks (GstMXFDemux * demux)
return GST_FLOW_OK; return GST_FLOW_OK;
error: error:
g_static_rw_lock_writer_unlock (&demux->metadata_lock); g_rw_lock_writer_unlock (&demux->metadata_lock);
return ret; return ret;
} }
@ -1320,7 +1320,7 @@ gst_mxf_demux_handle_metadata (GstMXFDemux * demux, const MXFUL * key,
return GST_FLOW_OK; return GST_FLOW_OK;
} }
g_static_rw_lock_writer_lock (&demux->metadata_lock); g_rw_lock_writer_lock (&demux->metadata_lock);
demux->update_metadata = TRUE; demux->update_metadata = TRUE;
if (MXF_IS_METADATA_PREFACE (metadata)) { if (MXF_IS_METADATA_PREFACE (metadata)) {
@ -1331,7 +1331,7 @@ gst_mxf_demux_handle_metadata (GstMXFDemux * demux, const MXFUL * key,
g_hash_table_replace (demux->metadata, g_hash_table_replace (demux->metadata,
&MXF_METADATA_BASE (metadata)->instance_uid, metadata); &MXF_METADATA_BASE (metadata)->instance_uid, metadata);
g_static_rw_lock_writer_unlock (&demux->metadata_lock); g_rw_lock_writer_unlock (&demux->metadata_lock);
return ret; return ret;
} }
@ -1411,7 +1411,7 @@ gst_mxf_demux_handle_descriptive_metadata (GstMXFDemux * demux,
return GST_FLOW_OK; return GST_FLOW_OK;
} }
g_static_rw_lock_writer_lock (&demux->metadata_lock); g_rw_lock_writer_lock (&demux->metadata_lock);
demux->update_metadata = TRUE; demux->update_metadata = TRUE;
gst_mxf_demux_reset_linked_metadata (demux); gst_mxf_demux_reset_linked_metadata (demux);
@ -1419,7 +1419,7 @@ gst_mxf_demux_handle_descriptive_metadata (GstMXFDemux * demux,
g_hash_table_replace (demux->metadata, &MXF_METADATA_BASE (m)->instance_uid, g_hash_table_replace (demux->metadata, &MXF_METADATA_BASE (m)->instance_uid,
m); m);
g_static_rw_lock_writer_unlock (&demux->metadata_lock); g_rw_lock_writer_unlock (&demux->metadata_lock);
return ret; return ret;
} }
@ -3529,11 +3529,11 @@ gst_mxf_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
pos = mxfpad->position; pos = mxfpad->position;
g_static_rw_lock_reader_lock (&demux->metadata_lock); g_rw_lock_reader_lock (&demux->metadata_lock);
if (format == GST_FORMAT_DEFAULT && pos != GST_CLOCK_TIME_NONE) { if (format == GST_FORMAT_DEFAULT && pos != GST_CLOCK_TIME_NONE) {
if (!mxfpad->material_track || mxfpad->material_track->edit_rate.n == 0 if (!mxfpad->material_track || mxfpad->material_track->edit_rate.n == 0
|| mxfpad->material_track->edit_rate.d == 0) { || mxfpad->material_track->edit_rate.d == 0) {
g_static_rw_lock_reader_unlock (&demux->metadata_lock); g_rw_lock_reader_unlock (&demux->metadata_lock);
goto error; goto error;
} }
@ -3542,7 +3542,7 @@ gst_mxf_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
mxfpad->material_track->edit_rate.n, mxfpad->material_track->edit_rate.n,
mxfpad->material_track->edit_rate.d * GST_SECOND); mxfpad->material_track->edit_rate.d * GST_SECOND);
} }
g_static_rw_lock_reader_unlock (&demux->metadata_lock); g_rw_lock_reader_unlock (&demux->metadata_lock);
GST_DEBUG_OBJECT (pad, GST_DEBUG_OBJECT (pad,
"Returning position %" G_GINT64_FORMAT " in format %s", pos, "Returning position %" G_GINT64_FORMAT " in format %s", pos,
@ -3561,9 +3561,9 @@ gst_mxf_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
if (format != GST_FORMAT_TIME && format != GST_FORMAT_DEFAULT) if (format != GST_FORMAT_TIME && format != GST_FORMAT_DEFAULT)
goto error; goto error;
g_static_rw_lock_reader_lock (&demux->metadata_lock); g_rw_lock_reader_lock (&demux->metadata_lock);
if (!mxfpad->material_track || !mxfpad->material_track->parent.sequence) { if (!mxfpad->material_track || !mxfpad->material_track->parent.sequence) {
g_static_rw_lock_reader_unlock (&demux->metadata_lock); g_rw_lock_reader_unlock (&demux->metadata_lock);
goto error; goto error;
} }
@ -3574,7 +3574,7 @@ gst_mxf_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
if (duration != -1 && format == GST_FORMAT_TIME) { if (duration != -1 && format == GST_FORMAT_TIME) {
if (mxfpad->material_track->edit_rate.n == 0 || if (mxfpad->material_track->edit_rate.n == 0 ||
mxfpad->material_track->edit_rate.d == 0) { mxfpad->material_track->edit_rate.d == 0) {
g_static_rw_lock_reader_unlock (&demux->metadata_lock); g_rw_lock_reader_unlock (&demux->metadata_lock);
goto error; goto error;
} }
@ -3583,7 +3583,7 @@ gst_mxf_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
GST_SECOND * mxfpad->material_track->edit_rate.d, GST_SECOND * mxfpad->material_track->edit_rate.d,
mxfpad->material_track->edit_rate.n); mxfpad->material_track->edit_rate.n);
} }
g_static_rw_lock_reader_unlock (&demux->metadata_lock); g_rw_lock_reader_unlock (&demux->metadata_lock);
GST_DEBUG_OBJECT (pad, GST_DEBUG_OBJECT (pad,
"Returning duration %" G_GINT64_FORMAT " in format %s", duration, "Returning duration %" G_GINT64_FORMAT " in format %s", duration,
@ -3831,7 +3831,7 @@ gst_mxf_demux_query (GstElement * element, GstQuery * query)
if (demux->src->len == 0) if (demux->src->len == 0)
goto done; goto done;
g_static_rw_lock_reader_lock (&demux->metadata_lock); g_rw_lock_reader_lock (&demux->metadata_lock);
for (i = 0; i < demux->src->len; i++) { for (i = 0; i < demux->src->len; i++) {
GstMXFDemuxPad *pad = g_ptr_array_index (demux->src, i); GstMXFDemuxPad *pad = g_ptr_array_index (demux->src, i);
gint64 pdur = -1; gint64 pdur = -1;
@ -3850,7 +3850,7 @@ gst_mxf_demux_query (GstElement * element, GstQuery * query)
pad->material_track->edit_rate.n); pad->material_track->edit_rate.n);
duration = MAX (duration, pdur); duration = MAX (duration, pdur);
} }
g_static_rw_lock_reader_unlock (&demux->metadata_lock); g_rw_lock_reader_unlock (&demux->metadata_lock);
if (duration == -1) { if (duration == -1) {
GST_DEBUG_OBJECT (demux, "No duration known (yet)"); GST_DEBUG_OBJECT (demux, "No duration known (yet)");
@ -3974,7 +3974,7 @@ gst_mxf_demux_get_property (GObject * object, guint prop_id,
case PROP_STRUCTURE:{ case PROP_STRUCTURE:{
GstStructure *s; GstStructure *s;
g_static_rw_lock_reader_lock (&demux->metadata_lock); g_rw_lock_reader_lock (&demux->metadata_lock);
if (demux->preface) if (demux->preface)
s = mxf_metadata_base_to_structure (MXF_METADATA_BASE (demux->preface)); s = mxf_metadata_base_to_structure (MXF_METADATA_BASE (demux->preface));
else else
@ -3985,7 +3985,7 @@ gst_mxf_demux_get_property (GObject * object, guint prop_id,
if (s) if (s)
gst_structure_free (s); gst_structure_free (s);
g_static_rw_lock_reader_unlock (&demux->metadata_lock); g_rw_lock_reader_unlock (&demux->metadata_lock);
break; break;
} }
default: default:
@ -4023,7 +4023,7 @@ gst_mxf_demux_finalize (GObject * object)
g_hash_table_destroy (demux->metadata); g_hash_table_destroy (demux->metadata);
g_static_rw_lock_free (&demux->metadata_lock); g_rw_lock_clear (&demux->metadata_lock);
G_OBJECT_CLASS (parent_class)->finalize (object); G_OBJECT_CLASS (parent_class)->finalize (object);
} }
@ -4091,7 +4091,7 @@ gst_mxf_demux_init (GstMXFDemux * demux)
demux->max_drift = 500 * GST_MSECOND; demux->max_drift = 500 * GST_MSECOND;
demux->adapter = gst_adapter_new (); demux->adapter = gst_adapter_new ();
g_static_rw_lock_init (&demux->metadata_lock); g_rw_lock_init (&demux->metadata_lock);
demux->src = g_ptr_array_new (); demux->src = g_ptr_array_new ();
demux->essence_tracks = demux->essence_tracks =

View file

@ -154,7 +154,7 @@ struct _GstMXFDemux
GArray *random_index_pack; GArray *random_index_pack;
/* Metadata */ /* Metadata */
GStaticRWLock metadata_lock; GRWLock metadata_lock;
gboolean update_metadata; gboolean update_metadata;
gboolean pull_footer_metadata; gboolean pull_footer_metadata;