Reland "Delete methods EncodedImage::Allocate and EncodedImageBufferInterface::Realloc"
This is a reland of d6bb18479f4d9e258ae3e05427c101fb9e635373 Chromium problem fixed in https://webrtc-review.googlesource.com/c/src/+/153485 Original change's description: > Delete methods EncodedImage::Allocate and EncodedImageBufferInterface::Realloc > > Bug: webrtc:9378 > Change-Id: I3b03656769623647fcbb4f9125a3e920b7650fe9 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155961 > Reviewed-by: Philip Eliasson <philipel@webrtc.org> > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > Commit-Queue: Niels Moller <nisse@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#29458} Bug: webrtc:9378 Change-Id: I062262e87e115666ed4c92985ca75328e8d0c65f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157441 Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29537}
This commit is contained in:
@ -81,15 +81,6 @@ void EncodedImage::Retain() {
|
||||
}
|
||||
}
|
||||
|
||||
void EncodedImage::Allocate(size_t capacity) {
|
||||
if (encoded_data_ && encoded_data_->HasOneRef()) {
|
||||
encoded_data_->Realloc(capacity);
|
||||
} else {
|
||||
encoded_data_ = EncodedImageBuffer::Create(capacity);
|
||||
}
|
||||
buffer_ = nullptr;
|
||||
}
|
||||
|
||||
void EncodedImage::SetEncodeTime(int64_t encode_start_ms,
|
||||
int64_t encode_finish_ms) {
|
||||
timing_.encode_start_ms = encode_start_ms;
|
||||
|
||||
@ -44,13 +44,6 @@ class EncodedImageBufferInterface : public rtc::RefCountInterface {
|
||||
// this non-const data method.
|
||||
virtual uint8_t* data() = 0;
|
||||
virtual size_t size() const = 0;
|
||||
// TODO(bugs.webrtc.org/9378): Delete from this interface, together with
|
||||
// EncodedImage::Allocate. Implemented properly only by the below concrete
|
||||
// class
|
||||
virtual void Realloc(size_t size) { RTC_NOTREACHED(); }
|
||||
// Will be implemented by RefCountedObject, which also implements
|
||||
// |rtc::RefCountInterface|.
|
||||
virtual bool HasOneRef() const = 0;
|
||||
};
|
||||
|
||||
// Basic implementation of EncodedImageBufferInterface.
|
||||
@ -64,7 +57,7 @@ class RTC_EXPORT EncodedImageBuffer : public EncodedImageBufferInterface {
|
||||
const uint8_t* data() const override;
|
||||
uint8_t* data() override;
|
||||
size_t size() const override;
|
||||
void Realloc(size_t t) override;
|
||||
void Realloc(size_t t);
|
||||
|
||||
protected:
|
||||
explicit EncodedImageBuffer(size_t size);
|
||||
@ -146,11 +139,6 @@ class RTC_EXPORT EncodedImage {
|
||||
capacity_ = capacity;
|
||||
}
|
||||
|
||||
// TODO(bugs.webrtc.org/9378): Delete; this method implies realloc, which
|
||||
// should not be generally supported by the EncodedImageBufferInterface.
|
||||
RTC_DEPRECATED
|
||||
void Allocate(size_t capacity);
|
||||
|
||||
void SetEncodedData(
|
||||
rtc::scoped_refptr<EncodedImageBufferInterface> encoded_data) {
|
||||
encoded_data_ = encoded_data;
|
||||
|
||||
@ -35,8 +35,6 @@ class EncodedImageBufferWrapper : public EncodedImageBufferInterface {
|
||||
uint8_t* data() override { return buffer_.data(); }
|
||||
size_t size() const override { return buffer_.size(); }
|
||||
|
||||
void Realloc(size_t t) override { RTC_NOTREACHED(); }
|
||||
|
||||
private:
|
||||
rtc::Buffer buffer_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user