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

Side by Side Diff: content/renderer/media/rtc_video_decoder.cc

Issue 1458683002: RTCVideoDecoder: add Destroy() static method for RTCVideoDecoderFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 "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/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 &waiter)); 109 &waiter));
110 waiter.Wait(); 110 waiter.Wait();
111 // |decoder->vda_| is nullptr if the codec is not supported. 111 // |decoder->vda_| is nullptr if the codec is not supported.
112 if (decoder->vda_) 112 if (decoder->vda_)
113 decoder->state_ = INITIALIZED; 113 decoder->state_ = INITIALIZED;
114 else 114 else
115 factories->GetTaskRunner()->DeleteSoon(FROM_HERE, decoder.release()); 115 factories->GetTaskRunner()->DeleteSoon(FROM_HERE, decoder.release());
116 return decoder.Pass(); 116 return decoder.Pass();
117 } 117 }
118 118
119 // static
120 void RTCVideoDecoder::Destroy(webrtc::VideoDecoder* decoder,
121 media::GpuVideoAcceleratorFactories* factories) {
122 factories->GetTaskRunner()->DeleteSoon(FROM_HERE, decoder);
123 }
124
119 int32_t RTCVideoDecoder::InitDecode(const webrtc::VideoCodec* codecSettings, 125 int32_t RTCVideoDecoder::InitDecode(const webrtc::VideoCodec* codecSettings,
120 int32_t /*numberOfCores*/) { 126 int32_t /*numberOfCores*/) {
121 DVLOG(2) << "InitDecode"; 127 DVLOG(2) << "InitDecode";
122 DCHECK_EQ(video_codec_type_, codecSettings->codecType); 128 DCHECK_EQ(video_codec_type_, codecSettings->codecType);
123 if (codecSettings->codecType == webrtc::kVideoCodecVP8 && 129 if (codecSettings->codecType == webrtc::kVideoCodecVP8 &&
124 codecSettings->codecSpecific.VP8.feedbackModeOn) { 130 codecSettings->codecSpecific.VP8.feedbackModeOn) {
125 LOG(ERROR) << "Feedback mode not supported"; 131 LOG(ERROR) << "Feedback mode not supported";
126 return RecordInitDecodeUMA(WEBRTC_VIDEO_CODEC_ERROR); 132 return RecordInitDecodeUMA(WEBRTC_VIDEO_CODEC_ERROR);
127 } 133 }
128 134
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 } 803 }
798 804
799 void RTCVideoDecoder::ClearPendingBuffers() { 805 void RTCVideoDecoder::ClearPendingBuffers() {
800 // Delete WebRTC input buffers. 806 // Delete WebRTC input buffers.
801 for (const auto& pending_buffer : pending_buffers_) 807 for (const auto& pending_buffer : pending_buffers_)
802 delete[] pending_buffer.first._buffer; 808 delete[] pending_buffer.first._buffer;
803 pending_buffers_.clear(); 809 pending_buffers_.clear();
804 } 810 }
805 811
806 } // namespace content 812 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_video_decoder.h ('k') | content/renderer/media/rtc_video_decoder_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698