// This class extends VideoSource to allow parsing of raw yv12 // so that we can do actual file encodes. class Y4mVideoSource : public VideoSource {
public:
Y4mVideoSource(const std::string &file_name, unsignedint start, int limit)
: file_name_(file_name), input_file_(nullptr), img_(new vpx_image_t()),
start_(start), limit_(limit), frame_(0), framerate_numerator_(0),
framerate_denominator_(0), y4m_() {}
virtual void FillFrame() {
ASSERT_NE(input_file_, nullptr); // Read a frame from input_file.
y4m_input_fetch_frame(&y4m_, input_file_, img_.get());
}
// Swap buffers with another y4m source. This allows reading a new frame // while keeping the old frame around. A whole Y4mSource is required and // not just a vpx_image_t because of how the y4m reader manipulates // vpx_image_t internals, void SwapBuffers(Y4mVideoSource *other) {
std::swap(other->y4m_.dst_buf, y4m_.dst_buf);
vpx_image_t *tmp;
tmp = other->img_.release();
other->img_.reset(img_.release());
img_.reset(tmp);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.