Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
getroot committed Jan 6, 2025
2 parents 748e5a0 + da804d1 commit 419e78f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
23 changes: 3 additions & 20 deletions src/projects/publishers/srt/srt_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,6 @@ namespace pub
logad("SrtStream has been terminated finally");
}

bool SrtStream::IsSupportedCodec(cmn::MediaCodecId codec_id)
{
switch (codec_id)
{
case cmn::MediaCodecId::H264:
[[fallthrough]];
case cmn::MediaCodecId::Aac:
return true;

default:
return false;
}
}

#define SRT_SET_TRACK(from, to, supported, message, ...) \
if (to == nullptr) \
{ \
Expand Down Expand Up @@ -113,21 +99,18 @@ namespace pub
{
case cmn::MediaType::Video:
SRT_SET_TRACK(track, first_video_track,
IsSupportedCodec(track->GetCodecId()),
mpegts::Packetizer::IsSupportedCodec(track->GetCodecId()),
"Ignore unsupported video codec (%s)", StringFromMediaCodecId(track->GetCodecId()).CStr());
break;

case cmn::MediaType::Audio:
SRT_SET_TRACK(track, first_audio_track,
IsSupportedCodec(track->GetCodecId()),
mpegts::Packetizer::IsSupportedCodec(track->GetCodecId()),
"Ignore unsupported audio codec (%s)", StringFromMediaCodecId(track->GetCodecId()).CStr());
break;

case cmn::MediaType::Data:
// mpegts::Packetizer only supports ID3v2 format for data track
SRT_SET_TRACK(track, first_data_track,
(track->GetOriginBitstream() == cmn::BitstreamFormat::ID3v2),
"Ignore unsupported data bitstream format (%s)", GetBitstreamFormatString(track->GetOriginBitstream()).CStr());
SRT_SET_TRACK(track, first_data_track, true, );
break;

default:
Expand Down
2 changes: 0 additions & 2 deletions src/projects/publishers/srt/srt_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ namespace pub
uint32_t worker_count);
~SrtStream() override final;

static bool IsSupportedCodec(cmn::MediaCodecId codec_id);

//--------------------------------------------------------------------
// Overriding of Stream
//--------------------------------------------------------------------
Expand Down

0 comments on commit 419e78f

Please sign in to comment.