Add error reporting on VP8 encoder configuration error
Bug: webrtc:11310 Change-Id: I4ceb565b211a2313add193a3859f3baeaacc3e87 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182001 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Florent Castelli <orphis@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31964}
This commit is contained in:

committed by
Commit Bot

parent
7ad1011a19
commit
eeedb6ea33
@ -195,6 +195,10 @@ class LibvpxVp8Facade : public LibvpxInterface {
|
|||||||
vpx_codec_iter_t* iter) const override {
|
vpx_codec_iter_t* iter) const override {
|
||||||
return ::vpx_codec_get_cx_data(ctx, iter);
|
return ::vpx_codec_get_cx_data(ctx, iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* codec_error_detail(vpx_codec_ctx_t* ctx) const override {
|
||||||
|
return ::vpx_codec_error_detail(ctx);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -93,6 +93,8 @@ class LibvpxInterface {
|
|||||||
vpx_codec_ctx_t* ctx,
|
vpx_codec_ctx_t* ctx,
|
||||||
vpx_codec_iter_t* iter) const = 0;
|
vpx_codec_iter_t* iter) const = 0;
|
||||||
|
|
||||||
|
virtual const char* codec_error_detail(vpx_codec_ctx_t* ctx) const = 0;
|
||||||
|
|
||||||
// Returns interface wrapping the actual libvpx functions.
|
// Returns interface wrapping the actual libvpx functions.
|
||||||
static std::unique_ptr<LibvpxInterface> CreateEncoder();
|
static std::unique_ptr<LibvpxInterface> CreateEncoder();
|
||||||
};
|
};
|
||||||
|
@ -419,7 +419,9 @@ void LibvpxVp8Encoder::SetRates(const RateControlParameters& parameters) {
|
|||||||
vpx_codec_err_t err =
|
vpx_codec_err_t err =
|
||||||
libvpx_->codec_enc_config_set(&encoders_[i], &vpx_configs_[i]);
|
libvpx_->codec_enc_config_set(&encoders_[i], &vpx_configs_[i]);
|
||||||
if (err != VPX_CODEC_OK) {
|
if (err != VPX_CODEC_OK) {
|
||||||
RTC_LOG(LS_WARNING) << "Error configuring codec, error code: " << err;
|
RTC_LOG(LS_WARNING) << "Error configuring codec, error code: " << err
|
||||||
|
<< ", details: "
|
||||||
|
<< libvpx_->codec_error_detail(&encoders_[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,10 @@ class MockLibvpxVp8Interface : public LibvpxInterface {
|
|||||||
codec_get_cx_data,
|
codec_get_cx_data,
|
||||||
(vpx_codec_ctx_t*, vpx_codec_iter_t*),
|
(vpx_codec_ctx_t*, vpx_codec_iter_t*),
|
||||||
(const, override));
|
(const, override));
|
||||||
|
MOCK_METHOD(const char*,
|
||||||
|
codec_error_detail,
|
||||||
|
(vpx_codec_ctx_t*),
|
||||||
|
(const, override));
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
Reference in New Issue
Block a user