Skip to content

Commit

Permalink
Version 2.1.1
Browse files Browse the repository at this point in the history
Bump video API version.
DroidCamOBS supports this.
  • Loading branch information
aramg committed Dec 5, 2023
1 parent 4fc9ee0 commit a05c752
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/av.c
Expand Up @@ -124,7 +124,9 @@ void *VideoThreadProc(void *args) {
keep_waiting = 1;
}

len = snprintf(buf, sizeof(buf), VIDEO_REQ, decoder_get_video_width(), decoder_get_video_height());
len = snprintf(buf, sizeof(buf), VIDEO_REQ, codec_names[g_settings.encoder],
decoder_get_video_width(), decoder_get_video_height());

if (Send(buf, len, videoSocket) <= 0){
errprint("send error (%d) '%s'\n", errno, strerror(errno));
MSG_ERROR("Error sending request, DroidCam might be busy with another client.");
Expand Down
6 changes: 3 additions & 3 deletions src/common.h
Expand Up @@ -9,16 +9,16 @@
#ifndef _COMMON_H_
#define _COMMON_H_

#define APP_VER_INT 210
#define APP_VER_STR "2.1.0"
#define APP_VER_INT 211
#define APP_VER_STR "2.1.1"

#define MSG_ERROR(str) ShowError("Error",str)
#define MSG_LASTERROR(str) ShowError(str,strerror(errno))
void ShowError(const char*, const char*);

#define ADB_LOCALHOST_IP "127.0.0.1"

#define VIDEO_REQ "CMD /v2/video.4?%dx%d"
#define VIDEO_REQ "CMD /v3/video/%s/%dx%d"
#define OTHER_REQ "CMD /v1/ctl?%d"
#define OTHER_REQ_INT "CMD /v1/ctl?%d=%d"
#define OTHER_REQ_STR "CMD /v1/ctl?%d=%s"
Expand Down
10 changes: 10 additions & 0 deletions src/settings.h
Expand Up @@ -36,11 +36,21 @@ enum control_codes {
CB_V_FLIP,
};

enum {
CODEC_JPG = 0,
CODEC_AVC,
};

static const char* codec_names[] = {
"jpg", "avc",
};

struct settings {
char ip[16];
int port;
int audio;
int video;
int encoder;
int connection; // Connection type
unsigned v4l2_width, v4l2_height;

Expand Down

0 comments on commit a05c752

Please sign in to comment.