vp8enc: Rename keyframe-interval to max-keyframe-distance

And use default settings for buffer sizes until we expose this
somehow.
This commit is contained in:
Sebastian Dröge 2010-05-19 17:16:54 +02:00
parent ab14c8cf5a
commit 28736fa1d4

View file

@ -68,7 +68,7 @@ struct _GstVP8Enc
double quality; double quality;
gboolean error_resilient; gboolean error_resilient;
int max_latency; int max_latency;
int keyframe_interval; int max_keyframe_distance;
int speed; int speed;
/* state */ /* state */
@ -104,7 +104,7 @@ enum
#define DEFAULT_QUALITY 5 #define DEFAULT_QUALITY 5
#define DEFAULT_ERROR_RESILIENT FALSE #define DEFAULT_ERROR_RESILIENT FALSE
#define DEFAULT_MAX_LATENCY 10 #define DEFAULT_MAX_LATENCY 10
#define DEFAULT_KEYFRAME_INTERVAL 60 #define DEFAULT_MAX_KEYFRAME_DISTANCE 60
#define DEFAULT_SPEED 0 #define DEFAULT_SPEED 0
enum enum
@ -114,7 +114,7 @@ enum
PROP_QUALITY, PROP_QUALITY,
PROP_ERROR_RESILIENT, PROP_ERROR_RESILIENT,
PROP_MAX_LATENCY, PROP_MAX_LATENCY,
PROP_KEYFRAME_INTERVAL, PROP_MAX_KEYFRAME_DISTANCE,
PROP_SPEED PROP_SPEED
}; };
@ -237,10 +237,10 @@ gst_vp8_enc_class_init (GstVP8EncClass * klass)
0, 100, DEFAULT_MAX_LATENCY, 0, 100, DEFAULT_MAX_LATENCY,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_KEYFRAME_INTERVAL, g_object_class_install_property (gobject_class, PROP_MAX_KEYFRAME_DISTANCE,
g_param_spec_int ("keyframe-interval", "Key frame interval", g_param_spec_int ("max-keyframe-distance", "Maximum Key frame distance",
"Maximum distance between key frames", "Maximum distance between key frames",
1, 1000, DEFAULT_KEYFRAME_INTERVAL, 1, 9999, DEFAULT_MAX_KEYFRAME_DISTANCE,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_SPEED, g_object_class_install_property (gobject_class, PROP_SPEED,
@ -260,7 +260,7 @@ gst_vp8_enc_init (GstVP8Enc * gst_vp8_enc, GstVP8EncClass * klass)
gst_vp8_enc->quality = DEFAULT_QUALITY; gst_vp8_enc->quality = DEFAULT_QUALITY;
gst_vp8_enc->error_resilient = DEFAULT_ERROR_RESILIENT; gst_vp8_enc->error_resilient = DEFAULT_ERROR_RESILIENT;
gst_vp8_enc->max_latency = DEFAULT_MAX_LATENCY; gst_vp8_enc->max_latency = DEFAULT_MAX_LATENCY;
gst_vp8_enc->keyframe_interval = DEFAULT_KEYFRAME_INTERVAL; gst_vp8_enc->max_keyframe_distance = DEFAULT_MAX_KEYFRAME_DISTANCE;
/* FIXME: Add sink/src event vmethods */ /* FIXME: Add sink/src event vmethods */
gst_vp8_enc->base_sink_event_func = gst_vp8_enc->base_sink_event_func =
@ -306,8 +306,8 @@ gst_vp8_enc_set_property (GObject * object, guint prop_id,
case PROP_MAX_LATENCY: case PROP_MAX_LATENCY:
gst_vp8_enc->max_latency = g_value_get_int (value); gst_vp8_enc->max_latency = g_value_get_int (value);
break; break;
case PROP_KEYFRAME_INTERVAL: case PROP_MAX_KEYFRAME_DISTANCE:
gst_vp8_enc->keyframe_interval = g_value_get_int (value); gst_vp8_enc->max_keyframe_distance = g_value_get_int (value);
break; break;
case PROP_SPEED: case PROP_SPEED:
gst_vp8_enc->speed = g_value_get_int (value); gst_vp8_enc->speed = g_value_get_int (value);
@ -339,8 +339,8 @@ gst_vp8_enc_get_property (GObject * object, guint prop_id, GValue * value,
case PROP_MAX_LATENCY: case PROP_MAX_LATENCY:
g_value_set_int (value, gst_vp8_enc->max_latency); g_value_set_int (value, gst_vp8_enc->max_latency);
break; break;
case PROP_KEYFRAME_INTERVAL: case PROP_MAX_KEYFRAME_DISTANCE:
g_value_set_int (value, gst_vp8_enc->keyframe_interval); g_value_set_int (value, gst_vp8_enc->max_keyframe_distance);
break; break;
case PROP_SPEED: case PROP_SPEED:
g_value_set_int (value, gst_vp8_enc->speed); g_value_set_int (value, gst_vp8_enc->speed);
@ -631,13 +631,11 @@ gst_vp8_enc_handle_frame (GstBaseVideoEncoder * base_video_encoder,
cfg.rc_min_quantizer = 63 - encoder->quality * 5.0; cfg.rc_min_quantizer = 63 - encoder->quality * 5.0;
cfg.rc_max_quantizer = 63 - encoder->quality * 5.0; cfg.rc_max_quantizer = 63 - encoder->quality * 5.0;
cfg.rc_target_bitrate = encoder->bitrate; cfg.rc_target_bitrate = encoder->bitrate;
cfg.rc_buf_sz = 1000; // FIXME 1000 ms
cfg.rc_buf_initial_sz = 1000; // FIXME 1000 ms
} }
cfg.kf_mode = VPX_KF_AUTO; cfg.kf_mode = VPX_KF_AUTO;
cfg.kf_min_dist = 0; cfg.kf_min_dist = 0;
cfg.kf_max_dist = encoder->keyframe_interval; cfg.kf_max_dist = encoder->max_keyframe_distance;
status = vpx_codec_enc_init (&encoder->encoder, &vpx_codec_vp8_cx_algo, status = vpx_codec_enc_init (&encoder->encoder, &vpx_codec_vp8_cx_algo,
&cfg, 0); &cfg, 0);