Chromium Code Reviews| Index: content/renderer/media/rtc_video_decoder_bridge_tv.h |
| diff --git a/content/renderer/media/rtc_video_decoder_bridge_tv.h b/content/renderer/media/rtc_video_decoder_bridge_tv.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..959736492d107b7b1b3cd05dd3342b11fe783bfe |
| --- /dev/null |
| +++ b/content/renderer/media/rtc_video_decoder_bridge_tv.h |
| @@ -0,0 +1,75 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_RENDERER_MEDIA_RTC_GPU_VIDEO_DECODER_H_ |
| +#define CONTENT_RENDERER_MEDIA_RTC_GPU_VIDEO_DECODER_H_ |
| + |
| +#include <list> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/message_loop_proxy.h" |
| +#include "content/common/content_export.h" |
| +#include "media/base/audio_decoder_config.h" |
| +#include "media/base/decoder_buffer_queue.h" |
| +#include "media/base/demuxer.h" |
| +#include "media/base/demuxer_stream.h" |
| +#include "media/base/pipeline_status.h" |
| +#include "media/base/video_decoder_config.h" |
| +#include "third_party/webrtc/modules/video_coding/codecs/interface/video_codec_interface.h" |
| + |
| +namespace content { |
| + |
| +class RTCDemuxerStream; |
| + |
| +class RTCDemuxerProxy : public media::Demuxer { |
|
scherkus (not reviewing)
2013/04/19 20:19:38
do you have code that's using media::Pipeline and/
wonsik
2013/04/22 13:44:33
Instead of using media::Pipeline, the plan is to i
|
| + public: |
| + RTCDemuxerProxy(const scoped_refptr<base::MessageLoopProxy>& message_loop); |
| + // media::Demuxer implementation. |
| + virtual void Initialize(media::DemuxerHost* host, |
| + const media::PipelineStatusCB& cb) OVERRIDE; |
| + virtual scoped_refptr<media::DemuxerStream> GetStream( |
| + media::DemuxerStream::Type type) OVERRIDE; |
| + virtual base::TimeDelta GetStartTime() const OVERRIDE; |
| + |
| + void UpdateSize(const gfx::Size& size); |
| + void QueueBuffer(scoped_refptr<media::DecoderBuffer> buffer); |
| + |
| + protected: |
| + friend class base::RefCountedThreadSafe<RTCDemuxerProxy>; |
| + |
| + virtual ~RTCDemuxerProxy(); |
| + |
| + private: |
| + scoped_refptr<base::MessageLoopProxy> loop_proxy_; |
| + scoped_refptr<RTCDemuxerStream> stream_; |
| + media::DemuxerHost* host_; |
| + media::PipelineStatusCB init_cb_; |
| +}; |
| + |
| +// A singleton object that shared between WebMediaPlayerImplAndroid and WebRTC |
| +// Video Engine. Note that this class provides the first remote stream. |
| +// |
| +// Example use case: |
| +// scoped_refptr<RTCDemuxerProxy> remote_stream = |
| +// new RTCDemuxerProxy(base::MessageLoopProxy::current()); |
| +// if (RTCVideoDecoderBridgeTv::Get()->RegisterDemuxer( |
| +// remote_stream)) { |
| +// // use |remote_stream|. |
| +// } |
| +class CONTENT_EXPORT RTCVideoDecoderBridgeTv |
| + : NON_EXPORTED_BASE(public webrtc::VideoDecoder) { |
| + public: |
| + // Get RTCVideoDecoderBridgeTv singleton object. If it was not set |
| + // before, new default instance will be created. |
| + static RTCVideoDecoderBridgeTv* Get(); |
| + |
| + virtual bool RegisterDemuxer(scoped_refptr<RTCDemuxerProxy> demuxer) = 0; |
| + |
| + virtual bool AcquireOwnership() = 0; |
| + virtual void ReleaseOwnership() = 0; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_MEDIA_RTC_GPU_VIDEO_DECODER_H_ |