| 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 CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ | 5 #ifndef CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ |
| 6 #define CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ | 6 #define CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 13 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 14 | 14 |
| 15 class CastSession; | 15 class CastSession; |
| 16 class CastUdpTransport; | |
| 17 | 16 |
| 18 // A key value pair structure for codec specific parameters. | 17 // A key value pair structure for codec specific parameters. |
| 19 struct CastCodecSpecificParams { | 18 struct CastCodecSpecificParams { |
| 20 std::string key; | 19 std::string key; |
| 21 std::string value; | 20 std::string value; |
| 22 | 21 |
| 23 CastCodecSpecificParams(); | 22 CastCodecSpecificParams(); |
| 24 ~CastCodecSpecificParams(); | 23 ~CastCodecSpecificParams(); |
| 25 }; | 24 }; |
| 26 | 25 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 67 |
| 69 // Names of supported FEC (Forward Error Correction) mechanisms. | 68 // Names of supported FEC (Forward Error Correction) mechanisms. |
| 70 std::vector<std::string> fec_mechanisms; | 69 std::vector<std::string> fec_mechanisms; |
| 71 | 70 |
| 72 CastRtpCaps(); | 71 CastRtpCaps(); |
| 73 ~CastRtpCaps(); | 72 ~CastRtpCaps(); |
| 74 }; | 73 }; |
| 75 | 74 |
| 76 typedef CastRtpCaps CastRtpParams; | 75 typedef CastRtpCaps CastRtpParams; |
| 77 | 76 |
| 78 // This class takes input from audio and/or video WebMediaStreamTracks | 77 // This object represents a RTP stream that encodes and optionally |
| 79 // and then send the encoded streams to the underlying transport, | 78 // encrypt audio or video data from a WebMediaStreamTrack. |
| 80 // e.g. a UDP transport. It also allows configuration of the encoded | 79 // Note that this object does not actually output packets. It allows |
| 80 // configuration of encoding and RTP parameters and control such a logical |
| 81 // stream. | 81 // stream. |
| 82 class CastSendTransport { | 82 class CastSendTransport { |
| 83 public: | 83 public: |
| 84 CastSendTransport(CastUdpTransport* udp_transport, | 84 CastSendTransport(const blink::WebMediaStreamTrack& track, |
| 85 const blink::WebMediaStreamTrack& track); | 85 const scoped_refptr<CastSession>& session); |
| 86 ~CastSendTransport(); | 86 ~CastSendTransport(); |
| 87 | 87 |
| 88 // Return capabilities currently supported by this transport. | 88 // Return capabilities currently supported by this transport. |
| 89 CastRtpCaps GetCaps(); | 89 CastRtpCaps GetCaps(); |
| 90 | 90 |
| 91 // Return parameters set to this transport. | 91 // Return parameters set to this transport. |
| 92 CastRtpParams GetParams(); | 92 CastRtpParams GetParams(); |
| 93 | 93 |
| 94 // Begin encoding of media stream and then submit the encoded streams | 94 // Begin encoding of media stream and then submit the encoded streams |
| 95 // to underlying transport. | 95 // to underlying transport. |
| 96 void Start(const CastRtpParams& params); | 96 void Start(const CastRtpParams& params); |
| 97 | 97 |
| 98 // Stop encoding. | 98 // Stop encoding. |
| 99 void Stop(); | 99 void Stop(); |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 // Return true if this track is an audio track. Return false if this | 102 // Return true if this track is an audio track. Return false if this |
| 103 // track is a video track. | 103 // track is a video track. |
| 104 bool IsAudio() const; | 104 bool IsAudio() const; |
| 105 | 105 |
| 106 blink::WebMediaStreamTrack track_; |
| 106 const scoped_refptr<CastSession> cast_session_; | 107 const scoped_refptr<CastSession> cast_session_; |
| 107 blink::WebMediaStreamTrack track_; | |
| 108 CastRtpParams params_; | 108 CastRtpParams params_; |
| 109 | 109 |
| 110 DISALLOW_COPY_AND_ASSIGN(CastSendTransport); | 110 DISALLOW_COPY_AND_ASSIGN(CastSendTransport); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 #endif // CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ | 113 #endif // CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ |
| OLD | NEW |