Skip to content
Snippets Groups Projects
Commit b4ba84af authored by Philippe Gorley's avatar Philippe Gorley Committed by Hugo Lefeuvre
Browse files

media_stream: add copy ctor and validity check

Change-Id: I39a8d91c2c66a029942cdfc6d2c2307a41d0d1ee
parent 3f500081
No related merge requests found
...@@ -104,6 +104,18 @@ struct MediaStream { ...@@ -104,6 +104,18 @@ struct MediaStream {
break; break;
} }
} }
MediaStream(const MediaStream& other) = default;
bool isValid() const
{
if (format < 0)
return false;
if (isVideo)
return width > 0 && height > 0;
else
return sampleRate > 0 && nbChannels > 0;
}
}; };
inline std::ostream& operator<<(std::ostream& os, const MediaStream& ms) inline std::ostream& operator<<(std::ostream& os, const MediaStream& ms)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment