Delete EncodedImage methods buffer(), set_buffer() and mutable_data()
Bug: webrtc:9378 Change-Id: Iab21fe537f03a5cd130d8435cd94520952e693a9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168494 Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31164}
This commit is contained in:
parent
c1aaf4cb38
commit
49f574b3b3
@ -26,7 +26,7 @@
|
||||
#include "api/video/video_frame_type.h"
|
||||
#include "api/video/video_rotation.h"
|
||||
#include "api/video/video_timing.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "common_types.h" // NOLINT(build/include_directory)
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/deprecation.h"
|
||||
#include "rtc_base/ref_count.h"
|
||||
@ -136,11 +136,6 @@ class RTC_EXPORT EncodedImage {
|
||||
return buffer_ ? capacity_ : (encoded_data_ ? encoded_data_->size() : 0);
|
||||
}
|
||||
|
||||
void set_buffer(uint8_t* buffer, size_t capacity) {
|
||||
buffer_ = buffer;
|
||||
capacity_ = capacity;
|
||||
}
|
||||
|
||||
void SetEncodedData(
|
||||
rtc::scoped_refptr<EncodedImageBufferInterface> encoded_data) {
|
||||
encoded_data_ = encoded_data;
|
||||
@ -169,15 +164,6 @@ class RTC_EXPORT EncodedImage {
|
||||
return buffer_ ? buffer_
|
||||
: (encoded_data_ ? encoded_data_->data() : nullptr);
|
||||
}
|
||||
// TODO(nisse): At some places, code accepts a const ref EncodedImage, but
|
||||
// still writes to it, to clear padding at the end of the encoded data.
|
||||
// Padding is required by ffmpeg; the best way to deal with that is likely to
|
||||
// make this class ensure that buffers always have a few zero padding bytes.
|
||||
uint8_t* mutable_data() const { return const_cast<uint8_t*>(data()); }
|
||||
|
||||
// TODO(bugs.webrtc.org/9378): Delete. Used by code that wants to modify a
|
||||
// buffer corresponding to a const EncodedImage. Requires an un-owned buffer.
|
||||
uint8_t* buffer() const { return buffer_; }
|
||||
|
||||
// Hack to workaround lack of ownership of the encoded data. If we don't
|
||||
// already own the underlying data, make an owned copy.
|
||||
|
||||
@ -260,7 +260,9 @@ int32_t H264DecoderImpl::Decode(const EncodedImage& input_image,
|
||||
|
||||
AVPacket packet;
|
||||
av_init_packet(&packet);
|
||||
packet.data = input_image.mutable_data();
|
||||
// packet.data has a non-const type, but isn't modified by
|
||||
// avcodec_send_packet.
|
||||
packet.data = const_cast<uint8_t*>(input_image.data());
|
||||
if (input_image.size() >
|
||||
static_cast<size_t>(std::numeric_limits<int>::max())) {
|
||||
ReportError();
|
||||
|
||||
@ -193,7 +193,7 @@ EncodedImage MultiplexEncodedImagePacker::PackAndRelease(
|
||||
combined_image.SetEncodedData(buffer);
|
||||
|
||||
// header
|
||||
header_offset = PackHeader(combined_image.data(), header);
|
||||
header_offset = PackHeader(buffer->data(), header);
|
||||
RTC_DCHECK_EQ(header.first_component_header_offset,
|
||||
kMultiplexImageHeaderSize);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user