Adjust RTSP requests to conform to GFE 3.22 changes
This commit is contained in:
parent
9a706fd78c
commit
9b194cc700
1 changed files with 47 additions and 19 deletions
|
|
@ -12,6 +12,7 @@ static bool hasSessionId;
|
||||||
static int rtspClientVersion;
|
static int rtspClientVersion;
|
||||||
static char urlAddr[URLSAFESTRING_LEN];
|
static char urlAddr[URLSAFESTRING_LEN];
|
||||||
static bool useEnet;
|
static bool useEnet;
|
||||||
|
static const char* controlStreamId;
|
||||||
|
|
||||||
static SOCKET sock = INVALID_SOCKET;
|
static SOCKET sock = INVALID_SOCKET;
|
||||||
static ENetHost* client;
|
static ENetHost* client;
|
||||||
|
|
@ -418,7 +419,8 @@ static bool sendVideoAnnounce(PRTSP_MESSAGE response, int* error) {
|
||||||
|
|
||||||
*error = -1;
|
*error = -1;
|
||||||
|
|
||||||
ret = initializeRtspRequest(&request, "ANNOUNCE", "streamid=video");
|
ret = initializeRtspRequest(&request, "ANNOUNCE",
|
||||||
|
APP_VERSION_AT_LEAST(7, 1, 431) ? controlStreamId : "streamid=video");
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ret = false;
|
ret = false;
|
||||||
|
|
||||||
|
|
@ -604,6 +606,7 @@ int performRtspHandshake(void) {
|
||||||
sprintf(rtspTargetUrl, "rtsp%s://%s:48010", useEnet ? "ru" : "", urlAddr);
|
sprintf(rtspTargetUrl, "rtsp%s://%s:48010", useEnet ? "ru" : "", urlAddr);
|
||||||
currentSeqNumber = 1;
|
currentSeqNumber = 1;
|
||||||
hasSessionId = false;
|
hasSessionId = false;
|
||||||
|
controlStreamId = APP_VERSION_AT_LEAST(7, 1, 431) ? "streamid=control/9/0" : "streamid=control/1/0";
|
||||||
|
|
||||||
switch (AppVersionQuad[0]) {
|
switch (AppVersionQuad[0]) {
|
||||||
case 3:
|
case 3:
|
||||||
|
|
@ -808,7 +811,9 @@ int performRtspHandshake(void) {
|
||||||
RTSP_MESSAGE response;
|
RTSP_MESSAGE response;
|
||||||
int error = -1;
|
int error = -1;
|
||||||
|
|
||||||
if (!setupStream(&response, "streamid=control/1/0", &error)) {
|
if (!setupStream(&response,
|
||||||
|
controlStreamId,
|
||||||
|
&error)) {
|
||||||
Limelog("RTSP SETUP streamid=control request failed: %d\n", error);
|
Limelog("RTSP SETUP streamid=control request failed: %d\n", error);
|
||||||
ret = error;
|
ret = error;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
@ -844,6 +849,27 @@ int performRtspHandshake(void) {
|
||||||
freeMessage(&response);
|
freeMessage(&response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GFE 3.22 uses a single PLAY message
|
||||||
|
if (APP_VERSION_AT_LEAST(7, 1, 431)) {
|
||||||
|
RTSP_MESSAGE response;
|
||||||
|
int error = -1;
|
||||||
|
|
||||||
|
if (!playStream(&response, "/", &error)) {
|
||||||
|
Limelog("RTSP PLAY streamid=video request failed: %d\n", error);
|
||||||
|
ret = error;
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.message.response.statusCode != 200) {
|
||||||
|
Limelog("RTSP PLAY failed: %d\n",
|
||||||
|
response.message.response.statusCode);
|
||||||
|
ret = response.message.response.statusCode;
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
freeMessage(&response);
|
||||||
|
}
|
||||||
|
else {
|
||||||
{
|
{
|
||||||
RTSP_MESSAGE response;
|
RTSP_MESSAGE response;
|
||||||
int error = -1;
|
int error = -1;
|
||||||
|
|
@ -883,6 +909,8 @@ int performRtspHandshake(void) {
|
||||||
|
|
||||||
freeMessage(&response);
|
freeMessage(&response);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue