Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/src/LPF_V4L2.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd.
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd.
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand All @@ -15,9 +15,10 @@
#include "v4l2_core.h"
#include "gviewencoder.h"
#include "gviewrender.h"
#include "audio.h"

Check warning on line 18 in src/src/LPF_V4L2.c

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "audio.h" not found.

Check warning on line 18 in src/src/LPF_V4L2.c

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: "audio.h" not found.
#include "core_io.h"

Check warning on line 19 in src/src/LPF_V4L2.c

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "core_io.h" not found.

Check warning on line 19 in src/src/LPF_V4L2.c

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: "core_io.h" not found.
#include "colorspaces.h"

Check warning on line 20 in src/src/LPF_V4L2.c

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "colorspaces.h" not found.

Check warning on line 20 in src/src/LPF_V4L2.c

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: "colorspaces.h" not found.
#include "v4l2_formats.h"

Check warning on line 21 in src/src/LPF_V4L2.c

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "v4l2_formats.h" not found.

Check warning on line 21 in src/src/LPF_V4L2.c

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: "v4l2_formats.h" not found.

int camInit(const char *devicename)
{
Expand Down Expand Up @@ -210,12 +211,15 @@
v4l2core_prepare_new_format(my_vd, (int)my_config->format);

if ((strcmp(my_config->device_name, devlist->list_devices[my_vd->this_device].name) == 0) && (strcmp(my_config->device_location, my_vd->videodevice) == 0)) {
v4l2core_prepare_new_resolution(my_vd, my_config->width, my_config->height);
// 分辨率可能已经被校正
if (my_config->width != get_my_width() || my_config->height != get_my_height()) {
printf("%s: adjust resolution(%dx%d => %dx%d)\n", __func__, my_config->width, my_config->height, get_my_width(), get_my_height());
// DConfig preferredResolution 优先于本地配置文件中的分辨率
if (get_preferred_resolution_width() > 0 && get_preferred_resolution_height() > 0) {
v4l2core_prepare_new_resolution(my_vd,
get_preferred_resolution_width(),
get_preferred_resolution_height());
my_config->width = get_my_width();
my_config->height = get_my_height();
} else {
v4l2core_prepare_new_resolution(my_vd, my_config->width, my_config->height);
}
ret = v4l2core_update_old_format(my_vd, my_config->width, my_config->height, v4l2core_get_requested_frame_format(my_vd));
} else {
Expand Down
Loading