Commit b4ba84af authored by Philippe Gorley's avatar Philippe Gorley Committed by Hugo Lefeuvre

media_stream: add copy ctor and validity check

Change-Id: I39a8d91c2c66a029942cdfc6d2c2307a41d0d1ee
parent 3f500081
......@@ -104,6 +104,18 @@ struct MediaStream {
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment