Use source codec for encoded RTP passthrough

This commit is contained in:
2026-03-27 11:19:03 +08:00
parent bb3ace43b7
commit c320bf01af
4 changed files with 23 additions and 12 deletions
+12 -9
View File
@@ -735,15 +735,6 @@ int run_pipeline(const RuntimeConfig &config) {
return exit_code(PipelineExitCode::SubscriberError);
}
if (config.outputs.rtp.enabled) {
auto created = protocol::UdpRtpPublisher::create(config);
if (!created) {
spdlog::error("pipeline RTP publisher init failed: {}", created.error());
return exit_code(PipelineExitCode::InitializationError);
}
rtp_publisher.emplace(std::move(*created));
}
PipelineStats stats{};
metrics::IngestEmitLatencyTracker latency_tracker{};
bool producer_offline{false};
@@ -775,6 +766,7 @@ int run_pipeline(const RuntimeConfig &config) {
warned_unknown_depth_unit = false;
using_encoded_input = false;
active_stream_info.reset();
rtp_publisher.reset();
rtmp_output.reset();
};
@@ -792,7 +784,17 @@ int run_pipeline(const RuntimeConfig &config) {
const auto start_outputs_from_stream_info =
[&](const encode::EncodedStreamInfo &stream_info, const ipc::FrameInfo &target_info) -> Status {
rtp_publisher.reset();
rtmp_output.reset();
if (config.outputs.rtp.enabled) {
auto created = protocol::UdpRtpPublisher::create(config, stream_info.codec);
if (!created) {
return unexpected_error(
ERR_INTERNAL,
"pipeline RTP publisher init failed: " + created.error());
}
rtp_publisher.emplace(std::move(*created));
}
if (config.outputs.rtmp.enabled) {
auto created = protocol::make_rtmp_output(config, stream_info);
if (!created) {
@@ -901,6 +903,7 @@ int run_pipeline(const RuntimeConfig &config) {
active_stream_info.reset();
using_encoded_input = false;
active_info.reset();
rtp_publisher.reset();
rtmp_output.reset();
break;
}