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 MediaStreamDependencyFactory; | |
22 | |
23 // A singleton object shared between WebMediaPlayerAndroid and WebRTC Video | |
24 // Engine. Note that this class provides the first remote stream. | |
25 // | |
26 // Example use case: | |
27 // | |
28 // // Before using the object: | |
29 // if (!RTCVideoDecoderBridgeTv::Get()->AcquireOwnership()) | |
30 // return; | |
31 // | |
32 // media::Demuxer demuxer = RTCVideoDecoderBridgeTv::Get()->CreateDemuxer( | |
33 // base::MessageLoopProxy::current()); | |
34 // if (demuxer) { | |
35 // // use |demuxer|. | |
36 // } | |
37 // | |
38 // // When done using the object: | |
39 // RTCVideoDecoderBridgeTv::Get()->ReleaseOwnership(); | |
ycheo (away)
2013/05/06 05:45:34
How about adding DestroyDemuxer() into the example
wonsik
2013/05/06 12:28:43
Oops. I forgot to modify the example. Done.
| |
40 class CONTENT_EXPORT RTCVideoDecoderBridgeTv | |
41 : NON_EXPORTED_BASE(public webrtc::VideoDecoder) { | |
42 public: | |
43 // Get RTCVideoDecoderBridgeTv singleton object. If it was not set | |
44 // before, new default instance will be created. | |
45 static RTCVideoDecoderBridgeTv* Get(); | |
46 | |
47 static void RunDestroyDemuxer(const media::Demuxer* demuxer); | |
48 | |
49 // Returns a demuxer object if this is not owned or owned by the same | |
50 // media_stream_dependency_factory. | |
51 virtual media::Demuxer* CreateDemuxer( | |
52 const MediaStreamDependencyFactory* media_stream_dependency_factory, | |
53 const scoped_refptr<base::MessageLoopProxy>& message_loop) = 0; | |
54 | |
55 virtual void DestroyDemuxer(const media::Demuxer* demuxer) = 0; | |
56 | |
57 // Returns true if acquired the ownership of this object successfully. One | |
58 // should acquire ownership before using the object, and can't use the object | |
59 // if this method fails. | |
60 virtual bool AcquireOwnership( | |
61 const MediaStreamDependencyFactory* media_stream_dependency_factory) = 0; | |
62 | |
63 // Releases ownership of this object. | |
64 virtual void ReleaseOwnership( | |
65 const MediaStreamDependencyFactory* media_stream_dependency_factory) = 0; | |
66 }; | |
67 | |
68 } // namespace content | |
69 | |
70 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_BRIDGE_TV_H_ | |
OLD | NEW |