mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
pbos@webrtc.org | fd39e13 | 2013-08-14 13:52:52 +0000 | [diff] [blame^] | 10 | #ifndef WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_CALL_H_ |
| 11 | #define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_CALL_H_ |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 12 | |
| 13 | #include <string> |
| 14 | #include <vector> |
| 15 | |
| 16 | #include "webrtc/common_types.h" |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 17 | #include "webrtc/video_engine/new_include/video_receive_stream.h" |
| 18 | #include "webrtc/video_engine/new_include/video_send_stream.h" |
| 19 | |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 20 | namespace webrtc { |
| 21 | namespace newapi { |
| 22 | |
| 23 | class VoiceEngine; |
| 24 | |
| 25 | const char* Version(); |
| 26 | |
| 27 | class PacketReceiver { |
| 28 | public: |
pbos@webrtc.org | 4052370 | 2013-08-05 12:49:22 +0000 | [diff] [blame] | 29 | virtual bool DeliverPacket(const uint8_t* packet, size_t length) = 0; |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 30 | |
| 31 | protected: |
| 32 | virtual ~PacketReceiver() {} |
| 33 | }; |
| 34 | |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 35 | // A VideoCall instance can contain several send and/or receive streams. All |
| 36 | // streams are assumed to have the same remote endpoint and will share bitrate |
| 37 | // estimates etc. |
| 38 | class VideoCall { |
| 39 | public: |
mflodman@webrtc.org | 6879c8a | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 40 | struct Config { |
pbos@webrtc.org | fd39e13 | 2013-08-14 13:52:52 +0000 | [diff] [blame^] | 41 | explicit Config(Transport* send_transport) |
| 42 | : send_transport(send_transport), |
| 43 | overuse_detection(false), |
| 44 | voice_engine(NULL), |
| 45 | trace_callback(NULL), |
| 46 | trace_filter(kTraceNone) {} |
mflodman@webrtc.org | 6879c8a | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 47 | |
| 48 | Transport* send_transport; |
| 49 | bool overuse_detection; |
pbos@webrtc.org | fd39e13 | 2013-08-14 13:52:52 +0000 | [diff] [blame^] | 50 | |
| 51 | // VoiceEngine used for audio/video synchronization for this VideoCall. |
| 52 | VoiceEngine* voice_engine; |
| 53 | |
| 54 | TraceCallback* trace_callback; |
| 55 | uint32_t trace_filter; |
mflodman@webrtc.org | 6879c8a | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 56 | }; |
| 57 | |
pbos@webrtc.org | fd39e13 | 2013-08-14 13:52:52 +0000 | [diff] [blame^] | 58 | static VideoCall* Create(const VideoCall::Config& config); |
| 59 | |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 60 | virtual std::vector<VideoCodec> GetVideoCodecs() = 0; |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 61 | |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 62 | virtual VideoSendStream::Config GetDefaultSendConfig() = 0; |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 63 | |
| 64 | virtual VideoSendStream* CreateSendStream( |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 65 | const VideoSendStream::Config& config) = 0; |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 66 | |
| 67 | // Returns the internal state of the send stream, for resume sending with a |
| 68 | // new stream with different settings. |
| 69 | // Note: Only the last returned send-stream state is valid. |
| 70 | virtual SendStreamState* DestroySendStream(VideoSendStream* send_stream) = 0; |
| 71 | |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 72 | virtual VideoReceiveStream::Config GetDefaultReceiveConfig() = 0; |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 73 | |
| 74 | virtual VideoReceiveStream* CreateReceiveStream( |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 75 | const VideoReceiveStream::Config& config) = 0; |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 76 | virtual void DestroyReceiveStream(VideoReceiveStream* receive_stream) = 0; |
| 77 | |
| 78 | // All received RTP and RTCP packets for the call should be inserted to this |
| 79 | // PacketReceiver. The PacketReceiver pointer is valid as long as the |
| 80 | // VideoCall instance exists. |
| 81 | virtual PacketReceiver* Receiver() = 0; |
| 82 | |
| 83 | // Returns the estimated total send bandwidth. Note: this can differ from the |
| 84 | // actual encoded bitrate. |
| 85 | virtual uint32_t SendBitrateEstimate() = 0; |
| 86 | |
| 87 | // Returns the total estimated receive bandwidth for the call. Note: this can |
| 88 | // differ from the actual receive bitrate. |
| 89 | virtual uint32_t ReceiveBitrateEstimate() = 0; |
| 90 | |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 91 | virtual ~VideoCall() {} |
| 92 | }; |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 93 | } // namespace newapi |
| 94 | } // namespace webrtc |
| 95 | |
pbos@webrtc.org | fd39e13 | 2013-08-14 13:52:52 +0000 | [diff] [blame^] | 96 | #endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_CALL_H_ |