| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromecast/renderer/media/hole_frame_factory.h" | 5 #include "chromecast/renderer/media/hole_frame_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "gpu/GLES2/gl2extchromium.h" | 9 #include "gpu/GLES2/gl2extchromium.h" |
| 10 #include "gpu/command_buffer/client/gles2_interface.h" | 10 #include "gpu/command_buffer/client/gles2_interface.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 const gfx::Size& size) { | 56 const gfx::Size& size) { |
| 57 // No texture => audio device. size empty => video has one dimension = 0. | 57 // No texture => audio device. size empty => video has one dimension = 0. |
| 58 // Dimension 0 case triggers a DCHECK later on in TextureMailbox if we push | 58 // Dimension 0 case triggers a DCHECK later on in TextureMailbox if we push |
| 59 // through the overlay path. | 59 // through the overlay path. |
| 60 if (!texture_ || size.IsEmpty()) { | 60 if (!texture_ || size.IsEmpty()) { |
| 61 LOG(INFO) << "Create black frame " << size.width() << "x" << size.height(); | 61 LOG(INFO) << "Create black frame " << size.width() << "x" << size.height(); |
| 62 return ::media::VideoFrame::CreateBlackFrame(gfx::Size(1, 1)); | 62 return ::media::VideoFrame::CreateBlackFrame(gfx::Size(1, 1)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 LOG(INFO) << "Create hole frame " << size.width() << "x" << size.height(); | 65 LOG(INFO) << "Create hole frame " << size.width() << "x" << size.height(); |
| 66 gpu::MailboxHolder holders[::media::VideoFrame::kMaxPlanes] = { |
| 67 gpu::MailboxHolder(mailbox_, sync_token_, GL_TEXTURE_2D)}; |
| 66 scoped_refptr<::media::VideoFrame> frame = | 68 scoped_refptr<::media::VideoFrame> frame = |
| 67 ::media::VideoFrame::WrapNativeTexture( | 69 ::media::VideoFrame::WrapNativeTextures( |
| 68 ::media::PIXEL_FORMAT_XRGB, | 70 ::media::PIXEL_FORMAT_XRGB, holders, |
| 69 gpu::MailboxHolder(mailbox_, sync_token_, GL_TEXTURE_2D), | |
| 70 ::media::VideoFrame::ReleaseMailboxCB(), | 71 ::media::VideoFrame::ReleaseMailboxCB(), |
| 71 size, // coded_size | 72 size, // coded_size |
| 72 gfx::Rect(size), // visible rect | 73 gfx::Rect(size), // visible rect |
| 73 size, // natural size | 74 size, // natural size |
| 74 base::TimeDelta()); // timestamp | 75 base::TimeDelta()); // timestamp |
| 75 CHECK(frame); | 76 CHECK(frame); |
| 76 frame->metadata()->SetBoolean(::media::VideoFrameMetadata::ALLOW_OVERLAY, | 77 frame->metadata()->SetBoolean(::media::VideoFrameMetadata::ALLOW_OVERLAY, |
| 77 true); | 78 true); |
| 78 return frame; | 79 return frame; |
| 79 } | 80 } |
| 80 | 81 |
| 81 } // namespace media | 82 } // namespace media |
| 82 } // namespace chromecast | 83 } // namespace chromecast |
| OLD | NEW |