OLD | NEW |
(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_tv.h" |
| 6 |
| 7 #include "content/renderer/media/rtc_video_decoder_bridge_tv.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 RTCVideoDecoderFactoryTv::RTCVideoDecoderFactoryTv() { |
| 12 } |
| 13 |
| 14 webrtc::VideoDecoder* RTCVideoDecoderFactoryTv::CreateVideoDecoder( |
| 15 webrtc::VideoCodecType type) { |
| 16 if (type == webrtc::kVideoCodecVP8) { |
| 17 RTCVideoDecoderBridgeTv* bridge = |
| 18 RTCVideoDecoderBridgeTv::Get(); |
| 19 if (bridge->AcquireOwnership()) |
| 20 return bridge; |
| 21 } |
| 22 // returning NULL will make WebRTC fall back to SW decoder. |
| 23 return NULL; |
| 24 } |
| 25 |
| 26 void RTCVideoDecoderFactoryTv::DestroyVideoDecoder( |
| 27 webrtc::VideoDecoder* decoder) { |
| 28 DCHECK(RTCVideoDecoderBridgeTv::Get() == decoder); |
| 29 RTCVideoDecoderBridgeTv::Get()->ReleaseOwnership(); |
| 30 } |
| 31 |
| 32 } // namespace content |
OLD | NEW |