summaryrefslogtreecommitdiff
path: root/ext/dirac
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2011-03-24 09:21:04 +0100
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2011-05-16 20:32:20 +0200
commit4b5623d6879892cbe119041d78996bc8db3ded1a (patch)
tree9d6029e7207968979cd9fdec68ed8955a6858143 /ext/dirac
parentd567fa2834d7a6c772e1c74edba171e33dd9005a (diff)
downloadgstreamer-plugins-bad-4b5623d6879892cbe119041d78996bc8db3ded1a.tar.gz
basevideoencoder: invoke subclass start method at state change
While this changes order w.r.t. set_format, which is OK for unstable API, it has following merits: * symmetric w.r.t. stop at state change * in line with other base class practice * little benefit in invoking 2 subclass virtual methods (set_format and start) in immediate succession; all actions in the second could be done in the first whereas subclass has no chance to do anything 'global' at activation time Moreover, current -bad subclass relevant methods either trivially commute or are either trivially adjusted accordingly.
Diffstat (limited to 'ext/dirac')
-rw-r--r--ext/dirac/gstdiracenc.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/dirac/gstdiracenc.cc b/ext/dirac/gstdiracenc.cc
index 3a112cdf1..f9122ee2f 100644
--- a/ext/dirac/gstdiracenc.cc
+++ b/ext/dirac/gstdiracenc.cc
@@ -421,6 +421,10 @@ gst_dirac_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
dirac_enc->enc_ctx.decode_flag = 0;
dirac_enc->enc_ctx.instr_flag = 0;
+ dirac_enc->granule_offset = ~0;
+
+ dirac_enc->encoder = dirac_encoder_init (&dirac_enc->enc_ctx, FALSE);
+
return TRUE;
}
@@ -821,12 +825,6 @@ error:
static gboolean
gst_dirac_enc_start (GstBaseVideoEncoder * base_video_encoder)
{
- GstDiracEnc *dirac_enc = GST_DIRAC_ENC (base_video_encoder);
-
- dirac_enc->granule_offset = ~0;
-
- dirac_enc->encoder = dirac_encoder_init (&dirac_enc->enc_ctx, FALSE);
-
return TRUE;
}