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

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

Issue 2684073006: cc: UYVY video is not premultiplied rgba
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | cc/resources/video_resource_updater_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 21 matching lines...) Expand all
32 32
33 const ResourceFormat kRGBResourceFormat = RGBA_8888; 33 const ResourceFormat kRGBResourceFormat = RGBA_8888;
34 34
35 VideoFrameExternalResources::ResourceType ResourceTypeForVideoFrame( 35 VideoFrameExternalResources::ResourceType ResourceTypeForVideoFrame(
36 media::VideoFrame* video_frame) { 36 media::VideoFrame* video_frame) {
37 switch (video_frame->format()) { 37 switch (video_frame->format()) {
38 case media::PIXEL_FORMAT_ARGB: 38 case media::PIXEL_FORMAT_ARGB:
39 case media::PIXEL_FORMAT_XRGB: 39 case media::PIXEL_FORMAT_XRGB:
40 case media::PIXEL_FORMAT_UYVY: 40 case media::PIXEL_FORMAT_UYVY:
41 switch (video_frame->mailbox_holder(0).texture_target) { 41 switch (video_frame->mailbox_holder(0).texture_target) {
42 case GL_TEXTURE_2D: 42 case GL_TEXTURE_2D:
Daniele Castagna 2017/02/28 03:17:53 Isn't CrOS using TEXTURE_EXTERNAL_OES?
dshwang 2017/02/28 04:18:44 Not always TEXTURE_EXTERNAL_OES GPU video decoder
43 return (video_frame->format() == media::PIXEL_FORMAT_XRGB) 43 return (video_frame->format() != media::PIXEL_FORMAT_ARGB)
44 ? VideoFrameExternalResources::RGB_RESOURCE 44 ? VideoFrameExternalResources::RGB_RESOURCE
45 : VideoFrameExternalResources::RGBA_PREMULTIPLIED_RESOURCE; 45 : VideoFrameExternalResources::RGBA_PREMULTIPLIED_RESOURCE;
46 case GL_TEXTURE_EXTERNAL_OES: 46 case GL_TEXTURE_EXTERNAL_OES:
47 return video_frame->metadata()->IsTrue( 47 return video_frame->metadata()->IsTrue(
48 media::VideoFrameMetadata::COPY_REQUIRED) 48 media::VideoFrameMetadata::COPY_REQUIRED)
49 ? VideoFrameExternalResources::RGBA_RESOURCE 49 ? VideoFrameExternalResources::RGBA_RESOURCE
50 : VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE; 50 : VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE;
51 case GL_TEXTURE_RECTANGLE_ARB: 51 case GL_TEXTURE_RECTANGLE_ARB:
52 return VideoFrameExternalResources::RGB_RESOURCE; 52 return VideoFrameExternalResources::RGB_RESOURCE;
53 default: 53 default:
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 if (lost_resource) { 815 if (lost_resource) {
816 resource_it->clear_refs(); 816 resource_it->clear_refs();
817 updater->DeleteResource(resource_it); 817 updater->DeleteResource(resource_it);
818 return; 818 return;
819 } 819 }
820 820
821 resource_it->remove_ref(); 821 resource_it->remove_ref();
822 } 822 }
823 823
824 } // namespace cc 824 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/video_resource_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698