PROP_IDCT_METHOD
};
-static void gst_jpegenc_reset (GstJpegEnc * enc);
static void gst_jpegenc_finalize (GObject * object);
static void gst_jpegenc_resync (GstJpegEnc * jpegenc);
static gboolean gst_jpegenc_start (GstVideoEncoder * benc);
static gboolean gst_jpegenc_stop (GstVideoEncoder * benc);
+static gboolean gst_jpegenc_reset (GstVideoEncoder * benc, gboolean hard);
static gboolean gst_jpegenc_set_format (GstVideoEncoder * encoder,
GstVideoCodecState * state);
static GstFlowReturn gst_jpegenc_handle_frame (GstVideoEncoder * encoder,
venc_class->start = gst_jpegenc_start;
venc_class->stop = gst_jpegenc_stop;
+ venc_class->reset = gst_jpegenc_reset;
venc_class->set_format = gst_jpegenc_set_format;
venc_class->handle_frame = gst_jpegenc_handle_frame;
venc_class->propose_allocation = gst_jpegenc_propose_allocation;
jpegenc->quality = JPEG_DEFAULT_QUALITY;
jpegenc->smoothing = JPEG_DEFAULT_SMOOTHING;
jpegenc->idct_method = JPEG_DEFAULT_IDCT_METHOD;
-
- gst_jpegenc_reset (jpegenc);
}
-static void
-gst_jpegenc_reset (GstJpegEnc * enc)
+static gboolean
+gst_jpegenc_reset (GstVideoEncoder * benc, gboolean hard)
{
- gint i, j;
+ GstJpegEnc *enc = (GstJpegEnc *) benc;
- g_free (enc->line[0]);
- g_free (enc->line[1]);
- g_free (enc->line[2]);
- enc->line[0] = NULL;
- enc->line[1] = NULL;
- enc->line[2] = NULL;
- for (i = 0; i < 3; i++) {
- for (j = 0; j < 4 * DCTSIZE; j++) {
- g_free (enc->row[i][j]);
- enc->row[i][j] = NULL;
- }
- }
enc->sof_marker = -1;
+
+ return TRUE;
}
static void
gst_jpegenc_stop (GstVideoEncoder * benc)
{
GstJpegEnc *enc = (GstJpegEnc *) benc;
+ gint i, j;
- gst_jpegenc_reset (enc);
+ g_free (enc->line[0]);
+ g_free (enc->line[1]);
+ g_free (enc->line[2]);
+ enc->line[0] = NULL;
+ enc->line[1] = NULL;
+ enc->line[2] = NULL;
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 4 * DCTSIZE; j++) {
+ g_free (enc->row[i][j]);
+ enc->row[i][j] = NULL;
+ }
+ }
return TRUE;
}