Chromium Code Reviews| Index: webrtc/stream.h |
| diff --git a/webrtc/stream.h b/webrtc/stream.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..58d56d2edddcd7d5238020a6d211ee366216c4ae |
| --- /dev/null |
| +++ b/webrtc/stream.h |
| @@ -0,0 +1,54 @@ |
| +/* |
| + * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| + * |
| + * Use of this source code is governed by a BSD-style license |
| + * that can be found in the LICENSE file in the root of the source |
| + * tree. An additional intellectual property rights grant can be found |
| + * in the file PATENTS. All contributing project authors may |
| + * be found in the AUTHORS file in the root of the source tree. |
| + */ |
| +#ifndef WEBRTC_STREAM_H_ |
| +#define WEBRTC_STREAM_H_ |
| + |
| +#include "webrtc/common_types.h" |
| + |
| +namespace webrtc { |
| + |
| +enum NetworkState { |
| + kNetworkUp, |
| + kNetworkDown, |
| +}; |
| + |
| +// Common base class for streams. |
| +class Stream { |
| + public: |
| + // Starts stream activity. |
| + // When a stream is active, it can receive, process and deliver samples. |
|
pbos-webrtc
2015/07/15 13:06:53
s/samples/packets/
Jelena
2015/07/15 14:21:45
Done.
|
| + virtual void Start() = 0; |
| + // Stops stream activity. |
| + // When a stream is stopped, it can't receive, process or deliver samples. |
| + virtual void Stop() = 0; |
| + // Called to notify that network state has changed. |
|
pbos-webrtc
2015/07/15 13:06:53
Used to stop encoding and sending data while the n
|
| + virtual void SignalNetworkState(NetworkState state) = 0; |
| + // Called when a RTCP packet is received. |
| + virtual bool DeliverRtcp(const uint8_t* packet, size_t length) = 0; |
| + |
| + protected: |
| + virtual ~Stream() {} |
| +}; |
| + |
| +// Common base class for receive streams. |
| +class ReceiveStream : public Stream { |
| + public: |
| + // Called when a RTP packet is received. |
| + virtual bool DeliverRtp(const uint8_t* packet, size_t length) = 0; |
| +}; |
| + |
| +// Common base class for send streams. |
| +// A tag class that represents send stream concept and serves as a placeholder |
| +// for future functionality. |
|
pbos-webrtc
2015/07/15 13:06:53
Remove the "serves as a placeholder..", we don't a
Jelena
2015/07/15 14:21:45
I agree that at a first glance, having an empty cl
|
| +class SendStream : public Stream {}; |
| + |
| +} // namespace webrtc |
| + |
| +#endif // WEBRTC_STREAM_H_ |