OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/pepper/video_decoder_shim.h" | 5 #include "content/renderer/pepper/video_decoder_shim.h" |
6 | 6 |
7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
9 #include <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
10 | 10 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 145 } |
146 | 146 |
147 // VpxVideoDecoder and FFmpegVideoDecoder support only one pending Decode() | 147 // VpxVideoDecoder and FFmpegVideoDecoder support only one pending Decode() |
148 // request. | 148 // request. |
149 DCHECK_EQ(decoder_->GetMaxDecodeRequests(), 1); | 149 DCHECK_EQ(decoder_->GetMaxDecodeRequests(), 1); |
150 | 150 |
151 // We can use base::Unretained() safely in decoder callbacks because | 151 // We can use base::Unretained() safely in decoder callbacks because |
152 // |decoder_| is owned by DecoderImpl. During Stop(), the |decoder_| will be | 152 // |decoder_| is owned by DecoderImpl. During Stop(), the |decoder_| will be |
153 // destroyed and all outstanding callbacks will be fired. | 153 // destroyed and all outstanding callbacks will be fired. |
154 decoder_->Initialize( | 154 decoder_->Initialize( |
155 config, | 155 config, true /* low_delay */, |
156 true /* low_delay */, | |
157 base::Bind(&VideoDecoderShim::DecoderImpl::OnPipelineStatus, | 156 base::Bind(&VideoDecoderShim::DecoderImpl::OnPipelineStatus, |
158 base::Unretained(this)), | 157 base::Unretained(this)), |
159 base::Bind(&VideoDecoderShim::DecoderImpl::OnOutputComplete, | 158 base::Bind(&VideoDecoderShim::DecoderImpl::OnOutputComplete, |
160 base::Unretained(this))); | 159 base::Unretained(this)), |
| 160 base::Bind(&base::DoNothing) /* no encrypted media so not needed */); |
161 } | 161 } |
162 | 162 |
163 void VideoDecoderShim::DecoderImpl::Decode( | 163 void VideoDecoderShim::DecoderImpl::Decode( |
164 uint32_t decode_id, | 164 uint32_t decode_id, |
165 scoped_refptr<media::DecoderBuffer> buffer) { | 165 scoped_refptr<media::DecoderBuffer> buffer) { |
166 DCHECK(decoder_); | 166 DCHECK(decoder_); |
167 pending_decodes_.push(PendingDecode(decode_id, buffer)); | 167 pending_decodes_.push(PendingDecode(decode_id, buffer)); |
168 DoDecode(); | 168 DoDecode(); |
169 } | 169 } |
170 | 170 |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { | 593 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { |
594 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); | 594 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); |
595 gles2->DeleteTextures(1, &texture_id); | 595 gles2->DeleteTextures(1, &texture_id); |
596 } | 596 } |
597 | 597 |
598 void VideoDecoderShim::FlushCommandBuffer() { | 598 void VideoDecoderShim::FlushCommandBuffer() { |
599 context_provider_->ContextGL()->Flush(); | 599 context_provider_->ContextGL()->Flush(); |
600 } | 600 } |
601 | 601 |
602 } // namespace content | 602 } // namespace content |
OLD | NEW |