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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 if (texture_) { | 57 if (texture_) { |
58 scoped_refptr<::media::VideoFrame> frame = | 58 scoped_refptr<::media::VideoFrame> frame = |
59 ::media::VideoFrame::WrapNativeTexture( | 59 ::media::VideoFrame::WrapNativeTexture( |
60 ::media::PIXEL_FORMAT_XRGB, | 60 ::media::PIXEL_FORMAT_XRGB, |
61 gpu::MailboxHolder(mailbox_, sync_token_, GL_TEXTURE_2D), | 61 gpu::MailboxHolder(mailbox_, sync_token_, GL_TEXTURE_2D), |
62 ::media::VideoFrame::ReleaseMailboxCB(), | 62 ::media::VideoFrame::ReleaseMailboxCB(), |
63 size, // coded_size | 63 size, // coded_size |
64 gfx::Rect(size), // visible rect | 64 gfx::Rect(size), // visible rect |
65 size, // natural size | 65 size, // natural size |
66 base::TimeDelta()); // timestamp | 66 base::TimeDelta()); // timestamp |
| 67 if (!frame) |
| 68 return nullptr; |
67 frame->metadata()->SetBoolean(::media::VideoFrameMetadata::ALLOW_OVERLAY, | 69 frame->metadata()->SetBoolean(::media::VideoFrameMetadata::ALLOW_OVERLAY, |
68 true); | 70 true); |
69 return frame; | 71 return frame; |
70 } else { | 72 } else { |
71 // This case is needed for audio-only devices. | 73 // This case is needed for audio-only devices. |
72 return ::media::VideoFrame::CreateBlackFrame(gfx::Size(1, 1)); | 74 return ::media::VideoFrame::CreateBlackFrame(gfx::Size(1, 1)); |
73 } | 75 } |
74 } | 76 } |
75 | 77 |
76 } // namespace media | 78 } // namespace media |
77 } // namespace chromecast | 79 } // namespace chromecast |
OLD | NEW |