diff --git a/packager/media/base/stream_info.cc b/packager/media/base/stream_info.cc index bbe8c75ca1..c9bce919bb 100644 --- a/packager/media/base/stream_info.cc +++ b/packager/media/base/stream_info.cc @@ -14,6 +14,22 @@ namespace shaka { namespace media { +std::string StreamTypeToString(StreamType type) { + switch (type) { + case kStreamUnknown: + return "Unknown"; + case kStreamVideo: + return "Video"; + case kStreamAudio: + return "Audio"; + case kStreamText: + return "Text"; + } + + NOTREACHED() << "Unhandled StreamType with value " << static_cast(type); + return ""; +} + StreamInfo::StreamInfo(StreamType stream_type, int track_id, uint32_t time_scale, diff --git a/packager/media/base/stream_info.h b/packager/media/base/stream_info.h index bbd98e926d..d6ce354476 100644 --- a/packager/media/base/stream_info.h +++ b/packager/media/base/stream_info.h @@ -23,6 +23,8 @@ enum StreamType { kStreamText, }; +std::string StreamTypeToString(StreamType type); + enum Codec { kUnknownCodec = 0,