summaryrefslogtreecommitdiff
path: root/src/qcam
diff options
context:
space:
mode:
authorDavid Plowman <david.plowman@raspberrypi.com>2022-01-13 14:15:57 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-01-19 10:27:07 +0000
commit7f1e39e3e227ab9e2a80fb47abe397c515d5ba38 (patch)
tree1d88435724e571f918658727da7cb71fc8276b13 /src/qcam
parent6b160d91f9fee914fa16e6f36c6384930bea2a5d (diff)
libcamera: camera_sensor: Clear camera flips after opening the device
We clear the V4L2_CID_HFLIP and V4L2_CID_VFLIP controls immediately after opening the camera device. This means the camera's Bayer format and mbus codes will be in the sensor's "native" order, and we document this to be the case so that it can be relied upon. Clearing the flips is harmless where sensor flips do not affect the Bayer order. This also fixes a bug in the Raspberry Pi pipeline handler where the native Bayer order was being computed wrongly, but the new behaviour here will be helpful to other pipeline handlers too. A subsequent commit will tidy up the Raspberry Pi pipeline handler in this area as it can now be simplified. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Fixes: 83a512816189 (pipeline: raspberrypi: Convert the pipeline handler to use media controller) Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/qcam')
0 files changed, 0 insertions, 0 deletions
5'>115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (C) 2021, Vedant Paranjape
 *
 * libcamera Gstreamer element API tests
 */

#include "gstreamer_test.h"

#include "test.h"

using namespace std;

extern "C" {
const char *__asan_default_options()
{
	/*
	 * Disable leak detection due to a known global variable initialization
	 * leak in glib's g_quark_init(). This should ideally be handled by
	 * using a suppression file instead of disabling leak detection.
	 */
	return "detect_leaks=false";
}
}

GstreamerTest::GstreamerTest()
	: pipeline_(nullptr), libcameraSrc_(nullptr)
{
	/*
	* GStreamer by default spawns a process to run the
	* gst-plugin-scanner helper. If libcamera is compiled with ASan
	* enabled, and as GStreamer is most likely not, this causes the
	* ASan link order check to fail when gst-plugin-scanner
	* dlopen()s the plugin as many libraries will have already been
	* loaded by then. Fix this issue by disabling spawning of a
	* child helper process when scanning the build directory for
	* plugins.
	*/
	gst_registry_fork_set_enabled(false);

	/* Initialize GStreamer */
	g_autoptr(GError) errInit = NULL;
	if (!gst_init_check(nullptr, nullptr, &errInit)) {
		g_printerr("Could not initialize GStreamer: %s\n",
			   errInit ? errInit->message : "unknown error");

		status_ = TestFail;
		return;
	}

	/*