MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / rtsp_setup_input_streams

Function rtsp_setup_input_streams

libavformat/rtsp.c:1357–1391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1355}
1356
1357static int rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
1358{
1359 RTSPState *rt = s->priv_data;
1360 char cmd[1024];
1361 unsigned char *content = NULL;
1362 int ret;
1363
1364 /* describe the stream */
1365 snprintf(cmd, sizeof(cmd),
1366 "Accept: application/sdp\r\n");
1367 if (rt->server_type == RTSP_SERVER_REAL) {
1368 /**
1369 * The Require: attribute is needed for proper streaming from
1370 * Realmedia servers.
1371 */
1372 av_strlcat(cmd,
1373 "Require: com.real.retain-entity-for-setup\r\n",
1374 sizeof(cmd));
1375 }
1376 ff_rtsp_send_cmd(s, "DESCRIBE", rt->control_uri, cmd, reply, &content);
1377 if (!content)
1378 return AVERROR_INVALIDDATA;
1379 if (reply->status_code != RTSP_STATUS_OK) {
1380 av_freep(&content);
1381 return AVERROR_INVALIDDATA;
1382 }
1383
1384 /* now we got the SDP description, we parse it */
1385 ret = sdp_parse(s, (const char *)content);
1386 av_freep(&content);
1387 if (ret < 0)
1388 return AVERROR_INVALIDDATA;
1389
1390 return 0;
1391}
1392
1393static int rtsp_setup_output_streams(AVFormatContext *s, const char *addr)
1394{

Callers 1

ff_rtsp_connectFunction · 0.85

Calls 4

av_strlcatFunction · 0.85
ff_rtsp_send_cmdFunction · 0.85
av_freepFunction · 0.85
sdp_parseFunction · 0.85

Tested by

no test coverage detected