OLD | NEW |
---|---|
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 "content/renderer/media/rtc_video_decoder.h" | 5 #include "content/renderer/media/rtc_video_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
11 #include "base/metrics/histogram.h" | |
11 #include "base/safe_numerics.h" | 12 #include "base/safe_numerics.h" |
12 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
13 #include "base/task_runner_util.h" | 14 #include "base/task_runner_util.h" |
14 #include "content/child/child_thread.h" | 15 #include "content/child/child_thread.h" |
15 #include "content/renderer/media/native_handle_impl.h" | 16 #include "content/renderer/media/native_handle_impl.h" |
16 #include "media/base/bind_to_loop.h" | 17 #include "media/base/bind_to_loop.h" |
17 #include "media/filters/gpu_video_accelerator_factories.h" | 18 #include "media/filters/gpu_video_accelerator_factories.h" |
18 #include "third_party/webrtc/common_video/interface/texture_video_frame.h" | 19 #include "third_party/webrtc/common_video/interface/texture_video_frame.h" |
19 #include "third_party/webrtc/system_wrappers/interface/ref_count.h" | 20 #include "third_party/webrtc/system_wrappers/interface/ref_count.h" |
20 | 21 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | 165 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; |
165 } | 166 } |
166 // Create some shared memory if the queue is empty. | 167 // Create some shared memory if the queue is empty. |
167 if (available_shm_segments_.size() == 0) { | 168 if (available_shm_segments_.size() == 0) { |
168 vda_loop_proxy_->PostTask(FROM_HERE, | 169 vda_loop_proxy_->PostTask(FROM_HERE, |
169 base::Bind(&RTCVideoDecoder::CreateSHM, | 170 base::Bind(&RTCVideoDecoder::CreateSHM, |
170 weak_this_, | 171 weak_this_, |
171 kMaxInFlightDecodes, | 172 kMaxInFlightDecodes, |
172 kSharedMemorySegmentBytes)); | 173 kSharedMemorySegmentBytes)); |
173 } | 174 } |
175 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecode", true); | |
Ami GONE FROM CHROMIUM
2013/09/11 17:27:35
Do you want also want a false log somewhere to ind
Ami GONE FROM CHROMIUM
2013/09/11 17:27:35
You'll also need to edit histograms.xml if you wan
wuchengli
2013/09/13 07:38:23
Done.
wuchengli
2013/09/13 07:38:23
Done. I didn't use enumeration for InitDecode beca
| |
174 return WEBRTC_VIDEO_CODEC_OK; | 176 return WEBRTC_VIDEO_CODEC_OK; |
175 } | 177 } |
176 | 178 |
177 int32_t RTCVideoDecoder::Decode( | 179 int32_t RTCVideoDecoder::Decode( |
178 const webrtc::EncodedImage& inputImage, | 180 const webrtc::EncodedImage& inputImage, |
179 bool missingFrames, | 181 bool missingFrames, |
180 const webrtc::RTPFragmentationHeader* /*fragmentation*/, | 182 const webrtc::RTPFragmentationHeader* /*fragmentation*/, |
181 const webrtc::CodecSpecificInfo* /*codecSpecificInfo*/, | 183 const webrtc::CodecSpecificInfo* /*codecSpecificInfo*/, |
182 int64_t /*renderTimeMs*/) { | 184 int64_t /*renderTimeMs*/) { |
183 DVLOG(3) << "Decode"; | 185 DVLOG(3) << "Decode"; |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
741 continue; | 743 continue; |
742 *timestamp = it->timestamp; | 744 *timestamp = it->timestamp; |
743 *width = it->width; | 745 *width = it->width; |
744 *height = it->height; | 746 *height = it->height; |
745 return; | 747 return; |
746 } | 748 } |
747 NOTREACHED() << "Missing bitstream buffer id: " << bitstream_buffer_id; | 749 NOTREACHED() << "Missing bitstream buffer id: " << bitstream_buffer_id; |
748 } | 750 } |
749 | 751 |
750 } // namespace content | 752 } // namespace content |
OLD | NEW |