diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-03-02 10:37:00 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-03-02 11:34:10 +0100 |
commit | 271939d118647c6fdba8a873e1ad1052ba701f37 (patch) | |
tree | b4a866e47f95c32c0a61c9bc782646be122aee5d /ext | |
parent | f89c85485dd4936da22f0173a355fe0a13872198 (diff) |
theoradec: move some code
The parsing of the headers consists of negotiating the format and then setting
up the decoder so split this in two parts.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/theora/gsttheoradec.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c index 8ef9e00d5..c74737041 100644 --- a/ext/theora/gsttheoradec.c +++ b/ext/theora/gsttheoradec.c @@ -915,26 +915,6 @@ theora_handle_type_packet (GstTheoraDec * dec, ogg_packet * packet) dec->need_cropping = FALSE; } - /* done */ - dec->decoder = th_decode_alloc (&dec->info, dec->setup); - - if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MV, - &dec->telemetry_mv, sizeof (dec->telemetry_mv)) != TH_EIMPL) { - GST_WARNING_OBJECT (dec, "Could not enable MV visualisation"); - } - if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MBMODE, - &dec->telemetry_mbmode, sizeof (dec->telemetry_mbmode)) != TH_EIMPL) { - GST_WARNING_OBJECT (dec, "Could not enable MB mode visualisation"); - } - if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_QI, - &dec->telemetry_qi, sizeof (dec->telemetry_qi)) != TH_EIMPL) { - GST_WARNING_OBJECT (dec, "Could not enable QI mode visualisation"); - } - if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_BITS, - &dec->telemetry_bits, sizeof (dec->telemetry_bits)) != TH_EIMPL) { - GST_WARNING_OBJECT (dec, "Could not enable BITS mode visualisation"); - } - /* our info contains the dimensions for the coded picture before cropping */ gst_video_info_set_format (&dec->vinfo, format, dec->info.frame_width, dec->info.frame_height); @@ -966,6 +946,26 @@ theora_handle_type_packet (GstTheoraDec * dec, ogg_packet * packet) theora_negotiate_pool (dec); + /* done */ + dec->decoder = th_decode_alloc (&dec->info, dec->setup); + + if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MV, + &dec->telemetry_mv, sizeof (dec->telemetry_mv)) != TH_EIMPL) { + GST_WARNING_OBJECT (dec, "Could not enable MV visualisation"); + } + if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MBMODE, + &dec->telemetry_mbmode, sizeof (dec->telemetry_mbmode)) != TH_EIMPL) { + GST_WARNING_OBJECT (dec, "Could not enable MB mode visualisation"); + } + if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_QI, + &dec->telemetry_qi, sizeof (dec->telemetry_qi)) != TH_EIMPL) { + GST_WARNING_OBJECT (dec, "Could not enable QI mode visualisation"); + } + if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_BITS, + &dec->telemetry_bits, sizeof (dec->telemetry_bits)) != TH_EIMPL) { + GST_WARNING_OBJECT (dec, "Could not enable BITS mode visualisation"); + } + dec->have_header = TRUE; if (dec->pendingevents) { |