dc1394error_t ret;
int number;
uint64_t guid;
- int unit;
+ int unit, i;
src->dc1394 = dc1394_new ();
if (!src->dc1394) {
("Could not enumerate cameras: %s.", dc1394_error_get_string (ret)));
goto error;
}
- for (int i = 0; i < cameras->num; i++) {
+ for (i = 0; i < cameras->num; i++) {
GST_DEBUG_OBJECT (src, "Camera %2d is %016" G_GINT64_MODIFIER "X %d.",
i, cameras->ids[i].guid, cameras->ids[i].unit);
if ((src->guid == -1 || src->guid == cameras->ids[i].guid) &&
{
dc1394error_t ret;
dc1394switch_t status;
+ guint trials;
GST_DEBUG_OBJECT (src, "Setup capture with a DMA buffer of %d frames",
src->dma_buffer_size);
goto error_transmission;
}
ret = dc1394_video_get_transmission (src->camera, &status);
- for (guint trials = 10;
+ for (trials = 10;
(trials > 0) && !(ret == DC1394_SUCCESS && status == DC1394_ON);
trials--) {
GST_DEBUG_OBJECT (src,
double rate_decimal;
uint64_t total_bytes;
uint32_t width, width_step, height, height_step;
+ guint m, c;
ok = dc1394_video_get_supported_modes (src->camera,
&supported_modes) == DC1394_SUCCESS;
goto error;
}
supported = FALSE;
- for (guint m = 0; m < supported_modes.num && !supported; m++) {
+ for (m = 0; m < supported_modes.num && !supported; m++) {
mode = supported_modes.modes[m];
mode_caps = gst_caps_new_empty ();
if (dc1394_is_video_mode_scalable (mode)) {
}
if (dc1394_is_video_mode_scalable (mode)) {
ok = FALSE;
- for (guint c = 0; c < supported_codings.num && !ok; c++) {
+ for (c = 0; c < supported_codings.num && !ok; c++) {
coding = supported_codings.codings[c];
GST_DEBUG_OBJECT (src,
"Try format7 video mode %d with coding %d, size %d %d, and rate %.4f Hz.",
mode, rate_decimal, rate);
ok = dc1394_video_set_framerate (src->camera, rate) == DC1394_SUCCESS;
}
- // TODO: check feature framerate
+ /* TODO: check feature framerate */
if (!ok) {
GST_ELEMENT_ERROR (src, RESOURCE, SETTINGS, (NULL),
("Could not set video mode %d parameters.", mode));
dc1394color_coding_t coding;
dc1394framerates_t supported_rates;
uint32_t width, width_step, height, height_step;
+ guint m;
if (src->caps)
return gst_caps_ref (src->caps);
}
src->caps = gst_caps_new_empty ();
- for (guint m = 0; m < supported_modes.num; m++) {
+ for (m = 0; m < supported_modes.num; m++) {
mode = supported_modes.modes[m];
if (dc1394_is_video_mode_scalable (mode)) {
ok &= dc1394_format7_get_color_codings (src->camera, mode,
DC1394_FRAMERATE_15, DC1394_FRAMERATE_30, DC1394_FRAMERATE_60,
DC1394_FRAMERATE_120, DC1394_FRAMERATE_240}
};
+ dc1394video_mode_t mode;
caps = gst_caps_new_empty ();
/* First caps for fixed video modes */
- for (dc1394video_mode_t mode = DC1394_VIDEO_MODE_MIN;
- mode < DC1394_VIDEO_MODE_EXIF; mode++) {
+ for (mode = DC1394_VIDEO_MODE_MIN; mode < DC1394_VIDEO_MODE_EXIF; mode++) {
dc1394_get_image_size_from_video_mode (NULL, mode, &width, &height);
dc1394_get_color_coding_from_video_mode (NULL, mode, &coding);
video_codings.codings[0] = coding;
GValue heights = { 0 };
GValue framerate = { 0 };
GValue framerates = { 0 };
+ guint c, w, h, r;
caps = gst_caps_new_empty ();
- for (guint c = 0; c < supported_codings->num; c++) {
+ for (c = 0; c < supported_codings->num; c++) {
coding = supported_codings->codings[c];
switch (coding) {
case DC1394_COLOR_CODING_MONO8:
} else {
g_value_init (&widths, GST_TYPE_LIST);
g_value_init (&width, G_TYPE_INT);
- for (uint32_t w = width_min; w <= width_max; w += width_step) {
+ for (w = width_min; w <= width_max; w += width_step) {
g_value_set_int (&width, w);
gst_value_list_append_value (&widths, &width);
}
} else {
g_value_init (&heights, GST_TYPE_LIST);
g_value_init (&height, G_TYPE_INT);
- for (uint32_t h = height_min; h <= height_max; h += height_step) {
+ for (h = height_min; h <= height_max; h += height_step) {
g_value_set_int (&height, h);
gst_value_list_append_value (&heights, &height);
}
if (supported_rates) {
g_value_init (&framerates, GST_TYPE_LIST);
g_value_init (&framerate, GST_TYPE_FRACTION);
- for (guint r = 0; r < supported_rates->num; r++) {
+ for (r = 0; r < supported_rates->num; r++) {
rate = supported_rates->framerates[r];
switch (rate) {
case DC1394_FRAMERATE_1_875: