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

Side by Side Diff: cc/resources/video_resource_updater.cc

Issue 863253002: Update from https://crrev.com/312600 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/resources/video_resource_updater.h" 5 #include "cc/resources/video_resource_updater.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 bool VideoResourceUpdater::VerifyFrame( 138 bool VideoResourceUpdater::VerifyFrame(
139 const scoped_refptr<media::VideoFrame>& video_frame) { 139 const scoped_refptr<media::VideoFrame>& video_frame) {
140 switch (video_frame->format()) { 140 switch (video_frame->format()) {
141 // Acceptable inputs. 141 // Acceptable inputs.
142 case media::VideoFrame::YV12: 142 case media::VideoFrame::YV12:
143 case media::VideoFrame::I420: 143 case media::VideoFrame::I420:
144 case media::VideoFrame::YV12A: 144 case media::VideoFrame::YV12A:
145 case media::VideoFrame::YV16: 145 case media::VideoFrame::YV16:
146 case media::VideoFrame::YV12J: 146 case media::VideoFrame::YV12J:
147 case media::VideoFrame::YV12HD:
147 case media::VideoFrame::YV24: 148 case media::VideoFrame::YV24:
148 case media::VideoFrame::NATIVE_TEXTURE: 149 case media::VideoFrame::NATIVE_TEXTURE:
149 #if defined(VIDEO_HOLE) 150 #if defined(VIDEO_HOLE)
150 case media::VideoFrame::HOLE: 151 case media::VideoFrame::HOLE:
151 #endif // defined(VIDEO_HOLE) 152 #endif // defined(VIDEO_HOLE)
152 case media::VideoFrame::ARGB: 153 case media::VideoFrame::ARGB:
153 return true; 154 return true;
154 155
155 // Unacceptable inputs. ¯\(°_o)/¯ 156 // Unacceptable inputs. ¯\(°_o)/¯
156 case media::VideoFrame::UNKNOWN: 157 case media::VideoFrame::UNKNOWN:
(...skipping 27 matching lines...) Expand all
184 external_resources.type = VideoFrameExternalResources::HOLE; 185 external_resources.type = VideoFrameExternalResources::HOLE;
185 return external_resources; 186 return external_resources;
186 } 187 }
187 #endif // defined(VIDEO_HOLE) 188 #endif // defined(VIDEO_HOLE)
188 189
189 // Only YUV software video frames are supported. 190 // Only YUV software video frames are supported.
190 if (input_frame_format != media::VideoFrame::YV12 && 191 if (input_frame_format != media::VideoFrame::YV12 &&
191 input_frame_format != media::VideoFrame::I420 && 192 input_frame_format != media::VideoFrame::I420 &&
192 input_frame_format != media::VideoFrame::YV12A && 193 input_frame_format != media::VideoFrame::YV12A &&
193 input_frame_format != media::VideoFrame::YV12J && 194 input_frame_format != media::VideoFrame::YV12J &&
195 input_frame_format != media::VideoFrame::YV12HD &&
194 input_frame_format != media::VideoFrame::YV16 && 196 input_frame_format != media::VideoFrame::YV16 &&
195 input_frame_format != media::VideoFrame::YV24) { 197 input_frame_format != media::VideoFrame::YV24) {
196 NOTREACHED() << input_frame_format; 198 NOTREACHED() << input_frame_format;
197 return VideoFrameExternalResources(); 199 return VideoFrameExternalResources();
198 } 200 }
199 201
200 bool software_compositor = context_provider_ == NULL; 202 bool software_compositor = context_provider_ == NULL;
201 203
202 ResourceFormat output_resource_format = 204 ResourceFormat output_resource_format =
203 resource_provider_->yuv_resource_format(); 205 resource_provider_->yuv_resource_format();
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 resource_it->ref_count = 0; 423 resource_it->ref_count = 0;
422 updater->DeleteResource(resource_it); 424 updater->DeleteResource(resource_it);
423 return; 425 return;
424 } 426 }
425 427
426 --resource_it->ref_count; 428 --resource_it->ref_count;
427 DCHECK_GE(resource_it->ref_count, 0); 429 DCHECK_GE(resource_it->ref_count, 0);
428 } 430 }
429 431
430 } // namespace cc 432 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698