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

Function init_satip_stream

libavformat/rtsp.c:283–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281
282#if CONFIG_RTSP_DEMUXER
283static int init_satip_stream(AVFormatContext *s)
284{
285 RTSPState *rt = s->priv_data;
286 RTSPStream *rtsp_st = av_mallocz(sizeof(RTSPStream));
287 if (!rtsp_st)
288 return AVERROR(ENOMEM);
289 dynarray_add(&rt->rtsp_streams,
290 &rt->nb_rtsp_streams, rtsp_st);
291
292 rtsp_st->sdp_payload_type = 33; // MP2T
293 av_strlcpy(rtsp_st->control_url,
294 rt->control_uri, sizeof(rtsp_st->control_url));
295
296 if (rt->rtsp_flags & RTSP_FLAG_SATIP_RAW) {
297 AVStream *st = avformat_new_stream(s, NULL);
298 if (!st)
299 return AVERROR(ENOMEM);
300 st->id = rt->nb_rtsp_streams - 1;
301 rtsp_st->stream_index = st->index;
302 st->codecpar->codec_type = AVMEDIA_TYPE_DATA;
303 st->codecpar->codec_id = AV_CODEC_ID_MPEG2TS;
304 } else {
305 rtsp_st->stream_index = -1;
306 init_rtp_handler(&ff_mpegts_dynamic_handler, rtsp_st, NULL);
307 finalize_rtp_handler_init(s, rtsp_st, NULL);
308 }
309 return 0;
310}
311#endif
312
313/* parse the rtpmap description: <codec_name>/<clock_rate>[/<other params>] */

Callers 1

ff_rtsp_connectFunction · 0.85

Calls 5

av_strlcpyFunction · 0.85
avformat_new_streamFunction · 0.85
init_rtp_handlerFunction · 0.85
av_malloczFunction · 0.50

Tested by

no test coverage detected