summaryrefslogtreecommitdiff
path: root/Documentation/conf.py
AgeCommit message (Expand)Author
2019-01-11Documentation: Update copyright yearsLaurent Pinchart
2019-01-11Documentation: Add custom themeLaurent Pinchart
2018-12-14Documentation: Remove _static and _templates directoryLaurent Pinchart
2018-11-28Documentation: Introduce sphinx documentationKieran Bingham
ref='#n77'>77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
/* SPDX-License-Identifier: BSD-2-Clause */
/*
 * Copyright (C) 2019, Raspberry Pi Ltd
 *
 * cam_helper_ov5647.cpp - camera information for ov5647 sensor
 */

#include <assert.h>

#include "cam_helper.h"

using namespace RPiController;

class CamHelperOv5647 : public CamHelper
{
public:
	CamHelperOv5647();
	uint32_t gainCode(double gain) const override;
	double gain(uint32_t gainCode) const override;
	void getDelays(int &exposureDelay, int &gainDelay,
		       int &vblankDelay, int &hblankDelay) const override;
	unsigned int hideFramesStartup() const override;
	unsigned int hideFramesModeSwitch() const override;
	unsigned int mistrustFramesStartup() const override;
	unsigned int mistrustFramesModeSwitch() const override;

private:
	/*
	 * Smallest difference between the frame length and integration time,
	 * in units of lines.
	 */
	static constexpr int frameIntegrationDiff = 4;
};

/*
 * OV5647 doesn't output metadata, so we have to use the "unicam parser" which
 * works by counting frames.
 */

CamHelperOv5647::CamHelperOv5647()
	: CamHelper({}, frameIntegrationDiff)
{
}

uint32_t CamHelperOv5647::gainCode(double gain) const
{