summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.d@gmail.com>2014-11-11 18:01:54 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-11-19 17:24:37 +0100
commit63f460c5b069c5a6c8c5e9d7f79ce57266904379 (patch)
treee1cc2033187fd1ed6d37d9930d690ad5904853fd
parent90db9b19f57a49d9a43bf234020929d08da7c572 (diff)
vtenc: enable the hw encoder on OSX
-rw-r--r--sys/applemedia/vtenc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/applemedia/vtenc.c b/sys/applemedia/vtenc.c
index e9b841f7f..6ca5f5678 100644
--- a/sys/applemedia/vtenc.c
+++ b/sys/applemedia/vtenc.c
@@ -440,9 +440,15 @@ static VTCompressionSessionRef
gst_vtenc_create_session (GstVTEnc * self)
{
VTCompressionSessionRef session = NULL;
- CFMutableDictionaryRef pb_attrs;
+ CFMutableDictionaryRef encoder_spec, pb_attrs;
OSStatus status;
+ encoder_spec =
+ CFDictionaryCreateMutable (NULL, 0, &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ gst_vtutil_dict_set_boolean (encoder_spec,
+ kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, true);
+
pb_attrs = CFDictionaryCreateMutable (NULL, 0, &kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
gst_vtutil_dict_set_i32 (pb_attrs, kCVPixelBufferWidthKey,
@@ -452,8 +458,8 @@ gst_vtenc_create_session (GstVTEnc * self)
status = VTCompressionSessionCreate (NULL,
self->negotiated_width, self->negotiated_height,
- self->details->format_id, NULL, pb_attrs, NULL, gst_vtenc_enqueue_buffer,
- self, &session);
+ self->details->format_id, encoder_spec, pb_attrs, NULL,
+ gst_vtenc_enqueue_buffer, self, &session);
GST_INFO_OBJECT (self, "VTCompressionSessionCreate for %d x %d => %d",
self->negotiated_width, self->negotiated_height, (int) status);
if (status != noErr) {
@@ -503,6 +509,7 @@ gst_vtenc_create_session (GstVTEnc * self)
#endif
beach:
+ CFRelease (encoder_spec);
CFRelease (pb_attrs);
return session;