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

Side by Side Diff: media/filters/gpu_video_decoder.cc

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 years, 8 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 | « media/filters/gpu_video_decoder.h ('k') | media/filters/source_buffer_state.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/filters/gpu_video_decoder.h" 5 #include "media/filters/gpu_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <array> 8 #include <array>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 const gfx::Size& ns) 106 const gfx::Size& ns)
107 : bitstream_buffer_id(bbid), 107 : bitstream_buffer_id(bbid),
108 timestamp(ts), 108 timestamp(ts),
109 visible_rect(vr), 109 visible_rect(vr),
110 natural_size(ns) {} 110 natural_size(ns) {}
111 111
112 GpuVideoDecoder::BufferData::~BufferData() {} 112 GpuVideoDecoder::BufferData::~BufferData() {}
113 113
114 GpuVideoDecoder::GpuVideoDecoder(GpuVideoAcceleratorFactories* factories, 114 GpuVideoDecoder::GpuVideoDecoder(GpuVideoAcceleratorFactories* factories,
115 const RequestSurfaceCB& request_surface_cb, 115 const RequestSurfaceCB& request_surface_cb,
116 scoped_refptr<MediaLog> media_log) 116 MediaLog* media_log)
117 : needs_bitstream_conversion_(false), 117 : needs_bitstream_conversion_(false),
118 factories_(factories), 118 factories_(factories),
119 request_surface_cb_(request_surface_cb), 119 request_surface_cb_(request_surface_cb),
120 media_log_(media_log), 120 media_log_(media_log),
121 vda_initialized_(false), 121 vda_initialized_(false),
122 state_(kNormal), 122 state_(kNormal),
123 decoder_texture_target_(0), 123 decoder_texture_target_(0),
124 pixel_format_(PIXEL_FORMAT_UNKNOWN), 124 pixel_format_(PIXEL_FORMAT_UNKNOWN),
125 next_picture_buffer_id_(0), 125 next_picture_buffer_id_(0),
126 next_bitstream_buffer_id_(0), 126 next_bitstream_buffer_id_(0),
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 coded_size.height() <= max_resolution.height() && 162 coded_size.height() <= max_resolution.height() &&
163 coded_size.width() >= min_resolution.width() && 163 coded_size.width() >= min_resolution.width() &&
164 coded_size.height() >= min_resolution.height()); 164 coded_size.height() >= min_resolution.height());
165 } 165 }
166 166
167 // Report |success| to UMA and run |cb| with it. This is super-specific to the 167 // Report |success| to UMA and run |cb| with it. This is super-specific to the
168 // UMA stat reported because the UMA_HISTOGRAM_ENUMERATION API requires a 168 // UMA stat reported because the UMA_HISTOGRAM_ENUMERATION API requires a
169 // callsite to always be called with the same stat name (can't parameterize it). 169 // callsite to always be called with the same stat name (can't parameterize it).
170 static void ReportGpuVideoDecoderInitializeStatusToUMAAndRunCB( 170 static void ReportGpuVideoDecoderInitializeStatusToUMAAndRunCB(
171 const VideoDecoder::InitCB& cb, 171 const VideoDecoder::InitCB& cb,
172 scoped_refptr<MediaLog> media_log, 172 MediaLog* media_log,
173 bool success) { 173 bool success) {
174 // TODO(xhwang): Report |success| directly. 174 // TODO(xhwang): Report |success| directly.
175 PipelineStatus status = success ? PIPELINE_OK : DECODER_ERROR_NOT_SUPPORTED; 175 PipelineStatus status = success ? PIPELINE_OK : DECODER_ERROR_NOT_SUPPORTED;
176 UMA_HISTOGRAM_ENUMERATION( 176 UMA_HISTOGRAM_ENUMERATION(
177 "Media.GpuVideoDecoderInitializeStatus", status, PIPELINE_STATUS_MAX + 1); 177 "Media.GpuVideoDecoderInitializeStatus", status, PIPELINE_STATUS_MAX + 1);
178 178
179 if (!success) { 179 if (!success) {
180 media_log->RecordRapporWithSecurityOrigin( 180 media_log->RecordRapporWithSecurityOrigin(
181 "Media.OriginUrl.GpuVideoDecoderInitFailure"); 181 "Media.OriginUrl.GpuVideoDecoderInitFailure");
182 } 182 }
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 } 893 }
894 return false; 894 return false;
895 } 895 }
896 896
897 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() 897 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
898 const { 898 const {
899 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); 899 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
900 } 900 }
901 901
902 } // namespace media 902 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | media/filters/source_buffer_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698