[VDPAU] [PATCH] Add a progressive frame flag to VdpVideoSurfaces.

José Hiram Soltren jsoltren at nvidia.com
Tue Sep 15 12:53:37 PDT 2015


This change adds two top level functions to the VDPAU API:

    VdpVideoMixerSetProgressive
    VdpVideoMixerGetProgressive

Next generation codecs - such as H.265/HEVC - do not support
interlaced content natively. Rather, they leave it to imple-
mentations to decide the correct behavior for handling legacy
interlaced content.

Prior to the introduction of such codecs, this specification
left the designation of a particular VdpVideoSurface as a
_TOP_FIELD, _BOTTOM_FIELD, or _FRAME to the enumeration
VdpVideoMixerPictureStructure, passed to VdpVideoMixerRender.
It is possible, and permitted by this API specification, for
an implementation to set internal state on the backing store
of a VdpVideoSurface when handling a call to VdpVideoMixerRender.

Not all use cases of a VdpVideoSurface will involve a trip
through a call to VdpVideoMixerRender. It is a legal use of the
VDPAU API to access a VdpVideoSurface directly using
VdpVideoSurfaceGetBitsYCbCr and VdpVideoSurfacePutBitsYCbCr.
In such a situation, it is helpful to be able to specify,
explicitly, and from outside of the implementation, whether
a VdpVideoSurface contains either one full frame, or two
half frames.

Without this change, implementations do not have enough
information to determine whether or not a VdpVideoSurface
should be handled as two frames or one frame.
---
 include/vdpau/vdpau.h |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/include/vdpau/vdpau.h b/include/vdpau/vdpau.h
index 0bc5b60..b98d84e 100644
--- a/include/vdpau/vdpau.h
+++ b/include/vdpau/vdpau.h
@@ -1679,6 +1679,38 @@ typedef VdpStatus VdpVideoSurfacePutBitsYCbCr(
     uint32_t const *     source_pitches
 );

+/**
+ * \brief Specify that a VdpVideoSurface contains progressive, full frame,
+ *        non-interlaced content, without top and bottom fields. When set,
+ *        it is a violation of the specification for implementations to
+ *        attempt operations that combine or split fields, as fields are
+ *        undefined when this flag is set. By default, implementations shall
+ *        set this flag to false when handling VdpVideoSurfaceCreate.
+ * \param[in] surface The surface's handle.
+ * \param[in] is_progressive A flag defining if implementations must treat
+ *         this VdpVideoSurface as having progressive data, without any
+ *         notion of top or bottom fields.
+ * \return VdpStatus The completion status of the operation.
+ */
+typedef VdpStatus VdpVideoSurfaceSetProgressive(
+    VdpVideoSurface      surface,
+    VdpBool *            is_progressive
+);
+
+/**
+ * \brief Query a VdpVideoSurface, checking to see if the progressive flag
+ *        is set.
+ * \param[in] surface The surface's handle.
+ * \param[out] is_progressive A flag returning the current progressive
+ *        frame state of this VdpVideoSurface.
+ * \return VdpStatus The completion status of the operation.
+ */
+typedef VdpStatus VdpVideoSurfaceGetProgressive(
+    VdpVideoSurface      surface,
+    /* output parameters follow */
+    VdpBool *            is_progressive
+);
+
 /*@}*/

 /**
-- 
1.7.10.4



More information about the VDPAU mailing list