CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/Core/HW/Camera.h
Views: 1401
// Copyright (c) 2020- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.16#pragma once1718#include "ppsspp_config.h"19#include "Core/HLE/sceUsbCam.h"2021#include "ext/jpge/jpgd.h"22#include "ext/jpge/jpge.h"2324extern "C" {25#ifdef USE_FFMPEG26#include "libswscale/swscale.h"27#include "libavutil/imgutils.h"28#endif //USE_FFMPEG29}3031void __cameraDummyImage(int width, int height, unsigned char** outData, int* outLen);3233#if defined(USING_QT_UI)34#include <QAbstractVideoSurface>35#include <QCameraInfo>3637class MyViewfinder : public QAbstractVideoSurface {38Q_OBJECT39public:40QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const;41bool present(const QVideoFrame &frame);42};4344static int qtc_ideal_width;45static int qtc_ideal_height;46static QCamera *qt_camera;47static QAbstractVideoSurface *qt_viewfinder;4849std::vector<std::string> __qt_getDeviceList();50int __qt_startCapture(int width, int height);51int __qt_stopCapture();5253#elif PPSSPP_PLATFORM(LINUX) && !PPSSPP_PLATFORM(ANDROID)54#include <fcntl.h>55#include <linux/videodev2.h>56#include <sys/ioctl.h>57#include <sys/mman.h>5859#include "Common/Thread/ThreadUtil.h"6061typedef struct {62void *start;63int length;64} v4l_buf_t;6566static int v4l_fd = -1;67static uint32_t v4l_format;68static int v4l_hw_width;69static int v4l_hw_height;70static int v4l_height_fixed_aspect;71static int v4l_ideal_width;72static int v4l_ideal_height;7374static pthread_t v4l_thread;75static int v4l_buffer_count;76static v4l_buf_t *v4l_buffers;7778std::vector<std::string> __v4l_getDeviceList();79int __v4l_startCapture(int width, int height);80int __v4l_stopCapture();81#endif8283