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

Side by Side Diff: content/common/gpu/media/vaapi_video_decode_accelerator.cc

Issue 10836098: Revert 150007 - Only dlopen() OMX/VAAPI libs in the GPU process, and only lazily dlsym() their symb… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 make_context_current_(make_context_current), 60 make_context_current_(make_context_current),
61 state_(kUninitialized), 61 state_(kUninitialized),
62 input_ready_(&lock_), 62 input_ready_(&lock_),
63 output_ready_(&lock_), 63 output_ready_(&lock_),
64 message_loop_(MessageLoop::current()), 64 message_loop_(MessageLoop::current()),
65 weak_this_(base::AsWeakPtr(this)), 65 weak_this_(base::AsWeakPtr(this)),
66 client_ptr_factory_(client), 66 client_ptr_factory_(client),
67 client_(client_ptr_factory_.GetWeakPtr()), 67 client_(client_ptr_factory_.GetWeakPtr()),
68 decoder_thread_("VaapiDecoderThread") { 68 decoder_thread_("VaapiDecoderThread") {
69 DCHECK(client); 69 DCHECK(client);
70 static bool vaapi_functions_initialized = PostSandboxInitialization();
71 RETURN_AND_NOTIFY_ON_FAILURE(vaapi_functions_initialized,
72 "Failed to initialize VAAPI libs",
73 PLATFORM_FAILURE, );
74 } 70 }
75 71
76 VaapiVideoDecodeAccelerator::~VaapiVideoDecodeAccelerator() { 72 VaapiVideoDecodeAccelerator::~VaapiVideoDecodeAccelerator() {
77 DCHECK_EQ(message_loop_, MessageLoop::current()); 73 DCHECK_EQ(message_loop_, MessageLoop::current());
78 } 74 }
79 75
80 bool VaapiVideoDecodeAccelerator::Initialize( 76 bool VaapiVideoDecodeAccelerator::Initialize(
81 media::VideoCodecProfile profile) { 77 media::VideoCodecProfile profile) {
82 DCHECK_EQ(message_loop_, MessageLoop::current()); 78 DCHECK_EQ(message_loop_, MessageLoop::current());
83 79
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 decoder_.Destroy(); 548 decoder_.Destroy();
553 state_ = kUninitialized; 549 state_ = kUninitialized;
554 } 550 }
555 551
556 void VaapiVideoDecodeAccelerator::Destroy() { 552 void VaapiVideoDecodeAccelerator::Destroy() {
557 DCHECK_EQ(message_loop_, MessageLoop::current()); 553 DCHECK_EQ(message_loop_, MessageLoop::current());
558 Cleanup(); 554 Cleanup();
559 delete this; 555 delete this;
560 } 556 }
561 557
562 // static
563 void VaapiVideoDecodeAccelerator::PreSandboxInitialization() {
564 VaapiH264Decoder::PreSandboxInitialization();
565 }
566
567 // static
568 bool VaapiVideoDecodeAccelerator::PostSandboxInitialization() {
569 return VaapiH264Decoder::PostSandboxInitialization();
570 }
571
572 void VaapiVideoDecodeAccelerator::OutputPicCallback(int32 input_id, 558 void VaapiVideoDecodeAccelerator::OutputPicCallback(int32 input_id,
573 int32 output_id) { 559 int32 output_id) {
574 TRACE_EVENT2("Video Decoder", "VAVDA::OutputPicCallback", 560 TRACE_EVENT2("Video Decoder", "VAVDA::OutputPicCallback",
575 "Input id", input_id, "Picture id", output_id); 561 "Input id", input_id, "Picture id", output_id);
576 DVLOG(4) << "Outputting picture, input id: " << input_id 562 DVLOG(4) << "Outputting picture, input id: " << input_id
577 << " output id: " << output_id; 563 << " output id: " << output_id;
578 564
579 // Forward the request to the main thread. 565 // Forward the request to the main thread.
580 DCHECK_EQ(decoder_thread_.message_loop(), MessageLoop::current()); 566 DCHECK_EQ(decoder_thread_.message_loop(), MessageLoop::current());
581 message_loop_->PostTask(FROM_HERE, base::Bind( 567 message_loop_->PostTask(FROM_HERE, base::Bind(
582 &VaapiVideoDecodeAccelerator::SyncAndNotifyPictureReady, weak_this_, 568 &VaapiVideoDecodeAccelerator::SyncAndNotifyPictureReady, weak_this_,
583 input_id, output_id)); 569 input_id, output_id));
584 } 570 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698