Repository: opencv/opencv
File: modules/videoio/include/opencv2/videoio.hpp (C++)

Code before:
    /// query if exception mode is active
    CV_WRAP bool getExceptionMode() const { return throwOnFail; }


    /** @brief Wait for ready frames from VideoCapture.

    @param streams input video streams
    @param readyIndex stream indexes with grabbed frames (ready to use .retrieve() to fetch actual frame)
    @param timeoutNs number of nanoseconds (0 - infinite)
    @return `true` if streamReady is not empty

    @throws Exception %Exception on stream errors (check .isOpened() to filter out malformed streams) or VideoCapture type is not supported

    The primary use of the function is in multi-camera environments.
    The method fills the ready state vector, grabs video frame, if camera is ready.

    After this call use VideoCapture::retrieve() to decode and fetch frame data.
    */
    CV_WRAP static
    bool waitAny(
            const std::vector<VideoCapture>& streams,
            CV_OUT std::vector<int>& readyIndex,
            int64 timeoutNs = 0);

protected:
    Ptr<CvCapture> cap;
    Ptr<IVideoCapture> icap;
    bool throwOnFail;

    friend class internal::VideoCapturePrivateAccessor;
};

class IVideoWriter;

/** @example samples/cpp/tutorial_code/videoio/video-write/video-write.cpp
Check @ref tutorial_video_write "the corresponding tutorial" for more details
*/

/** @example samples/cpp/videowriter_basic.cpp
An example using VideoCapture and VideoWriter class
*/

/** @brief Video writer class.

The class provides C++ API for writing video files or image sequences.
*/
class CV_EXPORTS_W VideoWriter
{
public:
    /** @brief Default constructors


Review comment (suggestion):
Wouldn't it break source and binary compatibility? This is public interface, someone could inherit custom class from `VideoCapture/VideoWriter` and use these fields.

Code after:

    /** @brief Wait for ready frames from VideoCapture.

    @param streams input video streams
    @param readyIndex stream indexes with grabbed frames (ready to use .retrieve() to fetch actual frame)
    @param timeoutNs number of nanoseconds (0 - infinite)
    @return `true` if streamReady is not empty

    @throws Exception %Exception on stream errors (check .isOpened() to filter out malformed streams) or VideoCapture type is not supported

    The primary use of the function is in multi-camera environments.
    The method fills the ready state vector, grabs video frame, if camera is ready.

    After this call use VideoCapture::retrieve() to decode and fetch frame data.
    */
    CV_WRAP static
    bool waitAny(
            const std::vector<VideoCapture>& streams,
            CV_OUT std::vector<int>& readyIndex,
            int64 timeoutNs = 0);

protected:
    Ptr<IVideoCapture> icap;
    bool throwOnFail;

    friend class internal::VideoCapturePrivateAccessor;
};

class IVideoWriter;

/** @example samples/cpp/tutorial_code/videoio/video-write/video-write.cpp
Check @ref tutorial_video_write "the corresponding tutorial" for more details
*/

/** @example samples/cpp/videowriter_basic.cpp
An example using VideoCapture and VideoWriter class
*/

/** @brief Video writer class.

The class provides C++ API for writing video files or image sequences.
*/
class CV_EXPORTS_W VideoWriter
{
public:
    /** @brief Default constructors

    The constructors/functions initialize video writers.
    -   On Linux FFMPEG is used to write videos;
    -   On Windows FFMPEG or MSWF or DSHOW is used;
    -   On MacOSX AVFoundation is used.