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..cbb9bded51ffd7b28e66756c08405e589335d695 |
| --- /dev/null |
| +++ b/content/renderer/media/rtc_video_decoder_bridge_tv.h |
| @@ -0,0 +1,70 @@ |
| +// 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_VIDEO_DECODER_BRIDGE_TV_H_ |
| +#define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_BRIDGE_TV_H_ |
| + |
| +#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 RTCDemuxerProxy; |
| + |
| +class RTCDemuxer : public media::Demuxer { |
| + public: |
| + RTCDemuxer(const scoped_refptr<base::MessageLoopProxy>& message_loop); |
| + virtual ~RTCDemuxer(); |
| + |
| + // media::Demuxer implementation. |
| + virtual void Initialize(media::DemuxerHost* host, |
| + const media::PipelineStatusCB& cb) OVERRIDE; |
| + virtual 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, |
| + const base::Closure& done_cb); |
| + |
| + private: |
| + friend class RTCVideoDecoderBridgeTv; |
| + |
| + scoped_refptr<RTCDemuxerProxy> proxy_; |
| +}; |
| + |
| +// A singleton object that shared between WebMediaPlayerAndroid and WebRTC |
|
palmer
2013/04/29 18:58:44
NIT: Either "...object that is shared..." or "...o
Ami GONE FROM CHROMIUM
2013/04/29 22:11:09
It's a singleton but there are no locks I can see.
wonsik
2013/05/01 14:15:38
Done.
wonsik
2013/05/01 14:15:38
Added locking.
|
| +// Video Engine. Note that this class provides the first remote stream. |
| +// |
| +// Example use case: |
| +// scoped_refptr<RTCDemuxer> remote_stream = |
| +// new RTCDemuxer(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(RTCDemuxer* demuxer) = 0; |
|
Ami GONE FROM CHROMIUM
2013/04/29 22:11:09
Please doco the usage of this and the *Ownership()
wonsik
2013/05/01 14:15:38
Done.
|
| + |
| + virtual bool AcquireOwnership() = 0; |
| + virtual void ReleaseOwnership() = 0; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_BRIDGE_TV_H_ |