Added StreamTypeToString

Added a StreamTypeToString function in StreamInfo (where stream type is
defined) so that we can print the type in a more readable way.

Change-Id: Icb1d10f5a72dca314d9bdf07e9cd0c0a185bd791
This commit is contained in:
Aaron Vaage 2018-06-19 09:52:54 -07:00
parent 740724f8cf
commit 26bb50640c
2 changed files with 18 additions and 0 deletions

View File

@ -14,6 +14,22 @@
namespace shaka { namespace shaka {
namespace media { 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<int>(type);
return "";
}
StreamInfo::StreamInfo(StreamType stream_type, StreamInfo::StreamInfo(StreamType stream_type,
int track_id, int track_id,
uint32_t time_scale, uint32_t time_scale,

View File

@ -23,6 +23,8 @@ enum StreamType {
kStreamText, kStreamText,
}; };
std::string StreamTypeToString(StreamType type);
enum Codec { enum Codec {
kUnknownCodec = 0, kUnknownCodec = 0,