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

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

Issue 13890012: Integrate VDA with WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 7 years, 6 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/renderer/media/rtc_video_decoder_factory.h"
6
7 #include "base/location.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h"
10 #include "content/renderer/media/rtc_video_decoder.h"
11
12 namespace content {
13
14 RTCVideoDecoderFactory::RTCVideoDecoderFactory(
15 const scoped_refptr<RendererGpuVideoDecoderFactories>& gpu_factories,
16 scoped_ptr<base::Thread> vda_thread)
17 : gpu_factories_(gpu_factories), vda_thread_(vda_thread.Pass()) {}
18
19 webrtc::VideoDecoder* RTCVideoDecoderFactory::CreateVideoDecoder(
20 webrtc::VideoCodecType type) {
21 // RendererGpuVideoDecoderFactories is not thread-safe. Make a copy.
22 scoped_ptr<RTCVideoDecoder> decoder(
23 new RTCVideoDecoder(gpu_factories_->Clone(), vda_thread_.get()));
24 if (decoder->InitVideoDecodeAccelerator(type))
25 return decoder.release();
26 // Initialize will fail when the codec is not supported.
27 return NULL;
28 }
29
30 void RTCVideoDecoderFactory::DestroyVideoDecoder(
31 webrtc::VideoDecoder* decoder) {
32 gpu_factories_->GetMessageLoop()->DeleteSoon(FROM_HERE, decoder);
33 }
34
35 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698