OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ |
6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ | 6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class GpuVideoAcceleratorFactories; | 28 class GpuVideoAcceleratorFactories; |
29 | 29 |
30 } // namespace media | 30 } // namespace media |
31 | 31 |
32 namespace content { | 32 namespace content { |
33 | 33 |
34 // RTCVideoEncoder uses a media::VideoEncodeAccelerator to implement a | 34 // RTCVideoEncoder uses a media::VideoEncodeAccelerator to implement a |
35 // webrtc::VideoEncoder class for WebRTC. Internally, VEA methods are | 35 // webrtc::VideoEncoder class for WebRTC. Internally, VEA methods are |
36 // trampolined to a private RTCVideoEncoder::Impl instance. The Impl class runs | 36 // trampolined to a private RTCVideoEncoder::Impl instance. The Impl class runs |
37 // on the worker thread queried from the |gpu_factories_|, which is presently | 37 // on the worker thread queried from the |gpu_factories_|, which is presently |
38 // the media thread. RTCVideoEncoder itself is run and destroyed on the thread | 38 // the media thread. RTCVideoEncoder is sychronized by webrtc::VideoSender. |
39 // it is constructed on, which is presently the libjingle worker thread. | 39 // webrtc::VideoEncoder methods do not run concurrently. RTCVideoEncoder is run |
40 // Callbacks from the Impl due to its VEA::Client notifications are also posted | 40 // and destroyed on the thread it is constructed on, which is presently the |
41 // back to RTCVideoEncoder on this thread. | 41 // libjingle worker thread. Encode is run on ViECaptureThread. SetRates and |
| 42 // SetChannelParameters are run on ProcessThread or the libjingle worker thread. |
| 43 // Callbacks from the Impl due to its VEA::Client notifications are posted back |
| 44 // to RTCVideoEncoder on the libjingle worker thread. |
42 class CONTENT_EXPORT RTCVideoEncoder | 45 class CONTENT_EXPORT RTCVideoEncoder |
43 : NON_EXPORTED_BASE(public webrtc::VideoEncoder) { | 46 : NON_EXPORTED_BASE(public webrtc::VideoEncoder) { |
44 public: | 47 public: |
45 RTCVideoEncoder( | 48 RTCVideoEncoder( |
46 webrtc::VideoCodecType type, | 49 webrtc::VideoCodecType type, |
47 media::VideoCodecProfile profile, | 50 media::VideoCodecProfile profile, |
48 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories); | 51 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories); |
49 virtual ~RTCVideoEncoder(); | 52 virtual ~RTCVideoEncoder(); |
50 | 53 |
51 // webrtc::VideoEncoder implementation. Tasks are posted to |impl_| using the | 54 // webrtc::VideoEncoder implementation. Tasks are posted to |impl_| using the |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // RTCVideoEncoder. | 106 // RTCVideoEncoder. |
104 // NOTE: Weak pointers must be invalidated before all other member variables. | 107 // NOTE: Weak pointers must be invalidated before all other member variables. |
105 base::WeakPtrFactory<RTCVideoEncoder> weak_factory_; | 108 base::WeakPtrFactory<RTCVideoEncoder> weak_factory_; |
106 | 109 |
107 DISALLOW_COPY_AND_ASSIGN(RTCVideoEncoder); | 110 DISALLOW_COPY_AND_ASSIGN(RTCVideoEncoder); |
108 }; | 111 }; |
109 | 112 |
110 } // namespace content | 113 } // namespace content |
111 | 114 |
112 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ | 115 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ |
OLD | NEW |