const CFStringRef
kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder =
CFSTR ("EnableHardwareAcceleratedVideoEncoder");
+const CFStringRef
+ kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder =
+CFSTR ("RequireHardwareAcceleratedVideoEncoder");
const CFStringRef kVTCompressionPropertyKey_ProfileLevel =
CFSTR ("ProfileLevel");
const CFStringRef kVTProfileLevel_H264_Baseline_AutoLevel =
self->session = session;
GST_OBJECT_UNLOCK (self);
- return TRUE;
+ return session != NULL;
}
static gboolean
VTCompressionSessionRef session = NULL;
CFMutableDictionaryRef encoder_spec = NULL, pb_attrs;
OSStatus status;
+ const GstVTEncoderDetails *codec_details =
+ GST_VTENC_CLASS_GET_CODEC_DETAILS (G_OBJECT_GET_CLASS (self));
#if !HAVE_IOS
encoder_spec =
&kCFTypeDictionaryValueCallBacks);
gst_vtutil_dict_set_boolean (encoder_spec,
kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, true);
+ if (codec_details->require_hardware)
+ gst_vtutil_dict_set_boolean (encoder_spec,
+ kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder,
+ TRUE);
#endif
pb_attrs = CFDictionaryCreateMutable (NULL, 0, &kCFTypeDictionaryKeyCallBacks,
}
static const GstVTEncoderDetails gst_vtenc_codecs[] = {
- {"H.264", "h264", "video/x-h264", kCMVideoCodecType_H264},
+ {"H.264", "h264", "video/x-h264", kCMVideoCodecType_H264, FALSE},
+#ifndef HAVE_IOS
+ {"H.264 (HW only)", "h264_hw", "video/x-h264", kCMVideoCodecType_H264, TRUE},
+#endif
};
void