Extend I420 frame buffer pool to also create NV12 buffers
Bug: webrtc:11956 Change-Id: I758a28f2755cfa72ad486fbe1f9209f356eb5fa1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184510 Reviewed-by: Stefan Holmer <stefan@webrtc.org> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32147}
This commit is contained in:

committed by
Commit Bot

parent
c5a74ffba4
commit
4c87d83d03
@ -19,7 +19,7 @@
|
||||
#include "api/video/i420_buffer.h"
|
||||
#include "api/video_codecs/video_codec.h"
|
||||
#include "api/video_codecs/video_decoder.h"
|
||||
#include "common_video/include/i420_buffer_pool.h"
|
||||
#include "common_video/include/video_frame_buffer_pool.h"
|
||||
#include "modules/video_coding/include/video_error_codes.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "third_party/libaom/source/libaom/aom/aom_decoder.h"
|
||||
@ -59,7 +59,7 @@ class LibaomAv1Decoder final : public VideoDecoder {
|
||||
aom_codec_ctx_t context_;
|
||||
bool inited_;
|
||||
// Pool of memory buffers to store decoded image data for application access.
|
||||
I420BufferPool buffer_pool_;
|
||||
VideoFrameBufferPool buffer_pool_;
|
||||
DecodedImageCallback* decode_complete_callback_;
|
||||
};
|
||||
|
||||
@ -138,7 +138,7 @@ int32_t LibaomAv1Decoder::Decode(const EncodedImage& encoded_image,
|
||||
|
||||
// Allocate memory for decoded frame.
|
||||
rtc::scoped_refptr<I420Buffer> buffer =
|
||||
buffer_pool_.CreateBuffer(decoded_image->d_w, decoded_image->d_h);
|
||||
buffer_pool_.CreateI420Buffer(decoded_image->d_w, decoded_image->d_h);
|
||||
if (!buffer.get()) {
|
||||
// Pool has too many pending frames.
|
||||
RTC_LOG(LS_WARNING) << "LibaomAv1Decoder::Decode returned due to lack of"
|
||||
|
@ -103,7 +103,7 @@ int H264DecoderImpl::AVGetBuffer2(AVCodecContext* context,
|
||||
// TODO(nisse): Delete that feature from the video pool, instead add
|
||||
// an explicit call to InitializeData here.
|
||||
rtc::scoped_refptr<I420Buffer> frame_buffer =
|
||||
decoder->pool_.CreateBuffer(width, height);
|
||||
decoder->pool_.CreateI420Buffer(width, height);
|
||||
|
||||
int y_size = width * height;
|
||||
int uv_size = frame_buffer->ChromaWidth() * frame_buffer->ChromaHeight();
|
||||
|
@ -44,7 +44,7 @@ extern "C" {
|
||||
} // extern "C"
|
||||
|
||||
#include "common_video/h264/h264_bitstream_parser.h"
|
||||
#include "common_video/include/i420_buffer_pool.h"
|
||||
#include "common_video/include/video_frame_buffer_pool.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -92,7 +92,7 @@ class H264DecoderImpl : public H264Decoder {
|
||||
void ReportInit();
|
||||
void ReportError();
|
||||
|
||||
I420BufferPool pool_;
|
||||
VideoFrameBufferPool pool_;
|
||||
std::unique_ptr<AVCodecContext, AVCodecContextDeleter> av_context_;
|
||||
std::unique_ptr<AVFrame, AVFrameDeleter> av_frame_;
|
||||
|
||||
|
@ -329,7 +329,8 @@ int LibvpxVp8Decoder::ReturnFrame(
|
||||
last_frame_height_ = img->d_h;
|
||||
// Allocate memory for decoded image.
|
||||
rtc::scoped_refptr<I420Buffer> buffer =
|
||||
buffer_pool_.CreateBuffer(img->d_w, img->d_h);
|
||||
buffer_pool_.CreateI420Buffer(img->d_w, img->d_h);
|
||||
|
||||
if (!buffer.get()) {
|
||||
// Pool has too many pending frames.
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Video.LibvpxVp8Decoder.TooManyPendingFrames",
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/video/encoded_image.h"
|
||||
#include "api/video_codecs/video_decoder.h"
|
||||
#include "common_video/include/i420_buffer_pool.h"
|
||||
#include "common_video/include/video_frame_buffer_pool.h"
|
||||
#include "modules/video_coding/codecs/vp8/include/vp8.h"
|
||||
#include "modules/video_coding/include/video_codec_interface.h"
|
||||
#include "vpx/vp8dx.h"
|
||||
@ -54,7 +54,7 @@ class LibvpxVp8Decoder : public VideoDecoder {
|
||||
const webrtc::ColorSpace* explicit_color_space);
|
||||
const bool use_postproc_;
|
||||
|
||||
I420BufferPool buffer_pool_;
|
||||
VideoFrameBufferPool buffer_pool_;
|
||||
DecodedImageCallback* decode_complete_callback_;
|
||||
bool inited_;
|
||||
vpx_codec_ctx_t* decoder_;
|
||||
|
Reference in New Issue
Block a user