"Top-field first", "top-field-first" },
{ GST_VAAPI_DEINTERLACE_FLAG_ONEFIELD,
"One field", "one-field" },
+ { GST_VAAPI_DEINTERLACE_FLAG_TOPFIELD,
+ "Top field", "top-field" },
{ 0, NULL, NULL }
};
/**
* GstVaapiDeinterlaceFlags:
* @GST_VAAPI_DEINTERLACE_FLAG_TFF: Top-field first. If this flag is
- * not set, then bottom-field first order is assumed.
+ * not set, then bottom-field first order is assumed. Note: this
+ * only affects the way reference frames are organized for advanced
+ * deinterlacing modes.
* @GST_VAAPI_DEINTERLACE_FLAG_ONEFIELD: The input frame represents a
* single field. If this flag is not set, then the whole frame holds
- * two fields.
+ * two interleaved fields.
+ * @GST_VAAPI_DEINTERLACE_FLAG_TOPFIELD: The top field of the input
+ * frame is to be used for deinterlacing. Otherwise, if this flag is
+ * not set, then the bottom field of the input frame will be used
+ * for deinterlacing.
*
* The set of gst_vaapi_filter_set_deinterlacing() flags.
*/
typedef enum {
GST_VAAPI_DEINTERLACE_FLAG_TFF = 1 << 31,
GST_VAAPI_DEINTERLACE_FLAG_ONEFIELD = 1 << 30,
+ GST_VAAPI_DEINTERLACE_FLAG_TOPFIELD = 1 << 29,
} GstVaapiDeinterlaceFlags;
#define GST_VAAPI_TYPE_DEINTERLACE_METHOD \
if (!(flags & GST_VAAPI_DEINTERLACE_FLAG_TFF))
va_flags |= VA_DEINTERLACING_BOTTOM_FIELD_FIRST;
- if (flags & GST_VAAPI_DEINTERLACE_FLAG_ONEFIELD) {
+ if (flags & GST_VAAPI_DEINTERLACE_FLAG_ONEFIELD)
va_flags |= VA_DEINTERLACING_ONE_FIELD;
- if (!(flags & GST_VAAPI_DEINTERLACE_FLAG_TFF))
- va_flags |= VA_DEINTERLACING_BOTTOM_FIELD;
- }
+
+ if (!(flags & GST_VAAPI_DEINTERLACE_FLAG_TOPFIELD))
+ va_flags |= VA_DEINTERLACING_BOTTOM_FIELD;
#endif
return va_flags;
}
if (deint) {
GstVaapiDeinterlaceMethod deint_method;
- deint_flags = (tff ? GST_VAAPI_DEINTERLACE_FLAG_TFF : 0);
+ deint_flags = (tff ? GST_VAAPI_DEINTERLACE_FLAG_TOPFIELD : 0);
if (!set_best_deint_method(postproc, flags, &deint_method))
goto error_op_deinterlace;
if (deint_method != postproc->deinterlace_method) {
outbuf_surface = gst_vaapi_video_meta_get_surface(outbuf_meta);
if (deint) {
- deint_flags = (tff ? 0 : GST_VAAPI_DEINTERLACE_FLAG_TFF);
+ deint_flags = (tff ? 0 : GST_VAAPI_DEINTERLACE_FLAG_TOPFIELD);
if (!gst_vaapi_filter_set_deinterlacing(postproc->filter,
postproc->deinterlace_method, deint_flags))
goto error_op_deinterlace;
static inline gboolean
parse_deinterlace(const gchar *str, GstVaapiDeinterlaceMethod *deinterlace_ptr)
{
- return parse_enum(str, GST_VAAPI_TYPE_DEINTERLACE_METHOD,
+ g_return_val_if_fail(deinterlace_ptr != NULL, FALSE);
+
+ return str && parse_enum(str, GST_VAAPI_TYPE_DEINTERLACE_METHOD,
GST_VAAPI_DEINTERLACE_METHOD_NONE, (gint *)deinterlace_ptr);
}
g_error("failed to set deinterlacing method");
}
else if (deinterlace_flags) {
- if (deinterlace_flags & GST_VAAPI_DEINTERLACE_FLAG_TFF)
+ if (deinterlace_flags & GST_VAAPI_DEINTERLACE_FLAG_TOPFIELD)
filter_flags = GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD;
else
filter_flags = GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD;
if (!(deinterlace_flags & GST_VAAPI_DEINTERLACE_FLAG_ONEFIELD))
surface_flags = GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD |
GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD;
- else if (deinterlace_flags & GST_VAAPI_DEINTERLACE_FLAG_TFF)
+ else if (deinterlace_flags & GST_VAAPI_DEINTERLACE_FLAG_TOPFIELD)
surface_flags = GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD;
else
surface_flags = GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD;