Ejemplo n.º 1
0
Archivo: main.cpp Proyecto: CCJY/coliru
int main()
{
    int i;

    g_std(i);
    g_std(42);
    
    g(i); // error: no matching function for call to 'fwd(int&)'
    g(42); // error: no matching function for call to 'fwd(int&)'
    
    g2(i);
    g2(42);
}
Ejemplo n.º 2
0
void GeneralTab::updateStandard()
{
	v4l2_std_id std;
	v4l2_standard vs;
	QString what;

	g_std(std);
	if (enum_std(vs, true)) {
		do {
			if (vs.id == std)
				break;
		} while (enum_std(vs));
	}
	if (vs.id != std) {
		if (enum_std(vs, true)) {
			do {
				if (vs.id & std)
					break;
			} while (enum_std(vs));
		}
	}
	if ((vs.id & std) == 0)
		return;
	m_tvStandard->setCurrentIndex(vs.index);
	what.sprintf("TV Standard (0x%llX)\n"
		"Frame period: %f (%d/%d)\n"
		"Frame lines: %d", (long long int)std,
		(double)vs.frameperiod.numerator / vs.frameperiod.denominator,
		vs.frameperiod.numerator, vs.frameperiod.denominator,
		vs.framelines);
	m_tvStandard->setWhatsThis(what);
}
Ejemplo n.º 3
0
v4l2_fract v4l2::g_pixel_aspect(unsigned type)
{
	v4l2_cropcap ratio;
	v4l2_std_id std;
	static const v4l2_fract square = { 1, 1 };
	static const v4l2_fract hz50 = { 11, 12 };
	static const v4l2_fract hz60 = { 11, 10 };

	ratio.type = type;
	if (ioctl(VIDIOC_CROPCAP, &ratio) < 0) {
		if (!g_std(std))
			return square;
		if (std & V4L2_STD_525_60)
			return hz60;
		if (std & V4L2_STD_625_50)
			return hz50;
		return square;
	}
	if (!ratio.pixelaspect.numerator || !ratio.pixelaspect.denominator)
		return square;
	return ratio.pixelaspect;
}