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 // A singleton object shared between WebMediaPlayerAndroid and WebRTC Video | |
22 // Engine. Note that this class provides the first remote stream. | |
23 // | |
24 // Example use case: | |
25 // | |
26 // // Before using the object: | |
27 // if (!RTCVideoDecoderBridgeTv::Get()->AcquireOwnership()) | |
28 // return; | |
29 // | |
30 // media::Demuxer demuxer = RTCVideoDecoderBridgeTv::Get()->CreateDemuxer( | |
31 // base::MessageLoopProxy::current()); | |
32 // if (demuxer) { | |
33 // // use |demuxer|. | |
34 // } | |
35 // | |
36 // // When done using the object: | |
37 // RTCVideoDecoderBridgeTv::Get()->ReleaseOwnership(); | |
38 class CONTENT_EXPORT RTCVideoDecoderBridgeTv | |
39 : NON_EXPORTED_BASE(public webrtc::VideoDecoder) { | |
40 public: | |
41 // Get RTCVideoDecoderBridgeTv singleton object. If it was not set | |
42 // before, new default instance will be created. | |
43 static RTCVideoDecoderBridgeTv* Get(); | |
44 | |
45 // Returns a demuxer object if this object is not owned; otherwise, NULL. | |
Ami GONE FROM CHROMIUM
2013/05/01 22:01:37
Is the "otherwise, NULL" always an indication of p
Ami GONE FROM CHROMIUM
2013/05/01 22:01:37
Also returns NULL the second time it's called when
wonsik
2013/05/03 18:31:19
This singleton is mainly used in two different par
| |
46 virtual media::Demuxer* CreateDemuxer( | |
47 const scoped_refptr<base::MessageLoopProxy>& message_loop) = 0; | |
48 | |
49 // Returns true if acquired the ownership of this object successfully. One | |
50 // should acquire ownership before using the object, and can't use the object | |
51 // if this method fails. | |
52 virtual bool AcquireOwnership() = 0; | |
53 | |
54 // Releases ownership of this object. | |
55 virtual void ReleaseOwnership() = 0; | |
56 }; | |
57 | |
58 } // namespace content | |
59 | |
60 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_BRIDGE_TV_H_ | |
OLD | NEW |