Lines Matching refs:VideoFrame
21 scoped_refptr<VideoFrame> VideoFrame::CreateFrame(
22 VideoFrame::Format format,
28 scoped_refptr<VideoFrame> frame(new VideoFrame(
31 case VideoFrame::YV12:
32 case VideoFrame::YV12A:
33 case VideoFrame::YV16:
34 case VideoFrame::I420:
35 case VideoFrame::YV12J:
45 std::string VideoFrame::FormatToString(VideoFrame::Format format) {
47 case VideoFrame::UNKNOWN:
49 case VideoFrame::YV12:
51 case VideoFrame::YV16:
53 case VideoFrame::I420:
55 case VideoFrame::NATIVE_TEXTURE:
58 case VideoFrame::HOLE:
61 case VideoFrame::YV12A:
63 case VideoFrame::YV12J:
65 case VideoFrame::HISTOGRAM_MAX:
68 NOTREACHED() << "Invalid videoframe format provided: " << format;
73 bool VideoFrame::IsValidConfig(VideoFrame::Format format,
77 return (format != VideoFrame::UNKNOWN &&
93 scoped_refptr<VideoFrame> VideoFrame::WrapNativeTexture(
102 scoped_refptr<VideoFrame> frame(new VideoFrame(NATIVE_TEXTURE,
116 void VideoFrame::ReadPixelsFromNativeTexture(const SkBitmap& pixels) {
123 scoped_refptr<VideoFrame> VideoFrame::WrapExternalPackedMemory(
138 scoped_refptr<VideoFrame> frame(new VideoFrame(
157 scoped_refptr<VideoFrame> VideoFrame::WrapExternalYuvData(
171 scoped_refptr<VideoFrame> frame(new VideoFrame(
184 scoped_refptr<VideoFrame> VideoFrame::WrapVideoFrame(
185 const scoped_refptr<VideoFrame>& frame,
187 scoped_refptr<VideoFrame> wrapped_frame(new VideoFrame(
201 scoped_refptr<VideoFrame> VideoFrame::CreateEOSFrame() {
202 return new VideoFrame(VideoFrame::UNKNOWN,
211 scoped_refptr<VideoFrame> VideoFrame::CreateColorFrame(
215 DCHECK(IsValidConfig(VideoFrame::YV12, size, gfx::Rect(size), size));
216 scoped_refptr<VideoFrame> frame = VideoFrame::CreateFrame(
217 VideoFrame::YV12, size, gfx::Rect(size), size, timestamp);
223 scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(const gfx::Size& size) {
239 scoped_refptr<VideoFrame> VideoFrame::CreateHoleFrame(
241 DCHECK(IsValidConfig(VideoFrame::HOLE, size, gfx::Rect(size), size));
242 scoped_refptr<VideoFrame> frame(new VideoFrame(
243 VideoFrame::HOLE, size, gfx::Rect(size), size, base::TimeDelta(), false));
249 size_t VideoFrame::NumPlanes(Format format) {
251 case VideoFrame::NATIVE_TEXTURE:
253 case VideoFrame::HOLE:
256 case VideoFrame::YV12:
257 case VideoFrame::YV16:
258 case VideoFrame::I420:
259 case VideoFrame::YV12J:
261 case VideoFrame::YV12A:
263 case VideoFrame::UNKNOWN:
264 case VideoFrame::HISTOGRAM_MAX:
278 size_t VideoFrame::AllocationSize(Format format, const gfx::Size& coded_size) {
286 size_t VideoFrame::PlaneAllocationSize(Format format,
292 case VideoFrame::YV12:
293 case VideoFrame::YV12J:
294 case VideoFrame::I420: {
296 case VideoFrame::kYPlane:
298 case VideoFrame::kUPlane:
299 case VideoFrame::kVPlane:
305 case VideoFrame::YV12A: {
307 case VideoFrame::kYPlane:
308 case VideoFrame::kAPlane:
310 case VideoFrame::kUPlane:
311 case VideoFrame::kVPlane:
317 case VideoFrame::YV16: {
319 case VideoFrame::kYPlane:
321 case VideoFrame::kUPlane:
322 case VideoFrame::kVPlane:
328 case VideoFrame::UNKNOWN:
329 case VideoFrame::NATIVE_TEXTURE:
330 case VideoFrame::HISTOGRAM_MAX:
332 case VideoFrame::HOLE:
347 void VideoFrame::AllocateYUV() {
348 DCHECK(format_ == VideoFrame::YV12 || format_ == VideoFrame::YV16 ||
349 format_ == VideoFrame::YV12A || format_ == VideoFrame::I420 ||
350 format_ == VideoFrame::YV12J);
362 size_t y_stride = RoundUp(row_bytes(VideoFrame::kYPlane),
364 size_t uv_stride = RoundUp(row_bytes(VideoFrame::kUPlane),
371 (format_ == VideoFrame::YV12 || format_ == VideoFrame::YV12A ||
372 format_ == VideoFrame::I420)
377 size_t a_bytes = format_ == VideoFrame::YV12A ? y_bytes : 0;
388 COMPILE_ASSERT(0 == VideoFrame::kYPlane, y_plane_data_must_be_index_0);
389 data_[VideoFrame::kYPlane] = data;
390 data_[VideoFrame::kUPlane] = data + y_bytes;
391 data_[VideoFrame::kVPlane] = data + y_bytes + uv_bytes;
392 strides_[VideoFrame::kYPlane] = y_stride;
393 strides_[VideoFrame::kUPlane] = uv_stride;
394 strides_[VideoFrame::kVPlane] = uv_stride;
396 data_[VideoFrame::kAPlane] = data + y_bytes + (2 * uv_bytes);
397 strides_[VideoFrame::kAPlane] = y_stride;
401 VideoFrame::VideoFrame(VideoFrame::Format format,
419 VideoFrame::~VideoFrame() {
424 bool VideoFrame::IsValidPlane(size_t plane) const {
428 int VideoFrame::stride(size_t plane) const {
433 int VideoFrame::row_bytes(size_t plane) const {
459 int VideoFrame::rows(size_t plane) const {
485 uint8* VideoFrame::data(size_t plane) const {
490 VideoFrame::MailboxHolder* VideoFrame::texture_mailbox() const {
495 uint32 VideoFrame::texture_target() const {
500 base::SharedMemoryHandle VideoFrame::shared_memory_handle() const {
504 void VideoFrame::HashFrameForTesting(base::MD5Context* context) {
516 VideoFrame::MailboxHolder::MailboxHolder(
524 VideoFrame::MailboxHolder::~MailboxHolder() {