svtav1enc: Avoid svtav1 defining TRUE/FALSE

Make sure we include the svt headers first and then undefine TRUE
and FALSE so we will only ever be using glib's defines for those.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5424>
This commit is contained in:
Jordan Petridis 2023-09-29 15:07:42 +02:00 committed by GStreamer Marge Bot
parent 2cd81eb1ac
commit 1fb7cda048
2 changed files with 19 additions and 4 deletions

View file

@ -21,10 +21,10 @@
#include "config.h"
#include "gstsvtav1enc.h"
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/video/gstvideoencoder.h>
#include "gstsvtav1enc.h"
#if !SVT_AV1_CHECK_VERSION(1,2,1)
#define SVT_AV1_RC_MODE_CQP_OR_CRF 0

View file

@ -7,13 +7,28 @@
#ifndef _GST_SVTAV1ENC_H_
#define _GST_SVTAV1ENC_H_
#include <EbSvtAv1.h>
#include <EbSvtAv1Enc.h>
/*
* SVT-AV1 headers define TRUE and FALSE defines which can conflict
* or replace glib's defines. This is why we include the SVT-AV1
* headers first and the glib.h so we will only be using glib's
* TRUE/FALSE defines.
*/
#ifdef TRUE
#undef TRUE
#endif
#ifdef FALSE
#undef FALSE
#endif
#include <glib.h>
#include <string.h>
#include <gst/video/video.h>
#include <gst/video/gstvideoencoder.h>
#include <EbSvtAv1.h>
#include <EbSvtAv1Enc.h>
G_BEGIN_DECLS
#define GST_TYPE_SVTAV1ENC (gst_svtav1enc_get_type())