本文整理汇总了C++中VideoFrame::field方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoFrame::field方法的具体用法?C++ VideoFrame::field怎么用?C++ VideoFrame::field使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoFrame
的用法示例。
在下文中一共展示了VideoFrame::field方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: upload
bool VaApiMixer::upload(const VideoFrame &frame, bool deint) {
if (!m_glSurface)
return false;
static const int specs[MP_CSP_COUNT] = {
0, //MP_CSP_AUTO,
VA_SRC_BT601, //MP_CSP_BT_601,
VA_SRC_BT709, //MP_CSP_BT_709,
VA_SRC_SMPTE_240, //MP_CSP_SMPTE_240M,
0, //MP_CSP_RGB,
0, //MP_CSP_XYZ,
0, //MP_CSP_YCGCO,
};
static const int field[] = {
// Picture = 0, Top = 1, Bottom = 2
VA_FRAME_PICTURE, VA_TOP_FIELD, VA_BOTTOM_FIELD, VA_FRAME_PICTURE
};
const auto id = (VASurfaceID)(quintptr)frame.data(3);
int flags = specs[frame.format().colorspace()];
if (deint)
flags |= field[frame.field() & VideoFrame::Interlaced];
if (!check(vaCopySurfaceGLX(VaApi::glx(), m_glSurface, id, flags), "Cannot copy OpenGL surface."))
return false;
if (!check(vaSyncSurface(VaApi::glx(), id), "Cannot sync video surface."))
return false;
return true;
}
示例2: process
bool VaApiPostProcessor::process(const VideoFrame &in, QLinkedList<VideoFrame> &queue) {
if (!d->pipeline)
return false;
auto surface = VaApiSurfacePool::getSurface(in.mpi());
if (!surface)
return false;
mp_image *out1 = nullptr, *out2 = nullptr;
out1 = d->pipeline->render(in, d->setupDeint(in.mpi()->fields, true));
if (d->deint.doubler && d->deint.method != DeintMethod::None)
out2 = d->pipeline->render(in, d->setupDeint(in.mpi()->fields, false));
if (out1)
queue.push_back(VideoFrame(true, out1, nextPTS(), in.field() & ~VideoFrame::Interlaced));
if (out2)
queue.push_back(VideoFrame(true, out2, nextPTS(), in.field() & ~VideoFrame::Interlaced));
return out1 || out2;
}
示例3: push
void push(mp_image *mpi) {
mpi->colorspace = in->format().colorspace();
mpi->levels = in->format().range();
mpi->display_w = in->format().displaySize().width();
mpi->display_h = in->format().displaySize().height();
mpi->pts = p->nextPTS();
queue->push_back(VideoFrame(true, mpi, in->field()));
++pushed;
}
示例4: copyInterlaced
void copyInterlaced(const VideoFrame &frame) { d->field = (d->field & ~Interlaced) | (frame.field() & Interlaced); }