GST_DEBUG_OBJECT (base_video_codec, "reset");
+ GST_OBJECT_LOCK (base_video_codec);
for (g = base_video_codec->frames; g; g = g_list_next (g)) {
gst_base_video_codec_free_frame ((GstVideoFrame *) g->data);
}
g_list_free (base_video_codec->frames);
base_video_codec->frames = NULL;
+ GST_OBJECT_UNLOCK (base_video_codec);
base_video_codec->bytes = 0;
base_video_codec->time = 0;
GList *l;
GST_LOG_OBJECT (base_video_decoder, "finish frame");
+#ifndef GST_DISABLE_GST_DEBUG
+ GST_OBJECT_LOCK (base_video_decoder);
GST_LOG_OBJECT (base_video_decoder, "n %d in %d out %d",
g_list_length (GST_BASE_VIDEO_CODEC (base_video_decoder)->frames),
gst_adapter_available (base_video_decoder->input_adapter),
gst_adapter_available (base_video_decoder->output_adapter));
+ GST_OBJECT_UNLOCK (base_video_decoder);
+#endif
GST_LOG_OBJECT (base_video_decoder,
"finish frame sync=%d pts=%" GST_TIME_FORMAT, frame->is_sync_point,
}
done:
+ GST_OBJECT_LOCK (base_video_decoder);
GST_BASE_VIDEO_CODEC (base_video_decoder)->frames =
g_list_remove (GST_BASE_VIDEO_CODEC (base_video_decoder)->frames, frame);
+ GST_OBJECT_UNLOCK (base_video_decoder);
gst_base_video_codec_free_frame (frame);
return ret;
GST_TIME_ARGS (frame->decode_timestamp));
GST_LOG_OBJECT (base_video_decoder, "dist %d", frame->distance_from_sync);
+ GST_OBJECT_LOCK (base_video_decoder);
GST_BASE_VIDEO_CODEC (base_video_decoder)->frames =
g_list_append (GST_BASE_VIDEO_CODEC (base_video_decoder)->frames, frame);
+ GST_OBJECT_UNLOCK (base_video_decoder);
frame->deadline =
gst_segment_to_running_time (&GST_BASE_VIDEO_CODEC
{
GList *g;
+ GST_OBJECT_LOCK (base_video_decoder);
g = g_list_first (GST_BASE_VIDEO_CODEC (base_video_decoder)->frames);
+ GST_OBJECT_UNLOCK (base_video_decoder);
if (g == NULL)
return NULL;
int frame_number)
{
GList *g;
+ GstVideoFrame *frame = NULL;
+ GST_OBJECT_LOCK (base_video_decoder);
for (g = g_list_first (GST_BASE_VIDEO_CODEC (base_video_decoder)->frames);
g; g = g_list_next (g)) {
- GstVideoFrame *frame = g->data;
+ GstVideoFrame *tmp = g->data;
if (frame->system_frame_number == frame_number) {
- return frame;
+ frame = tmp;
+ break;
}
}
+ GST_OBJECT_UNLOCK (base_video_decoder);
- return NULL;
+ return frame;
}
/**