mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-04 01:32:42 +00:00
vtenc: enable the hw encoder on OSX
This commit is contained in:
parent
e47dbaed07
commit
bc7dbd7b51
1 changed files with 10 additions and 3 deletions
|
@ -520,9 +520,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,
|
||||
|
@ -532,8 +538,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) {
|
||||
|
@ -587,6 +593,7 @@ gst_vtenc_create_session (GstVTEnc * self)
|
|||
#endif
|
||||
|
||||
beach:
|
||||
CFRelease (encoder_spec);
|
||||
CFRelease (pb_attrs);
|
||||
|
||||
return session;
|
||||
|
|
Loading…
Reference in a new issue