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

Unified Diff: content/renderer/media/renderer_gpu_video_decoder_factories.cc

Issue 13890012: Integrate VDA with WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add VDA and gpu_factories mocks. Update unittest. Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/renderer_gpu_video_decoder_factories.cc
diff --git a/content/renderer/media/renderer_gpu_video_decoder_factories.cc b/content/renderer/media/renderer_gpu_video_decoder_factories.cc
index 8aff3874cb56a345fb5ed3a0ff5587a730409a44..8a03f82f10d8d0cdda498a52494cba28a53633e7 100644
--- a/content/renderer/media/renderer_gpu_video_decoder_factories.cc
+++ b/content/renderer/media/renderer_gpu_video_decoder_factories.cc
@@ -29,6 +29,7 @@ RendererGpuVideoDecoderFactories::RendererGpuVideoDecoderFactories(
render_thread_async_waiter_(false, false) {
if (message_loop_->BelongsToCurrentThread()) {
AsyncGetContext(context);
+ compositor_loop_async_waiter_.Reset();
return;
}
// Threaded compositor requires us to wait for the context to be acquired.
@@ -63,7 +64,11 @@ media::VideoDecodeAccelerator*
RendererGpuVideoDecoderFactories::CreateVideoDecodeAccelerator(
media::VideoCodecProfile profile,
media::VideoDecodeAccelerator::Client* client) {
- DCHECK(!message_loop_->BelongsToCurrentThread());
+ if (message_loop_->BelongsToCurrentThread()) {
+ AsyncCreateVideoDecodeAccelerator(profile, client);
+ compositor_loop_async_waiter_.Reset();
+ return vda_.release();
Ami GONE FROM CHROMIUM 2013/05/29 21:11:46 For consistency with the other similar codepaths b
wuchengli 2013/06/10 12:33:42 I removed DCHECK(!message_loop_->BelongsToCurrentT
+ }
// The VDA is returned in the vda_ member variable by the
// AsyncCreateVideoDecodeAccelerator() function.
message_loop_->PostTask(FROM_HERE, base::Bind(
@@ -101,6 +106,12 @@ bool RendererGpuVideoDecoderFactories::CreateTextures(
int32 count, const gfx::Size& size,
std::vector<uint32>* texture_ids,
uint32 texture_target) {
+ if (message_loop_->BelongsToCurrentThread()) {
+ AsyncCreateTextures(count, size, texture_target);
+ texture_ids->swap(created_textures_);
+ compositor_loop_async_waiter_.Reset();
+ return true;
+ }
DCHECK(!message_loop_->BelongsToCurrentThread());
message_loop_->PostTask(FROM_HERE, base::Bind(
&RendererGpuVideoDecoderFactories::AsyncCreateTextures, this,
@@ -148,6 +159,10 @@ void RendererGpuVideoDecoderFactories::AsyncCreateTextures(
}
void RendererGpuVideoDecoderFactories::DeleteTexture(uint32 texture_id) {
+ if (message_loop_->BelongsToCurrentThread()) {
+ AsyncDeleteTexture(texture_id);
+ return;
+ }
DCHECK(!message_loop_->BelongsToCurrentThread());
message_loop_->PostTask(FROM_HERE, base::Bind(
&RendererGpuVideoDecoderFactories::AsyncDeleteTexture, this, texture_id));

Powered by Google App Engine
This is Rietveld 408576698