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 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_BRIDGE_TV_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_BRIDGE_TV_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/message_loop_proxy.h" |
| 10 #include "content/common/content_export.h" |
| 11 #include "media/base/audio_decoder_config.h" |
| 12 #include "media/base/decoder_buffer_queue.h" |
| 13 #include "media/base/demuxer.h" |
| 14 #include "media/base/demuxer_stream.h" |
| 15 #include "media/base/pipeline_status.h" |
| 16 #include "media/base/video_decoder_config.h" |
| 17 #include "third_party/webrtc/modules/video_coding/codecs/interface/video_codec_i
nterface.h" |
| 18 |
| 19 namespace content { |
| 20 |
| 21 class RTCDemuxerProxy; |
| 22 |
| 23 class RTCDemuxer : public media::Demuxer { |
| 24 public: |
| 25 RTCDemuxer(const scoped_refptr<base::MessageLoopProxy>& message_loop); |
| 26 virtual ~RTCDemuxer(); |
| 27 |
| 28 // media::Demuxer implementation. |
| 29 virtual void Initialize(media::DemuxerHost* host, |
| 30 const media::PipelineStatusCB& cb) OVERRIDE; |
| 31 virtual media::DemuxerStream* GetStream( |
| 32 media::DemuxerStream::Type type) OVERRIDE; |
| 33 virtual base::TimeDelta GetStartTime() const OVERRIDE; |
| 34 |
| 35 void UpdateSize(const gfx::Size& size); |
| 36 void QueueBuffer(scoped_refptr<media::DecoderBuffer> buffer, |
| 37 const base::Closure& done_cb); |
| 38 |
| 39 private: |
| 40 friend class RTCVideoDecoderBridgeTv; |
| 41 |
| 42 scoped_refptr<RTCDemuxerProxy> proxy_; |
| 43 }; |
| 44 |
| 45 // A singleton object that shared between WebMediaPlayerAndroid and WebRTC |
| 46 // Video Engine. Note that this class provides the first remote stream. |
| 47 // |
| 48 // Example use case: |
| 49 // scoped_refptr<RTCDemuxer> remote_stream = |
| 50 // new RTCDemuxer(base::MessageLoopProxy::current()); |
| 51 // if (RTCVideoDecoderBridgeTv::Get()->RegisterDemuxer( |
| 52 // remote_stream)) { |
| 53 // // use |remote_stream|. |
| 54 // } |
| 55 class CONTENT_EXPORT RTCVideoDecoderBridgeTv |
| 56 : NON_EXPORTED_BASE(public webrtc::VideoDecoder) { |
| 57 public: |
| 58 // Get RTCVideoDecoderBridgeTv singleton object. If it was not set |
| 59 // before, new default instance will be created. |
| 60 static RTCVideoDecoderBridgeTv* Get(); |
| 61 |
| 62 virtual bool RegisterDemuxer(RTCDemuxer* demuxer) = 0; |
| 63 |
| 64 virtual bool AcquireOwnership() = 0; |
| 65 virtual void ReleaseOwnership() = 0; |
| 66 }; |
| 67 |
| 68 } // namespace content |
| 69 |
| 70 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_BRIDGE_TV_H_ |
OLD | NEW |