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