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}
This commit is contained in:
parent
8bbf9e2c6e
commit
d6bb18479f
@ -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,
|
void EncodedImage::SetEncodeTime(int64_t encode_start_ms,
|
||||||
int64_t encode_finish_ms) {
|
int64_t encode_finish_ms) {
|
||||||
timing_.encode_start_ms = encode_start_ms;
|
timing_.encode_start_ms = encode_start_ms;
|
||||||
|
|||||||
@ -44,13 +44,6 @@ class EncodedImageBufferInterface : public rtc::RefCountInterface {
|
|||||||
// this non-const data method.
|
// this non-const data method.
|
||||||
virtual uint8_t* data() = 0;
|
virtual uint8_t* data() = 0;
|
||||||
virtual size_t size() const = 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.
|
// Basic implementation of EncodedImageBufferInterface.
|
||||||
@ -64,7 +57,7 @@ class EncodedImageBuffer : public EncodedImageBufferInterface {
|
|||||||
const uint8_t* data() const override;
|
const uint8_t* data() const override;
|
||||||
uint8_t* data() override;
|
uint8_t* data() override;
|
||||||
size_t size() const override;
|
size_t size() const override;
|
||||||
void Realloc(size_t t) override;
|
void Realloc(size_t t);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit EncodedImageBuffer(size_t size);
|
explicit EncodedImageBuffer(size_t size);
|
||||||
@ -146,11 +139,6 @@ class RTC_EXPORT EncodedImage {
|
|||||||
capacity_ = capacity;
|
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(
|
void SetEncodedData(
|
||||||
rtc::scoped_refptr<EncodedImageBufferInterface> encoded_data) {
|
rtc::scoped_refptr<EncodedImageBufferInterface> encoded_data) {
|
||||||
encoded_data_ = encoded_data;
|
encoded_data_ = encoded_data;
|
||||||
|
|||||||
@ -35,8 +35,6 @@ class EncodedImageBufferWrapper : public EncodedImageBufferInterface {
|
|||||||
uint8_t* data() override { return buffer_.data(); }
|
uint8_t* data() override { return buffer_.data(); }
|
||||||
size_t size() const override { return buffer_.size(); }
|
size_t size() const override { return buffer_.size(); }
|
||||||
|
|
||||||
void Realloc(size_t t) override { RTC_NOTREACHED(); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
rtc::Buffer buffer_;
|
rtc::Buffer buffer_;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user