1 // Copyright 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 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_FACTORY_H_ 6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_FACTORY_H_ 7 8 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/threading/thread.h" 10 #include "content/common/content_export.h" 11 #include "third_party/libjingle/source/talk/media/webrtc/webrtcvideodecoderfactory.h" 12 #include "third_party/webrtc/modules/video_coding/codecs/interface/video_codec_interface.h" 13 14 namespace media { 15 class GpuVideoDecoderFactories; 16 } 17 18 namespace webrtc { 19 class VideoDecoder; 20 } 21 22 namespace content { 23 class RendererGpuVideoDecoderFactories; 24 25 // TODO(wuchengli): add unittest. 26 class CONTENT_EXPORT RTCVideoDecoderFactory 27 : NON_EXPORTED_BASE(public cricket::WebRtcVideoDecoderFactory) { 28 public: 29 explicit RTCVideoDecoderFactory( 30 const scoped_refptr<RendererGpuVideoDecoderFactories>& gpu_factories); 31 virtual ~RTCVideoDecoderFactory(); 32 33 // Runs on Chrome_libJingle_WorkerThread. The child thread is blocked while 34 // this runs. 35 virtual webrtc::VideoDecoder* CreateVideoDecoder(webrtc::VideoCodecType type) 36 OVERRIDE; 37 38 // Runs on Chrome_libJingle_WorkerThread. The child thread is blocked while 39 // this runs. 40 virtual void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) OVERRIDE; 41 42 private: 43 scoped_refptr<RendererGpuVideoDecoderFactories> gpu_factories_; 44 45 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoderFactory); 46 }; 47 48 } // namespace content 49 50 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_FACTORY_H_ 51