Make FFmpegStream::_id private.
[dcpomatic.git] / src / lib / ffmpeg_content.h
index 7ff159b852b4cb69df4004b1f6a813ad2131e182..2339705d0d17377768b9bd1dbae0f7d2cbda3f2c 100644 (file)
@@ -37,7 +37,7 @@ class FFmpegStream
 public:
        FFmpegStream (std::string n, int i)
                : name (n)
-               , id (i)
+               , _id (i)
                , _legacy_id (false)
        {}
                                
@@ -46,15 +46,22 @@ public:
        void as_xml (xmlpp::Node *) const;
 
        /** @param c An AVFormatContext.
-        *  @return Stream index within the AVFormatContext.
+        *  @param index A stream index within the AVFormatContext.
+        *  @return true if this FFmpegStream uses the given stream index.
         */
-       int index (AVFormatContext const * c) const;
+       bool uses_index (AVFormatContext const * c, int index) const;
        AVStream* stream (AVFormatContext const * c) const;
 
+       int id () const {
+               return _id;
+       }
        std::string name;
-       int id;
+
+       friend bool operator== (FFmpegStream const & a, FFmpegStream const & b);
+       friend bool operator!= (FFmpegStream const & a, FFmpegStream const & b);
        
 private:
+       int _id;
        /** If this is true, id is in fact the index */
        bool _legacy_id;
 };
@@ -86,13 +93,12 @@ private:
        /* Constructor for tests */
        FFmpegAudioStream ()
                : FFmpegStream ("", 0)
+               , frame_rate (0)
+               , channels (0)
                , mapping (1)
        {}
 };
 
-extern bool operator== (FFmpegAudioStream const & a, FFmpegAudioStream const & b);
-extern bool operator!= (FFmpegAudioStream const & a, FFmpegAudioStream const & b);
-
 class FFmpegSubtitleStream : public FFmpegStream
 {
 public:
@@ -105,9 +111,6 @@ public:
        void as_xml (xmlpp::Node *) const;
 };
 
-extern bool operator== (FFmpegSubtitleStream const & a, FFmpegSubtitleStream const & b);
-extern bool operator!= (FFmpegSubtitleStream const & a, FFmpegSubtitleStream const & b);
-
 class FFmpegContentProperty : public VideoContentProperty
 {
 public: