applemedia: Fix usage of HAVE_IOS define

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8229>
This commit is contained in:
Edward Hervey 2025-01-10 11:42:19 +01:00 committed by GStreamer Marge Bot
parent 1bbd586e9e
commit 7b17c198d7
9 changed files with 29 additions and 29 deletions

View file

@ -81,7 +81,7 @@ gst_av_capture_device_get_props (AVCaptureDevice *device)
g_free (unique_id);
g_free (model_id);
#if !HAVE_IOS
#ifndef HAVE_IOS
char *manufacturer = g_strdup ([[device manufacturer] UTF8String]);
gst_structure_set (props,
"avf.manufacturer", G_TYPE_STRING, manufacturer,

View file

@ -27,7 +27,7 @@
#import <AVFoundation/AVFoundation.h>
#import <CoreMedia/CoreMedia.h>
#if !HAVE_IOS
#ifndef HAVE_IOS
#import <AppKit/AppKit.h>
#endif
#include <gst/video/video.h>
@ -57,7 +57,7 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (
#if !HAVE_IOS
#ifndef HAVE_IOS
GST_VIDEO_CAPS_MAKE_WITH_FEATURES
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
"UYVY") ", "
@ -233,7 +233,7 @@ gst_avf_video_source_device_type_get_type (void)
- (BOOL)openDevice;
- (void)closeDevice;
- (GstVideoFormat)getGstVideoFormat:(NSNumber *)pixel_format;
#if !HAVE_IOS
#ifndef HAVE_IOS
- (CGDirectDisplayID)getDisplayIdFromDeviceIndex;
- (float)getScaleFactorFromDeviceIndex;
#endif
@ -257,7 +257,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
@end
#if HAVE_IOS
#ifdef HAVE_IOS
static AVCaptureDeviceType GstAVFVideoSourceDeviceType2AVCaptureDeviceType(GstAVFVideoSourceDeviceType deviceType) {
switch (deviceType) {
@ -451,7 +451,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
- (BOOL)openScreenInput
{
#if HAVE_IOS
#ifdef HAVE_IOS
return NO;
#else
CGDirectDisplayID displayId;
@ -598,7 +598,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
return gst_format;
}
#if !HAVE_IOS
#ifndef HAVE_IOS
- (CGDirectDisplayID)getDisplayIdFromDeviceIndex
{
NSDictionary *description;
@ -699,7 +699,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
pixel_formats = output.availableVideoCVPixelFormatTypes;
if (captureScreen) {
#if !HAVE_IOS
#ifndef HAVE_IOS
CGRect rect;
AVCaptureScreenInput *screenInput = (AVCaptureScreenInput *)input;
if (CGRectIsEmpty (screenInput.cropRect)) {
@ -751,7 +751,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
forKey:(NSString*)kCVPixelBufferPixelFormatTypeKey];
if (captureScreen) {
#if !HAVE_IOS
#ifndef HAVE_IOS
AVCaptureScreenInput *screenInput = (AVCaptureScreenInput *)input;
screenInput.minFrameDuration = CMTimeMake(info.fps_d, info.fps_n);
#else
@ -1145,7 +1145,7 @@ enum
PROP_DEVICE_TYPE,
PROP_DO_STATS,
PROP_FPS,
#if !HAVE_IOS
#ifndef HAVE_IOS
PROP_CAPTURE_SCREEN,
PROP_CAPTURE_SCREEN_CURSOR,
PROP_CAPTURE_SCREEN_MOUSE_CLICKS,
@ -1258,7 +1258,7 @@ gst_avf_video_src_class_init (GstAVFVideoSrcClass * klass)
g_param_spec_int ("fps", "Frames per second",
"Last measured framerate, if statistics are enabled",
-1, G_MAXINT, -1, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
#if !HAVE_IOS
#ifndef HAVE_IOS
g_object_class_install_property (gobject_class, PROP_CAPTURE_SCREEN,
g_param_spec_boolean ("capture-screen", "Enable screen capture",
"Enable screen capture functionality", FALSE,
@ -1349,7 +1349,7 @@ gst_avf_video_src_get_property (GObject * object, guint prop_id, GValue * value,
GstAVFVideoSrcImpl *impl = GST_AVF_VIDEO_SRC_IMPL (object);
switch (prop_id) {
#if !HAVE_IOS
#ifndef HAVE_IOS
case PROP_CAPTURE_SCREEN:
g_value_set_boolean (value, impl.captureScreen);
break;
@ -1408,7 +1408,7 @@ gst_avf_video_src_set_property (GObject * object, guint prop_id,
GstAVFVideoSrcImpl *impl = GST_AVF_VIDEO_SRC_IMPL (object);
switch (prop_id) {
#if !HAVE_IOS
#ifndef HAVE_IOS
case PROP_CAPTURE_SCREEN:
impl.captureScreen = g_value_get_boolean (value);
break;
@ -1565,7 +1565,7 @@ gst_av_capture_device_get_caps (AVCaptureDevice *device, AVCaptureVideoDataOutpu
{
GstCaps *result_caps, *result_gl_caps;
gboolean is_gl_format;
#if !HAVE_IOS
#ifndef HAVE_IOS
GstVideoFormat gl_formats[] = { GST_VIDEO_FORMAT_UYVY, GST_VIDEO_FORMAT_YUY2, 0 };
#else
GstVideoFormat gl_formats[] = { GST_VIDEO_FORMAT_NV12, 0 };
@ -1629,7 +1629,7 @@ gst_av_capture_device_get_caps (AVCaptureDevice *device, AVCaptureVideoDataOutpu
NULL));
gst_caps_set_simple (caps,
"texture-target", G_TYPE_STRING,
#if !HAVE_IOS
#ifndef HAVE_IOS
GST_GL_TEXTURE_TARGET_RECTANGLE_STR,
#else
GST_GL_TEXTURE_TARGET_2D_STR,

View file

@ -22,13 +22,13 @@
#endif
#include "corevideobuffer.h"
#include "corevideomemory.h"
#if !HAVE_IOS
#ifndef HAVE_IOS
#include "iosurfaceglmemory.h"
#endif
#include "videotexturecache-gl.h"
#if defined(APPLEMEDIA_MOLTENVK)
#include "videotexturecache-vulkan.h"
#if !HAVE_IOS
#ifndef HAVE_IOS
#include "iosurfacevulkanmemory.h"
#endif
#endif
@ -110,7 +110,7 @@ static GstMemory *
_create_glmem (GstAppleCoreVideoPixelBuffer * gpixbuf,
GstVideoInfo * info, guint plane, gsize size, GstVideoTextureCache * cache)
{
#if HAVE_IOS
#ifdef HAVE_IOS
return gst_video_texture_cache_create_memory (cache, gpixbuf, plane, size);
#else
GstIOSurfaceGLMemory *mem;

View file

@ -40,7 +40,7 @@ typedef struct _GstVideoTextureCacheGL
GstVideoTextureCache parent;
GstGLContext *ctx;
#if HAVE_IOS
#ifdef HAVE_IOS
CVOpenGLESTextureCacheRef cache;
#else
GstBufferPool *pool;

View file

@ -25,7 +25,7 @@
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
#if !HAVE_IOS
#ifndef HAVE_IOS
#import <AppKit/AppKit.h>
#include "iosurfaceglmemory.h"
#endif
@ -48,7 +48,7 @@ typedef struct _ContextThreadData
typedef struct _TextureWrapper
{
#if HAVE_IOS
#ifdef HAVE_IOS
CVOpenGLESTextureCacheRef cache;
CVOpenGLESTextureRef texture;
#else
@ -80,7 +80,7 @@ gst_video_texture_cache_gl_finalize (GObject * object)
{
GstVideoTextureCacheGL *cache_gl = GST_VIDEO_TEXTURE_CACHE_GL (object);
#if HAVE_IOS
#ifdef HAVE_IOS
CFRelease (cache_gl->cache); /* iOS has no "CVOpenGLESTextureCacheRelease" */
#else
#if 0
@ -132,7 +132,7 @@ gst_video_texture_cache_gl_constructed (GObject * object)
g_return_if_fail (GST_IS_GL_CONTEXT (cache_gl->ctx));
#if HAVE_IOS
#ifdef HAVE_IOS
CFMutableDictionaryRef cache_attrs =
CFDictionaryCreateMutable (NULL, 0, &kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
@ -170,7 +170,7 @@ gst_video_texture_cache_gl_class_init (GstVideoTextureCacheGLClass *klass)
cache_class->create_memory = gst_video_texture_cache_gl_create_memory;
}
#if HAVE_IOS
#ifdef HAVE_IOS
static void
gst_video_texture_cache_gl_release_texture (TextureWrapper *data)
{
@ -257,7 +257,7 @@ gst_video_texture_cache_gl_create_memory (GstVideoTextureCache * cache,
GstVideoTextureCacheGL *cache_gl = GST_VIDEO_TEXTURE_CACHE_GL (cache);
ContextThreadData data = {cache_gl, gpixbuf, plane, size, NULL};
#if HAVE_IOS
#ifdef HAVE_IOS
gst_gl_context_thread_add (cache_gl->ctx,
(GstGLContextThreadFunc) _do_create_memory, &data);
#endif

View file

@ -23,7 +23,7 @@
#include <Metal/Metal.h>
#if !HAVE_IOS
#ifndef HAVE_IOS
#import <AppKit/AppKit.h>
#endif
#include "iosurfacevulkanmemory.h"

View file

@ -21,7 +21,7 @@
# include "config.h"
#endif
#if !HAVE_IOS
#ifndef HAVE_IOS
#import <AppKit/AppKit.h>
#endif
#include "videotexturecache.h"

View file

@ -555,7 +555,7 @@ gst_vtdec_negotiate (GstVideoDecoder * decoder)
GST_CAPS_FEATURE_MEMORY_GL_MEMORY);
if (output_textures)
gst_caps_set_simple (output_state->caps, "texture-target", G_TYPE_STRING,
#if !HAVE_IOS
#ifndef HAVE_IOS
GST_GL_TEXTURE_TARGET_RECTANGLE_STR,
#else
GST_GL_TEXTURE_TARGET_2D_STR,

View file

@ -1532,7 +1532,7 @@ gst_vtenc_create_session (GstVTEnc * self)
const GstVTEncoderDetails *codec_details =
GST_VTENC_CLASS_GET_CODEC_DETAILS (G_OBJECT_GET_CLASS (self));
#if !HAVE_IOS
#ifndef HAVE_IOS
/* Apple's M1 hardware encoding fails when provided with an interlaced ProRes source.
* It's most likely a bug in VideoToolbox, as no such limitation has been officially mentioned anywhere.
* For now let's disable HW encoding entirely when such case occurs. */