1 /* GStreamer H265 encoder plugin 2 * Copyright (C) 2005 Michal Benes <michal.benes@itonis.tv> 3 * Copyright (C) 2005 Josef Zlomek <josef.zlomek@itonis.tv> 4 * Copyright (C) 2014 Thijs Vermeir <thijs.vermeir@barco.com> 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 22 #ifndef __GST_X265_ENC_H__ 23 #define __GST_X265_ENC_H__ 24 25 #include <gst/gst.h> 26 #include <gst/video/video.h> 27 #include <gst/video/gstvideoencoder.h> 28 #include <x265.h> 29 30 G_BEGIN_DECLS 31 #define GST_TYPE_X265_ENC \ 32 (gst_x265_enc_get_type()) 33 #define GST_X265_ENC(obj) \ 34 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_X265_ENC,GstX265Enc)) 35 #define GST_X265_ENC_CLASS(klass) \ 36 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_X265_ENC,GstX265EncClass)) 37 #define GST_IS_X265_ENC(obj) \ 38 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_X265_ENC)) 39 #define GST_IS_X265_ENC_CLASS(klass) \ 40 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_X265_ENC)) 41 typedef struct _GstX265Enc GstX265Enc; 42 typedef struct _GstX265EncClass GstX265EncClass; 43 44 struct _GstX265Enc 45 { 46 GstVideoEncoder element; 47 48 /*< private > */ 49 x265_encoder *x265enc; 50 x265_param x265param; 51 GstClockTime dts_offset; 52 gboolean push_header; 53 const x265_api *api; 54 55 /* List of frame/buffer mapping structs for 56 * pending frames */ 57 GList *pending_frames; 58 59 /* properties */ 60 guint bitrate; 61 gint qp; 62 gint log_level; 63 gint tune; 64 gint speed_preset; 65 gint keyintmax; 66 GString *option_string_prop; /* option-string property */ 67 /*GString *option_string; *//* used by set prop */ 68 69 /* input description */ 70 GstVideoCodecState *input_state; 71 72 /* configuration changed while playing */ 73 gboolean reconfig; 74 75 /* from the downstream caps */ 76 GPtrArray *peer_profiles; 77 /*const x265_level_t *peer_level; */ 78 }; 79 80 struct _GstX265EncClass 81 { 82 GstVideoEncoderClass parent_class; 83 }; 84 85 GType gst_x265_enc_get_type (void); 86 87 GST_ELEMENT_REGISTER_DECLARE (x265enc); 88 89 G_END_DECLS 90 #endif /* __GST_X265_ENC_H__ */ 91