12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #ifndef RTC_TOOLS_VIDEO_FILE_READER_H_
- #define RTC_TOOLS_VIDEO_FILE_READER_H_
- #include <stddef.h>
- #include <cstdio>
- #include <iterator>
- #include <string>
- #include "api/scoped_refptr.h"
- #include "api/video/video_frame_buffer.h"
- #include "rtc_base/ref_count.h"
- namespace webrtc {
- namespace test {
- class Video : public rtc::RefCountInterface {
- public:
- class Iterator {
- public:
- typedef int value_type;
- typedef std::ptrdiff_t difference_type;
- typedef int* pointer;
- typedef int& reference;
- typedef std::input_iterator_tag iterator_category;
- Iterator(const rtc::scoped_refptr<const Video>& video, size_t index);
- Iterator(const Iterator& other);
- Iterator(Iterator&& other);
- Iterator& operator=(Iterator&&);
- Iterator& operator=(const Iterator&);
- ~Iterator();
- rtc::scoped_refptr<I420BufferInterface> operator*() const;
- bool operator==(const Iterator& other) const;
- bool operator!=(const Iterator& other) const;
- Iterator operator++(int);
- Iterator& operator++();
- private:
- rtc::scoped_refptr<const Video> video_;
- size_t index_;
- };
- Iterator begin() const;
- Iterator end() const;
- virtual int width() const = 0;
- virtual int height() const = 0;
- virtual size_t number_of_frames() const = 0;
- virtual rtc::scoped_refptr<I420BufferInterface> GetFrame(
- size_t index) const = 0;
- };
- rtc::scoped_refptr<Video> OpenY4mFile(const std::string& file_name);
- rtc::scoped_refptr<Video> OpenYuvFile(const std::string& file_name,
- int width,
- int height);
- rtc::scoped_refptr<Video> OpenYuvOrY4mFile(const std::string& file_name,
- int width,
- int height);
- }
- }
- #endif
|