#include "common_video/include/video_frame_buffer.h"
#include "api/make_ref_counted.h"
#include "api/video/i420_buffer.h"
#include "rtc_base/checks.h"
#include "third_party/libyuv/include/libyuv/convert.h"
namespace webrtc {
namespace {
template <typename Base>
class WrappedYuvBuffer : public Base { … };
template <typename BaseWithA>
class WrappedYuvaBuffer : public WrappedYuvBuffer<BaseWithA> { … };
class I444BufferBase : public I444BufferInterface { … };
rtc::scoped_refptr<I420BufferInterface> I444BufferBase::ToI420() { … }
class I422BufferBase : public I422BufferInterface { … };
rtc::scoped_refptr<I420BufferInterface> I422BufferBase::ToI420() { … }
template <typename Base>
class WrappedYuv16BBuffer : public Base { … };
class I010BufferBase : public I010BufferInterface { … };
rtc::scoped_refptr<I420BufferInterface> I010BufferBase::ToI420() { … }
class I210BufferBase : public I210BufferInterface { … };
rtc::scoped_refptr<I420BufferInterface> I210BufferBase::ToI420() { … }
class I410BufferBase : public I410BufferInterface { … };
rtc::scoped_refptr<I420BufferInterface> I410BufferBase::ToI420() { … }
}
rtc::scoped_refptr<I420BufferInterface> WrapI420Buffer(
int width,
int height,
const uint8_t* y_plane,
int y_stride,
const uint8_t* u_plane,
int u_stride,
const uint8_t* v_plane,
int v_stride,
std::function<void()> no_longer_used) { … }
rtc::scoped_refptr<I420ABufferInterface> WrapI420ABuffer(
int width,
int height,
const uint8_t* y_plane,
int y_stride,
const uint8_t* u_plane,
int u_stride,
const uint8_t* v_plane,
int v_stride,
const uint8_t* a_plane,
int a_stride,
std::function<void()> no_longer_used) { … }
rtc::scoped_refptr<I422BufferInterface> WrapI422Buffer(
int width,
int height,
const uint8_t* y_plane,
int y_stride,
const uint8_t* u_plane,
int u_stride,
const uint8_t* v_plane,
int v_stride,
std::function<void()> no_longer_used) { … }
rtc::scoped_refptr<I444BufferInterface> WrapI444Buffer(
int width,
int height,
const uint8_t* y_plane,
int y_stride,
const uint8_t* u_plane,
int u_stride,
const uint8_t* v_plane,
int v_stride,
std::function<void()> no_longer_used) { … }
rtc::scoped_refptr<PlanarYuvBuffer> WrapYuvBuffer(
VideoFrameBuffer::Type type,
int width,
int height,
const uint8_t* y_plane,
int y_stride,
const uint8_t* u_plane,
int u_stride,
const uint8_t* v_plane,
int v_stride,
std::function<void()> no_longer_used) { … }
rtc::scoped_refptr<I010BufferInterface> WrapI010Buffer(
int width,
int height,
const uint16_t* y_plane,
int y_stride,
const uint16_t* u_plane,
int u_stride,
const uint16_t* v_plane,
int v_stride,
std::function<void()> no_longer_used) { … }
rtc::scoped_refptr<I210BufferInterface> WrapI210Buffer(
int width,
int height,
const uint16_t* y_plane,
int y_stride,
const uint16_t* u_plane,
int u_stride,
const uint16_t* v_plane,
int v_stride,
std::function<void()> no_longer_used) { … }
rtc::scoped_refptr<I410BufferInterface> WrapI410Buffer(
int width,
int height,
const uint16_t* y_plane,
int y_stride,
const uint16_t* u_plane,
int u_stride,
const uint16_t* v_plane,
int v_stride,
std::function<void()> no_longer_used) { … }
}