diff options
Diffstat (limited to 'sys/v4l2/v4l2src_calls.c')
-rw-r--r-- | sys/v4l2/v4l2src_calls.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/v4l2/v4l2src_calls.c b/sys/v4l2/v4l2src_calls.c index d6c9655f..685b37b4 100644 --- a/sys/v4l2/v4l2src_calls.c +++ b/sys/v4l2/v4l2src_calls.c @@ -255,6 +255,14 @@ gst_v4l2src_capture_init (GstV4l2Src *v4l2src) gst_info("Got %d buffers (%s) of size %d KB\n", v4l2src->breq.count, desc, v4l2src->format.fmt.pix.sizeimage/1024); + v4l2src->use_num_times = (gint *) malloc(sizeof(gint) * v4l2src->breq.count); + if (!v4l2src->use_num_times) { + gst_element_error(GST_ELEMENT(v4l2src), + "Error creating sync-use-time tracker: %s", + g_strerror(errno)); + return FALSE; + } + /* Map the buffers */ GST_V4L2ELEMENT(v4l2src)->buffer = (guint8 **) g_malloc(sizeof(guint8*) * v4l2src->breq.count); for (n=0;n<v4l2src->breq.count;n++) { @@ -401,5 +409,7 @@ gst_v4l2src_capture_deinit (GstV4l2Src *v4l2src) g_free(GST_V4L2ELEMENT(v4l2src)->buffer); GST_V4L2ELEMENT(v4l2src)->buffer = NULL; + free(v4l2src->use_num_times); + return TRUE; } |