Skip to content

Commit

Permalink
#1257: expose tune setting via xpra info
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@13058 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jul 20, 2016
1 parent 77dd799 commit 4fab5ea
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/xpra/codecs/enc_x264/encoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ cdef class Encoder:
cdef object src_format
cdef object source
cdef object profile
cdef object tune
cdef double time
cdef int colorspace
cdef int preset
Expand Down Expand Up @@ -511,8 +512,8 @@ cdef class Encoder:
cdef x264_param_t param
cdef const char *preset
preset = get_preset_names()[self.preset]
tune = self.get_tune()
x264_param_default_preset(&param, preset, tune)
self.tune = self.get_tune()
x264_param_default_preset(&param, preset, self.tune)
param.i_width = self.width
param.i_height = self.height
param.i_csp = self.colorspace
Expand All @@ -524,7 +525,7 @@ cdef class Encoder:
self.context = x264_encoder_open(&param)
cdef int maxd = x264_encoder_maximum_delayed_frames(self.context)
log("x264 context=%#x, %7s %4ix%-4i quality=%i, speed=%i, source=%s", <unsigned long> self.context, self.src_format, self.width, self.height, self.quality, self.speed, self.source)
log(" preset=%s, profile=%s, tune=%s", preset, self.profile, tune)
log(" preset=%s, profile=%s, tune=%s", preset, self.profile, self.tune)
#print_nested_dict(options, " ", print_fn=log.error)
log(" me=%s, me_range=%s, mv_range=%s, opencl=%s, b-frames=%i, max delayed frames=%i",
ME_TYPES.get(param.analyse.i_me_method, param.analyse.i_me_method), param.analyse.i_me_range, param.analyse.i_mv_range, bool(self.opencl), self.b_frames, maxd)
Expand Down Expand Up @@ -592,6 +593,7 @@ cdef class Encoder:
info = get_info()
info.update({"profile" : self.profile,
"preset" : get_preset_names()[self.preset],
"tune" : self.tune or "",
"frames" : self.frames,
"width" : self.width,
"height" : self.height,
Expand Down Expand Up @@ -789,8 +791,8 @@ cdef class Encoder:
#retrieve current parameters:
x264_encoder_parameters(self.context, &param)
#apply new preset:
tune = self.get_tune()
x264_param_default_preset(&param, get_preset_names()[new_preset], tune)
self.tune = self.get_tune()
x264_param_default_preset(&param, get_preset_names()[new_preset], self.tune)
#ensure quality remains what it was:
set_f_rf(&param, get_x264_quality(self.quality, self.profile))
self.tune_param(&param)
Expand Down

0 comments on commit 4fab5ea

Please sign in to comment.