Skip to content

Commit a05c752

Browse files
committed
Version 2.1.1
Bump video API version. DroidCamOBS supports this.
1 parent 4fc9ee0 commit a05c752

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/av.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ void *VideoThreadProc(void *args) {
124124
keep_waiting = 1;
125125
}
126126

127-
len = snprintf(buf, sizeof(buf), VIDEO_REQ, decoder_get_video_width(), decoder_get_video_height());
127+
len = snprintf(buf, sizeof(buf), VIDEO_REQ, codec_names[g_settings.encoder],
128+
decoder_get_video_width(), decoder_get_video_height());
129+
128130
if (Send(buf, len, videoSocket) <= 0){
129131
errprint("send error (%d) '%s'\n", errno, strerror(errno));
130132
MSG_ERROR("Error sending request, DroidCam might be busy with another client.");

src/common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
#ifndef _COMMON_H_
1010
#define _COMMON_H_
1111

12-
#define APP_VER_INT 210
13-
#define APP_VER_STR "2.1.0"
12+
#define APP_VER_INT 211
13+
#define APP_VER_STR "2.1.1"
1414

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

1919
#define ADB_LOCALHOST_IP "127.0.0.1"
2020

21-
#define VIDEO_REQ "CMD /v2/video.4?%dx%d"
21+
#define VIDEO_REQ "CMD /v3/video/%s/%dx%d"
2222
#define OTHER_REQ "CMD /v1/ctl?%d"
2323
#define OTHER_REQ_INT "CMD /v1/ctl?%d=%d"
2424
#define OTHER_REQ_STR "CMD /v1/ctl?%d=%s"

src/settings.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,21 @@ enum control_codes {
3636
CB_V_FLIP,
3737
};
3838

39+
enum {
40+
CODEC_JPG = 0,
41+
CODEC_AVC,
42+
};
43+
44+
static const char* codec_names[] = {
45+
"jpg", "avc",
46+
};
47+
3948
struct settings {
4049
char ip[16];
4150
int port;
4251
int audio;
4352
int video;
53+
int encoder;
4454
int connection; // Connection type
4555
unsigned v4l2_width, v4l2_height;
4656

0 commit comments

Comments
 (0)