Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camera_mediation_on_aow #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ ifeq ($(TARGET_BOARD_PLATFORM), celadon)
camera_vhal_cflags += -DGRALLOC_MAPPER4
else
camera_vhal_cflags += -DENABLE_FFMPEG
camera_vhal_cflags += -DUSE_PIPE
endif

LOCAL_MODULE_RELATIVE_PATH := ${camera_vhal_module_relative_path}
Expand Down
3 changes: 2 additions & 1 deletion include/CameraSocketCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace android {
namespace socket {

enum class VideoCodecType { kH264 = 1, kH265 = 2,kI420 = 4, kMJPEG = 8, kAll = 15 };
enum class FrameResolution { k480p = 1, k720p = 2, k1080p = 4, kAll = 7 };
enum class FrameResolution { k480p = 1, k720p = 2, k1080p = 4, kWXGA = 8, kAll = 15 };

enum class SensorOrientation {
ORIENTATION_0 = 0,
Expand Down Expand Up @@ -63,6 +63,7 @@ typedef struct _camera_config {
uint32_t cameraId;
uint32_t codec_type;
uint32_t resolution;
char pkg_name[128];
uint32_t reserved[5];
} camera_config_t;

Expand Down
11 changes: 11 additions & 0 deletions include/CameraSocketServerThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#endif
#include "CameraSocketCommand.h"
#include <linux/vm_sockets.h>
#include "VirtualBuffer.h"

namespace android {

Expand All @@ -43,6 +44,7 @@ enum tranSock
UNIX = 0,
TCP = 1,
VSOCK = 2,
PIPE = 3,
};

class VirtualCameraFactory;
Expand All @@ -64,11 +66,20 @@ class CameraSocketServerThread : public Thread {
ssize_t size_update = 0;
static void* threadFunc(void * arg);

pthread_cond_t mSignalHotplug = PTHREAD_COND_INITIALIZER;
pthread_mutex_t mHotplugLock = PTHREAD_MUTEX_INITIALIZER;


int UpdateCameraInfo();

bool configureCapabilities(bool skipCapRead);

private:
virtual status_t readyToRun();
virtual bool threadLoop() override;
bool ProcessCameraDataFromPipe(ClientVideoBuffer *handle);
ssize_t recvData(int handle, char *pkt, int size, int flag);
ssize_t sendData(int handle, char *pkt, int size, int flag);

void setCameraResolution(uint32_t resolution);
void setCameraMaxSupportedResolution(int32_t width, int32_t height);
Expand Down
2 changes: 2 additions & 0 deletions src/CameraSocketCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const char* codec_type_to_str(uint32_t type) {
return "H264";
case int(android::socket::VideoCodecType::kH265):
return "H265";
case int(android::socket::VideoCodecType::kI420):
return "I420";
default:
return "invalid";
}
Expand Down
Loading
Loading