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

Function dash_init

libavformat/dashenc.c:1246–1600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1244}
1245
1246static int dash_init(AVFormatContext *s)
1247{
1248 DASHContext *c = s->priv_data;
1249 int ret = 0, i;
1250 char *ptr;
1251 char basename[1024];
1252
1253 c->nr_of_streams_to_flush = 0;
1254 if (c->single_file_name)
1255 c->single_file = 1;
1256 if (c->single_file)
1257 c->use_template = 0;
1258
1259 if (!c->profile) {
1260 av_log(s, AV_LOG_ERROR, "At least one profile must be enabled.\n");
1261 return AVERROR(EINVAL);
1262 }
1263 if (c->lhls && s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
1264 av_log(s, AV_LOG_ERROR,
1265 "LHLS is experimental, Please set -strict experimental in order to enable it.\n");
1266 return AVERROR_EXPERIMENTAL;
1267 }
1268
1269 if (c->lhls && !c->streaming) {
1270 av_log(s, AV_LOG_WARNING, "Enabling streaming as LHLS is enabled\n");
1271 c->streaming = 1;
1272 }
1273
1274 if (c->lhls && !c->hls_playlist) {
1275 av_log(s, AV_LOG_INFO, "Enabling hls_playlist as LHLS is enabled\n");
1276 c->hls_playlist = 1;
1277 }
1278
1279 if (c->ldash && !c->streaming) {
1280 av_log(s, AV_LOG_WARNING, "Enabling streaming as LDash is enabled\n");
1281 c->streaming = 1;
1282 }
1283
1284 if (c->target_latency && !c->streaming) {
1285 av_log(s, AV_LOG_WARNING, "Target latency option will be ignored as streaming is not enabled\n");
1286 c->target_latency = 0;
1287 }
1288
1289 if (c->global_sidx && !c->single_file) {
1290 av_log(s, AV_LOG_WARNING, "Global SIDX option will be ignored as single_file is not enabled\n");
1291 c->global_sidx = 0;
1292 }
1293
1294 if (c->global_sidx && c->streaming) {
1295 av_log(s, AV_LOG_WARNING, "Global SIDX option will be ignored as streaming is enabled\n");
1296 c->global_sidx = 0;
1297 }
1298 if (c->frag_type == FRAG_TYPE_NONE && c->streaming) {
1299 av_log(s, AV_LOG_VERBOSE, "Changing frag_type from none to every_frame as streaming is enabled\n");
1300 c->frag_type = FRAG_TYPE_EVERY_FRAME;
1301 }
1302
1303 if (c->write_prft < 0) {

Callers

nothing calls this directly

Calls 15

av_logFunction · 0.85
av_cmp_qFunction · 0.85
av_strlcpyFunction · 0.85
init_segment_typesFunction · 0.85
dict_copy_entryFunction · 0.85
av_strireplaceFunction · 0.85
av_match_extFunction · 0.85
avformat_alloc_contextFunction · 0.85
av_guess_formatFunction · 0.85
avformat_new_streamFunction · 0.85
avcodec_parameters_copyFunction · 0.85
av_parser_initFunction · 0.85

Tested by

no test coverage detected