Skip to content

Commit

Permalink
Normalize HLSChunklistPathDepth attribute (#1694)
Browse files Browse the repository at this point in the history
* Normalize HLSChunklistPathDepth attribute

When setting a profile (transcoding) the option to set the depth of the
playlist path uses HLSChunklistPathDepth, however, when using multiplexing
approach it uses HlsChunklistPathDepth.

It might be a good idea using the same atribute name.
  • Loading branch information
mauricioabreu authored Oct 4, 2024
1 parent cb9657c commit 2b0193e
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/projects/providers/multiplex/multiplex_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ namespace pvd
_last_error = "Failed to find outputStream/name object";
return false;
}

_output_stream_name = name_object.asString().c_str();

return true;
}

Expand Down Expand Up @@ -418,12 +418,17 @@ namespace pvd
playlist->SetWebRtcAutoAbr(webrtc_auto_abr.text().as_bool());
}

auto hls_chunklist_path_depth = options_node.child("HlsChunklistPathDepth");
if (hls_chunklist_path_depth)
auto hls_chunklist_path_depth = options_node.child("HLSChunklistPathDepth");
if (!hls_chunklist_path_depth)
{
playlist->SetHlsChunklistPathDepth(hls_chunklist_path_depth.text().as_int());
hls_chunklist_path_depth = options_node.child("HlsChunklistPathDepth");
}

if (hls_chunklist_path_depth)
{
playlist->SetHlsChunklistPathDepth(hls_chunklist_path_depth.text().as_int());
}

auto enable_ts_packaging = options_node.child("EnableTsPackaging");
if (enable_ts_packaging)
{
Expand Down Expand Up @@ -511,12 +516,12 @@ namespace pvd
_last_error = ov::String::FormatString("Failed to parse url: %s", url_str.CStr());
return false;
}

// TrackMap
auto track_map_node = source_stream_node.child("TrackMap");

// Track
for (auto track_node = track_map_node.child("Track"); track_node; track_node = track_node.next_sibling("Track"))
for (auto track_node = track_map_node.child("Track"); track_node; track_node = track_node.next_sibling("Track"))
{
auto source_track_name_node = track_node.child("SourceTrackName");
if (!source_track_name_node)
Expand Down Expand Up @@ -547,7 +552,7 @@ namespace pvd
{
framerate_conf = framerate_conf_node.text().as_int();
}

ov::String source_track_name = source_track_name_node.text().as_string();
ov::String new_track_name = new_track_name_node.text().as_string();
source_stream->AddTrackMap(source_track_name, NewTrackInfo(source_track_name, new_track_name, bitrate_conf, framerate_conf));
Expand Down Expand Up @@ -620,7 +625,7 @@ namespace pvd

if (playlist->GetHlsChunklistPathDepth() != -1)
{
options_node.append_child("HlsChunklistPathDepth").text().set(playlist->GetHlsChunklistPathDepth());
options_node.append_child("HLSChunklistPathDepth").text().set(playlist->GetHlsChunklistPathDepth());
}

if (playlist->IsTsPackagingEnabled())
Expand Down Expand Up @@ -781,7 +786,7 @@ namespace pvd

info_str += ov::String::FormatString("OutputStreamName : %s\n", _output_stream_name.CStr());
info_str += ov::String::FormatString("SourceStreams : %d\n", _source_streams.size());

for (const auto &source : GetSourceStreams())
{
info_str += ov::String::FormatString("\tSourceStream : %s\n", source->GetName().CStr());
Expand All @@ -795,4 +800,4 @@ namespace pvd

return info_str;
}
}
}

0 comments on commit 2b0193e

Please sign in to comment.