mirror of
https://github.com/pion/mediadevices.git
synced 2026-04-22 15:57:27 +08:00
Fix av1 SVT_AV1_PRED_LOW_DELAY_B deprecation in their latest release (4.0.0+) (#680)
* Change * Remove * Polyfill based on docs recommendation * Update comment * Update pkg/codec/svtav1/bridge.h comment to actual repo Co-authored-by: Atsushi Watanabe <atsushi.w@ieee.org> --------- Co-authored-by: Atsushi Watanabe <atsushi.w@ieee.org>
This commit is contained in:
@@ -4,6 +4,13 @@
|
||||
#include <EbSvtAv1Enc.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
// For SVT-AV1 v4.0.0+ support
|
||||
// See below for documentation of low delay value:
|
||||
// https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/Docs/Parameters.md#gop-size-and-type-options
|
||||
#ifndef SVT_AV1_PRED_LOW_DELAY
|
||||
#define SVT_AV1_PRED_LOW_DELAY 1
|
||||
#endif
|
||||
|
||||
#define ERR_INIT_ENC_HANDLER 1
|
||||
#define ERR_SET_ENC_PARAM 2
|
||||
#define ERR_ENC_INIT 3
|
||||
|
||||
@@ -40,7 +40,7 @@ func newEncoder(r video.Reader, p prop.Media, params Params) (codec.ReadCloser,
|
||||
enc.param.profile = C.MAIN_PROFILE
|
||||
enc.param.enc_mode = C.int8_t(params.Preset)
|
||||
enc.param.rate_control_mode = C.SVT_AV1_RC_MODE_CBR
|
||||
enc.param.pred_structure = C.SVT_AV1_PRED_LOW_DELAY_B
|
||||
enc.param.pred_structure = C.SVT_AV1_PRED_LOW_DELAY
|
||||
enc.param.target_bit_rate = C.uint32_t(params.BitRate)
|
||||
enc.param.frame_rate_numerator = C.uint32_t(p.FrameRate * 1000)
|
||||
enc.param.frame_rate_denominator = 1000
|
||||
|
||||
Reference in New Issue
Block a user