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

Side by Side Diff: media/gpu/dxva_video_decode_accelerator_win.cc

Issue 2504473002: Initialize DXVA decoder thread with MTA COM apartment model (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "media/gpu/dxva_video_decode_accelerator_win.h" 5 #include "media/gpu/dxva_video_decode_accelerator_win.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #if !defined(OS_WIN) 9 #if !defined(OS_WIN)
10 #error This file should only be built on Windows. 10 #error This file should only be built on Windows.
(...skipping 2208 matching lines...) Expand 10 before | Expand all | Expand 10 after
2219 new_state)); 2219 new_state));
2220 return; 2220 return;
2221 } 2221 }
2222 2222
2223 static_assert(sizeof(State) == sizeof(long), "mismatched type sizes"); 2223 static_assert(sizeof(State) == sizeof(long), "mismatched type sizes");
2224 ::InterlockedExchange(reinterpret_cast<volatile long*>(&state_), new_state); 2224 ::InterlockedExchange(reinterpret_cast<volatile long*>(&state_), new_state);
2225 DCHECK_EQ(state_, new_state); 2225 DCHECK_EQ(state_, new_state);
2226 } 2226 }
2227 2227
2228 void DXVAVideoDecodeAccelerator::StartDecoderThread() { 2228 void DXVAVideoDecodeAccelerator::StartDecoderThread() {
2229 decoder_thread_.init_com_with_mta(false); 2229 decoder_thread_.init_com_with_mta(true);
2230 decoder_thread_.Start(); 2230 decoder_thread_.Start();
2231 decoder_thread_task_runner_ = decoder_thread_.task_runner(); 2231 decoder_thread_task_runner_ = decoder_thread_.task_runner();
2232 } 2232 }
2233 2233
2234 bool DXVAVideoDecodeAccelerator::OutputSamplesPresent() { 2234 bool DXVAVideoDecodeAccelerator::OutputSamplesPresent() {
2235 base::AutoLock lock(decoder_lock_); 2235 base::AutoLock lock(decoder_lock_);
2236 return !pending_output_samples_.empty(); 2236 return !pending_output_samples_.empty();
2237 } 2237 }
2238 2238
2239 void DXVAVideoDecodeAccelerator::CopySurface(IDirect3DSurface9* src_surface, 2239 void DXVAVideoDecodeAccelerator::CopySurface(IDirect3DSurface9* src_surface,
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
2743 SetState(kConfigChange); 2743 SetState(kConfigChange);
2744 Invalidate(); 2744 Invalidate();
2745 Initialize(config_, client_); 2745 Initialize(config_, client_);
2746 decoder_thread_task_runner_->PostTask( 2746 decoder_thread_task_runner_->PostTask(
2747 FROM_HERE, 2747 FROM_HERE,
2748 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, 2748 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers,
2749 base::Unretained(this))); 2749 base::Unretained(this)));
2750 } 2750 }
2751 2751
2752 } // namespace media 2752 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698