- Stream (std::string t);
-
- Stream (std::string n, int i)
- : name (n)
- , id (i)
+ virtual ~Stream () {}
+ virtual std::string to_string () const = 0;
+};
+
+/** @class AudioStream
+ * @brief A stream of audio data.
+ */
+struct AudioStream : public Stream
+{
+public:
+ AudioStream (int r, int64_t l)
+ : _sample_rate (r)
+ , _channel_layout (l)
+ {}
+
+ /* Only used for backwards compatibility for state file version < 1 */
+ void set_sample_rate (int s) {
+ _sample_rate = s;
+ }
+
+ int channels () const {
+ return av_get_channel_layout_nb_channels (_channel_layout);
+ }
+
+ int sample_rate () const {
+ return _sample_rate;
+ }
+
+ int64_t channel_layout () const {
+ return _channel_layout;
+ }
+
+protected:
+ AudioStream ()
+ : _sample_rate (0)
+ , _channel_layout (0)
+ {}
+
+ int _sample_rate;
+ int64_t _channel_layout;
+};
+
+/** @class SubtitleStream
+ * @brief A stream of subtitle data.
+ */
+class SubtitleStream : public Stream
+{
+public:
+ SubtitleStream (std::string n, int i)
+ : _name (n)
+ , _id (i)