mirror of
https://github.com/rafaelvcaetano/melonDS-android-lib.git
synced 2024-11-23 05:40:09 +00:00
Implement base DSi camera handling
This commit is contained in:
parent
60cf5bfa50
commit
4dce6ceec0
17
src/android/AndroidCameraHandler.h
Normal file
17
src/android/AndroidCameraHandler.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef ANDROIDCAMERAHANDLER_H
|
||||
#define ANDROIDCAMERAHANDLER_H
|
||||
|
||||
#include "../types.h"
|
||||
|
||||
namespace MelonDSAndroid
|
||||
{
|
||||
class AndroidCameraHandler {
|
||||
public:
|
||||
virtual void startCamera(int camera) = 0;
|
||||
virtual void stopCamera(int camera) = 0;
|
||||
virtual void captureFrame(int camera, u32* frameBuffer, int width, int height, bool isYuv) = 0;
|
||||
virtual ~AndroidCameraHandler() {};
|
||||
};
|
||||
}
|
||||
|
||||
#endif //ANDROIDCAMERAHANDLER_H
|
@ -19,6 +19,7 @@
|
||||
#include "FrontendUtil.h"
|
||||
#include "RewindManager.h"
|
||||
#include "ROMManager.h"
|
||||
#include "AndroidCameraHandler.h"
|
||||
#include "LocalMultiplayer.h"
|
||||
#include <android/asset_manager.h>
|
||||
#include <cstring>
|
||||
@ -39,6 +40,7 @@ namespace MelonDSAndroid
|
||||
int actualMicSource = 0;
|
||||
AAssetManager* assetManager;
|
||||
AndroidFileHandler* fileHandler;
|
||||
AndroidCameraHandler* cameraHandler;
|
||||
std::string internalFilesDir;
|
||||
EmulatorConfiguration currentConfiguration;
|
||||
|
||||
@ -120,7 +122,8 @@ namespace MelonDSAndroid
|
||||
RewindManager::SetRewindBufferSizes(1024 * 1024 * 20, 256 * 384 * 4);
|
||||
}
|
||||
|
||||
void setup(AAssetManager* androidAssetManager, u32* textureBufferPointer, bool isMasterInstance) {
|
||||
void setup(AAssetManager* androidAssetManager, AndroidCameraHandler* androidCameraHandler, u32* textureBufferPointer, bool isMasterInstance) {
|
||||
cameraHandler = androidCameraHandler;
|
||||
assetManager = androidAssetManager;
|
||||
textureBuffer = textureBufferPointer;
|
||||
LocalMultiplayer::SetIsMasterInstance(isMasterInstance);
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <list>
|
||||
#include "AndroidFileHandler.h"
|
||||
#include "AndroidCameraHandler.h"
|
||||
#include "RewindManager.h"
|
||||
#include "../types.h"
|
||||
#include "../GPU.h"
|
||||
@ -64,10 +65,11 @@ namespace MelonDSAndroid {
|
||||
|
||||
extern AAssetManager* assetManager;
|
||||
extern AndroidFileHandler* fileHandler;
|
||||
extern AndroidCameraHandler* cameraHandler;
|
||||
extern std::string internalFilesDir;
|
||||
|
||||
extern void setConfiguration(EmulatorConfiguration emulatorConfiguration);
|
||||
extern void setup(AAssetManager* androidAssetManager, u32* textureBufferPointer, bool isMasterInstance);
|
||||
extern void setup(AAssetManager* androidAssetManager, AndroidCameraHandler* androidCameraHandler, u32* textureBufferPointer, bool isMasterInstance);
|
||||
extern void setCodeList(std::list<Cheat> cheats);
|
||||
extern void updateEmulatorConfiguration(EmulatorConfiguration emulatorConfiguration);
|
||||
|
||||
|
@ -442,13 +442,16 @@ namespace Platform
|
||||
|
||||
void Camera_Start(int num)
|
||||
{
|
||||
MelonDSAndroid::cameraHandler->startCamera(num);
|
||||
}
|
||||
|
||||
void Camera_Stop(int num)
|
||||
{
|
||||
MelonDSAndroid::cameraHandler->stopCamera(num);
|
||||
}
|
||||
|
||||
void Camera_CaptureFrame(int num, u32* frame, int width, int height, bool yuv)
|
||||
{
|
||||
MelonDSAndroid::cameraHandler->captureFrame(num, frame, width, height, yuv);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user