| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
| 12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <memory> | 15 #include <memory> |
| 16 #include <set> | 16 #include <set> |
| 17 #include <string> | 17 #include <string> |
| 18 #include <vector> | 18 #include <vector> |
| 19 | 19 |
| 20 #include "webrtc/api/call/transport.h" | 20 #include "webrtc/api/call/transport.h" |
| 21 #include "webrtc/api/video/video_frame.h" | 21 #include "webrtc/api/video/video_frame.h" |
| 22 #include "webrtc/base/asyncinvoker.h" | 22 #include "webrtc/base/asyncinvoker.h" |
| 23 #include "webrtc/base/criticalsection.h" | 23 #include "webrtc/base/criticalsection.h" |
| 24 #include "webrtc/base/networkroute.h" | 24 #include "webrtc/base/networkroute.h" |
| 25 #include "webrtc/base/optional.h" |
| 25 #include "webrtc/base/thread_annotations.h" | 26 #include "webrtc/base/thread_annotations.h" |
| 26 #include "webrtc/base/thread_checker.h" | 27 #include "webrtc/base/thread_checker.h" |
| 27 #include "webrtc/media/base/videosinkinterface.h" | |
| 28 #include "webrtc/media/base/videosourceinterface.h" | |
| 29 #include "webrtc/call/call.h" | 28 #include "webrtc/call/call.h" |
| 30 #include "webrtc/call/flexfec_receive_stream.h" | 29 #include "webrtc/call/flexfec_receive_stream.h" |
| 31 #include "webrtc/media/base/mediaengine.h" | 30 #include "webrtc/media/base/mediaengine.h" |
| 31 #include "webrtc/media/base/videosinkinterface.h" |
| 32 #include "webrtc/media/base/videosourceinterface.h" |
| 32 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" | 33 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" |
| 33 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" | 34 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" |
| 34 #include "webrtc/video_receive_stream.h" | 35 #include "webrtc/video_receive_stream.h" |
| 35 #include "webrtc/video_send_stream.h" | 36 #include "webrtc/video_send_stream.h" |
| 36 | 37 |
| 37 namespace webrtc { | 38 namespace webrtc { |
| 38 class VideoDecoder; | 39 class VideoDecoder; |
| 39 class VideoEncoder; | 40 class VideoEncoder; |
| 40 struct MediaConfig; | 41 struct MediaConfig; |
| 41 } | 42 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 // TODO(pbos): Remove, use external handlers only. | 77 // TODO(pbos): Remove, use external handlers only. |
| 77 class DefaultUnsignalledSsrcHandler : public UnsignalledSsrcHandler { | 78 class DefaultUnsignalledSsrcHandler : public UnsignalledSsrcHandler { |
| 78 public: | 79 public: |
| 79 DefaultUnsignalledSsrcHandler(); | 80 DefaultUnsignalledSsrcHandler(); |
| 80 Action OnUnsignalledSsrc(WebRtcVideoChannel2* channel, | 81 Action OnUnsignalledSsrc(WebRtcVideoChannel2* channel, |
| 81 uint32_t ssrc) override; | 82 uint32_t ssrc) override; |
| 82 | 83 |
| 83 rtc::VideoSinkInterface<webrtc::VideoFrame>* GetDefaultSink() const; | 84 rtc::VideoSinkInterface<webrtc::VideoFrame>* GetDefaultSink() const; |
| 84 void SetDefaultSink(VideoMediaChannel* channel, | 85 void SetDefaultSink(WebRtcVideoChannel2* channel, |
| 85 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink); | 86 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink); |
| 86 | 87 |
| 87 uint32_t default_recv_ssrc() const { return default_recv_ssrc_; } | |
| 88 | |
| 89 virtual ~DefaultUnsignalledSsrcHandler() = default; | 88 virtual ~DefaultUnsignalledSsrcHandler() = default; |
| 90 | 89 |
| 91 private: | 90 private: |
| 92 uint32_t default_recv_ssrc_; | |
| 93 rtc::VideoSinkInterface<webrtc::VideoFrame>* default_sink_; | 91 rtc::VideoSinkInterface<webrtc::VideoFrame>* default_sink_; |
| 94 }; | 92 }; |
| 95 | 93 |
| 96 // WebRtcVideoEngine2 is used for the new native WebRTC Video API (webrtc:1667). | 94 // WebRtcVideoEngine2 is used for the new native WebRTC Video API (webrtc:1667). |
| 97 class WebRtcVideoEngine2 { | 95 class WebRtcVideoEngine2 { |
| 98 public: | 96 public: |
| 99 WebRtcVideoEngine2(); | 97 WebRtcVideoEngine2(); |
| 100 virtual ~WebRtcVideoEngine2(); | 98 virtual ~WebRtcVideoEngine2(); |
| 101 | 99 |
| 102 // Basic video engine implementation. | 100 // Basic video engine implementation. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 const rtc::PacketTime& packet_time) override; | 168 const rtc::PacketTime& packet_time) override; |
| 171 void OnReadyToSend(bool ready) override; | 169 void OnReadyToSend(bool ready) override; |
| 172 void OnNetworkRouteChanged(const std::string& transport_name, | 170 void OnNetworkRouteChanged(const std::string& transport_name, |
| 173 const rtc::NetworkRoute& network_route) override; | 171 const rtc::NetworkRoute& network_route) override; |
| 174 void OnTransportOverheadChanged(int transport_overhead_per_packet) override; | 172 void OnTransportOverheadChanged(int transport_overhead_per_packet) override; |
| 175 void SetInterface(NetworkInterface* iface) override; | 173 void SetInterface(NetworkInterface* iface) override; |
| 176 | 174 |
| 177 // Implemented for VideoMediaChannelTest. | 175 // Implemented for VideoMediaChannelTest. |
| 178 bool sending() const { return sending_; } | 176 bool sending() const { return sending_; } |
| 179 | 177 |
| 178 rtc::Optional<uint32_t> GetDefaultReceiveStreamSsrc(); |
| 179 |
| 180 // AdaptReason is used for expressing why a WebRtcVideoSendStream request | 180 // AdaptReason is used for expressing why a WebRtcVideoSendStream request |
| 181 // a lower input frame size than the currently configured camera input frame | 181 // a lower input frame size than the currently configured camera input frame |
| 182 // size. There can be more than one reason OR:ed together. | 182 // size. There can be more than one reason OR:ed together. |
| 183 enum AdaptReason { | 183 enum AdaptReason { |
| 184 ADAPTREASON_NONE = 0, | 184 ADAPTREASON_NONE = 0, |
| 185 ADAPTREASON_CPU = 1, | 185 ADAPTREASON_CPU = 1, |
| 186 ADAPTREASON_BANDWIDTH = 2, | 186 ADAPTREASON_BANDWIDTH = 2, |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 private: | 189 private: |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 // send_params/recv_params, rtp_extensions, options, etc. | 501 // send_params/recv_params, rtp_extensions, options, etc. |
| 502 VideoSendParameters send_params_; | 502 VideoSendParameters send_params_; |
| 503 VideoOptions default_send_options_; | 503 VideoOptions default_send_options_; |
| 504 VideoRecvParameters recv_params_; | 504 VideoRecvParameters recv_params_; |
| 505 int64_t last_stats_log_ms_; | 505 int64_t last_stats_log_ms_; |
| 506 }; | 506 }; |
| 507 | 507 |
| 508 } // namespace cricket | 508 } // namespace cricket |
| 509 | 509 |
| 510 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 510 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
| OLD | NEW |