diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-03-02 21:58:52 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-03-02 21:58:52 +0000 |
commit | c62995f2fc0bb404616311c43e9e4177d4c18dc1 (patch) | |
tree | b7b7af383f87aa8341e6d06d91de98e678cb5433 /sys/v4l2/v4l2src_calls.c | |
parent | ae500224ff1791a69689791901acab576d87546c (diff) | |
download | gst-plugins-bad-c62995f2fc0bb404616311c43e9e4177d4c18dc1.tar.gz gst-plugins-bad-c62995f2fc0bb404616311c43e9e4177d4c18dc1.tar.bz2 gst-plugins-bad-c62995f2fc0bb404616311c43e9e4177d4c18dc1.zip |
Unification of the way to speak to v4l2 and v4l elements... Also fix a segfautl when doing gst-inspect v4l2src
Original commit message from CVS:
Unification of the way to speak to v4l2 and v4l elements... Also fix a segfautl when doing gst-inspect v4l2src
Diffstat (limited to 'sys/v4l2/v4l2src_calls.c')
-rw-r--r-- | sys/v4l2/v4l2src_calls.c | 50 |
1 files changed, 4 insertions, 46 deletions
diff --git a/sys/v4l2/v4l2src_calls.c b/sys/v4l2/v4l2src_calls.c index a6f244fe..d6c9655f 100644 --- a/sys/v4l2/v4l2src_calls.c +++ b/sys/v4l2/v4l2src_calls.c @@ -72,6 +72,8 @@ gst_v4l2src_fill_format_list (GstV4l2Src *v4l2src) fmtptr = g_malloc(sizeof(format)); memcpy(fmtptr, &format, sizeof(format)); v4l2src->formats = g_list_append(v4l2src->formats, fmtptr); + + v4l2src->format_list = g_list_append(v4l2src->format_list, fmtptr->description); } return TRUE; @@ -92,6 +94,8 @@ gst_v4l2src_empty_format_list (GstV4l2Src *v4l2src) v4l2src->formats = g_list_remove(v4l2src->formats, data); g_free(data); } + g_list_free(v4l2src->format_list); + v4l2src->format_list = NULL; return TRUE; } @@ -399,49 +403,3 @@ gst_v4l2src_capture_deinit (GstV4l2Src *v4l2src) return TRUE; } - - -/****************************************************** - * gst_v4l2src_get_fourcc_list(): - * create a list of all available fourccs - * return value: the list - ******************************************************/ - -GList * -gst_v4l2src_get_fourcc_list (GstV4l2Src *v4l2src) -{ - GList *list = NULL; - gint n; - - for (n=0;n<g_list_length(v4l2src->formats);n++) { - struct v4l2_fmtdesc *fmt = (struct v4l2_fmtdesc *) g_list_nth_data(v4l2src->formats, n); - guint32 print_format = GUINT32_FROM_LE(fmt->pixelformat); - gchar *print_format_str = (gchar *) &print_format; - - list = g_list_append(list, g_strndup(print_format_str, 4)); - } - - return list; -} - - -/****************************************************** - * gst_v4l2src_get_format_list(): - * create a list of all available capture formats - * return value: the list - ******************************************************/ - -GList * -gst_v4l2src_get_format_list (GstV4l2Src *v4l2src) -{ - GList *list = NULL; - gint n; - - for (n=0;n<g_list_length(v4l2src->formats);n++) { - struct v4l2_fmtdesc *fmt = (struct v4l2_fmtdesc *) g_list_nth_data(v4l2src->formats, n); - - list = g_list_append(list, g_strdup(fmt->description)); - } - - return list; -} |