2010-10-27 17:30:11 +00:00
|
|
|
/*
|
2013-02-16 01:44:19 +00:00
|
|
|
* Copyright (C) 2010 Ole André Vadla Ravnås <oleavr@soundrop.com>
|
2010-10-27 17:30:11 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 20:38:00 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2010-10-27 17:30:11 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_VTENC_H__
|
|
|
|
#define __GST_VTENC_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2013-10-02 02:49:34 +00:00
|
|
|
#include <gst/video/video.h>
|
2014-09-16 12:02:46 +00:00
|
|
|
#include <VideoToolbox/VideoToolbox.h>
|
2010-10-27 17:30:11 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GST_VTENC_CAST(obj) \
|
|
|
|
((GstVTEnc *) (obj))
|
|
|
|
#define GST_VTENC_CLASS_GET_CODEC_DETAILS(klass) \
|
|
|
|
((const GstVTEncoderDetails *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass), \
|
|
|
|
GST_VTENC_CODEC_DETAILS_QDATA))
|
|
|
|
|
|
|
|
typedef struct _GstVTEncoderDetails GstVTEncoderDetails;
|
|
|
|
|
|
|
|
typedef struct _GstVTEncClassParams GstVTEncClassParams;
|
|
|
|
typedef struct _GstVTEncClass GstVTEncClass;
|
|
|
|
typedef struct _GstVTEnc GstVTEnc;
|
|
|
|
|
|
|
|
struct _GstVTEncoderDetails
|
|
|
|
{
|
|
|
|
const gchar * name;
|
|
|
|
const gchar * element_name;
|
|
|
|
const gchar * mimetype;
|
2014-09-16 12:02:46 +00:00
|
|
|
CMVideoCodecType format_id;
|
2016-06-01 11:43:32 +00:00
|
|
|
gboolean require_hardware;
|
2010-10-27 17:30:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstVTEncClass
|
|
|
|
{
|
2014-09-16 13:51:28 +00:00
|
|
|
GstVideoEncoderClass parent_class;
|
2010-10-27 17:30:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstVTEnc
|
|
|
|
{
|
2014-09-16 13:51:28 +00:00
|
|
|
GstVideoEncoder parent;
|
2010-10-27 17:30:11 +00:00
|
|
|
|
|
|
|
const GstVTEncoderDetails * details;
|
|
|
|
|
2014-12-10 11:36:53 +00:00
|
|
|
CFStringRef profile_level;
|
2010-10-27 17:30:11 +00:00
|
|
|
guint bitrate;
|
2014-11-06 12:22:17 +00:00
|
|
|
gboolean allow_frame_reordering;
|
|
|
|
gboolean realtime;
|
2014-11-27 12:40:56 +00:00
|
|
|
gdouble quality;
|
2014-12-05 15:33:20 +00:00
|
|
|
gint max_keyframe_interval;
|
|
|
|
GstClockTime max_keyframe_interval_duration;
|
2014-12-10 08:44:01 +00:00
|
|
|
gint latency_frames;
|
2010-10-27 17:30:11 +00:00
|
|
|
|
|
|
|
gboolean dump_properties;
|
|
|
|
gboolean dump_attributes;
|
|
|
|
|
|
|
|
gint negotiated_width, negotiated_height;
|
|
|
|
gint negotiated_fps_n, negotiated_fps_d;
|
|
|
|
gint caps_width, caps_height;
|
|
|
|
gint caps_fps_n, caps_fps_d;
|
2014-09-16 13:51:28 +00:00
|
|
|
GstVideoCodecState *input_state;
|
2013-10-02 02:49:34 +00:00
|
|
|
GstVideoInfo video_info;
|
2010-11-02 22:08:30 +00:00
|
|
|
VTCompressionSessionRef session;
|
2015-04-25 19:55:28 +00:00
|
|
|
CFDictionaryRef keyframe_props;
|
2010-10-27 17:30:11 +00:00
|
|
|
|
2014-09-17 14:08:57 +00:00
|
|
|
GAsyncQueue * cur_outframes;
|
2010-10-27 17:30:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void gst_vtenc_register_elements (GstPlugin * plugin);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GST_VTENC_H__ */
|