}
#endif
-static void
+void
gst_nv_base_enc_schedule_reconfig (GstNvBaseEnc * nvenc)
{
g_atomic_int_set (&nvenc->reconfig, TRUE);
GType gst_nv_base_enc_register (const char * codec,
guint device_id);
+void gst_nv_base_enc_schedule_reconfig (GstNvBaseEnc * nvenc);
+
#endif /* __GST_NV_BASE_ENC_H_INCLUDED__ */
static GstElementClass *parent_class = NULL;
+enum
+{
+ PROP_0,
+ PROP_AUD,
+};
+
+#define DEFAULT_AUD TRUE
+
static gboolean gst_nv_h264_enc_open (GstVideoEncoder * enc);
static gboolean gst_nv_h264_enc_close (GstVideoEncoder * enc);
static gboolean gst_nv_h264_enc_set_src_caps (GstNvBaseEnc * nvenc,
nvenc_class->set_src_caps = gst_nv_h264_enc_set_src_caps;
nvenc_class->set_pic_params = gst_nv_h264_enc_set_pic_params;
+ g_object_class_install_property (gobject_class, PROP_AUD,
+ g_param_spec_boolean ("aud", "AUD",
+ "Use AU (Access Unit) delimiter", DEFAULT_AUD,
+ G_PARAM_READWRITE | GST_PARAM_MUTABLE_PLAYING |
+ G_PARAM_STATIC_STRINGS));
+
if (cdata->is_default)
long_name = g_strdup ("NVENC H.264 Video Encoder");
else
static void
gst_nv_h264_enc_init (GstNvH264Enc * nvenc)
{
+ nvenc->aud = DEFAULT_AUD;
}
static void
}
h264_config->idrPeriod = config->gopLength;
-
- /* FIXME: make property */
- h264_config->outputAUD = 1;
+ h264_config->outputAUD = h264enc->aud;
vui->videoSignalTypePresentFlag = 1;
/* NOTE: vui::video_format represents the video format before
gst_nv_h264_enc_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
+ GstNvH264Enc *self = (GstNvH264Enc *) object;
+ gboolean reconfig = FALSE;
+
switch (prop_id) {
+ case PROP_AUD:
+ {
+ gboolean aud;
+
+ aud = g_value_get_boolean (value);
+ if (aud != self->aud) {
+ self->aud = aud;
+ reconfig = TRUE;
+ }
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
+
+ if (reconfig)
+ gst_nv_base_enc_schedule_reconfig (GST_NV_BASE_ENC (self));
}
static void
gst_nv_h264_enc_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
+ GstNvH264Enc *self = (GstNvH264Enc *) object;
+
switch (prop_id) {
+ case PROP_AUD:
+ g_value_set_boolean (value, self->aud);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
typedef struct {
GstNvBaseEnc base_nvenc;
+ /* properties */
+ gboolean aud;
} GstNvH264Enc;
typedef struct {
static GstElementClass *parent_class = NULL;
+enum
+{
+ PROP_0,
+ PROP_AUD,
+};
+
+#define DEFAULT_AUD TRUE
+
static gboolean gst_nv_h265_enc_open (GstVideoEncoder * enc);
static gboolean gst_nv_h265_enc_close (GstVideoEncoder * enc);
static gboolean gst_nv_h265_enc_stop (GstVideoEncoder * enc);
nvenc_class->set_src_caps = gst_nv_h265_enc_set_src_caps;
nvenc_class->set_pic_params = gst_nv_h265_enc_set_pic_params;
+ g_object_class_install_property (gobject_class, PROP_AUD,
+ g_param_spec_boolean ("aud", "AUD",
+ "Use AU (Access Unit) delimiter", DEFAULT_AUD,
+ G_PARAM_READWRITE | GST_PARAM_MUTABLE_PLAYING |
+ G_PARAM_STATIC_STRINGS));
+
if (cdata->is_default)
long_name = g_strdup ("NVENC HEVC Video Encoder");
else
static void
gst_nv_h265_enc_init (GstNvH265Enc * nvenc)
{
+ nvenc->aud = DEFAULT_AUD;
}
static void
config->encodeCodecConfig.hevcConfig.pixelBitDepthMinus8 = 2;
}
- /* FIXME: make property */
- hevc_config->outputAUD = 1;
+ hevc_config->outputAUD = h265enc->aud;
vui->videoSignalTypePresentFlag = 1;
/* NOTE: vui::video_format represents the video format before
gst_nv_h265_enc_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
+ GstNvH265Enc *self = (GstNvH265Enc *) object;
+ gboolean reconfig = FALSE;
+
switch (prop_id) {
+ case PROP_AUD:
+ {
+ gboolean aud;
+
+ aud = g_value_get_boolean (value);
+ if (aud != self->aud) {
+ self->aud = aud;
+ reconfig = TRUE;
+ }
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
+
+ if (reconfig)
+ gst_nv_base_enc_schedule_reconfig (GST_NV_BASE_ENC (self));
}
static void
gst_nv_h265_enc_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
+ GstNvH265Enc *self = (GstNvH265Enc *) object;
+
switch (prop_id) {
+ case PROP_AUD:
+ g_value_set_boolean (value, self->aud);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
NV_ENC_SEI_PAYLOAD *sei_payload;
guint num_sei_payload;
+
+ /* properties */
+ gboolean aud;
} GstNvH265Enc;
typedef struct {