Don't set the chosen texture-target into the wrong structure. The input caps may not be writable, and in any case - the intention was to configure the othercaps. Also, remove an extra unref - the othercaps ref is consumed by gst_caps_make_writable already.