Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: chromecast/renderer/media/hole_frame_factory.cc

Issue 1476523005: Verify returned frames from media::VideoFrame::Wrap*() methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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;
halliwell 2016/01/15 01:52:04 I'm not sure how useful this is. If there is a pr
emircan 2016/01/15 02:04:10 Done.
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_context.cc ('k') | content/browser/renderer_host/media/video_capture_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698