OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_PUBLIC_RENDERER_MEDIA_WEBRTC_CAST_SEND_TRANSPORT_H_ | |
jam
2013/10/11 16:47:14
nit: get rid of _MEDIA_
Alpha Left Google
2013/10/11 20:24:21
Done.
| |
6 #define CONTENT_PUBLIC_RENDERER_MEDIA_WEBRTC_CAST_SEND_TRANSPORT_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/callback.h" | |
jam
2013/10/11 16:47:14
nit: not needed
Alpha Left Google
2013/10/11 20:24:21
Done.
| |
12 #include "content/common/content_export.h" | |
13 | |
14 namespace WebKit { | |
15 class WebMediaStreamTrack; | |
16 } // namespace WebKit | |
17 | |
18 namespace content { | |
19 | |
20 class WebRtcUdpTransport; | |
21 | |
22 // A key value pair structure for codec specific parameters. | |
23 struct CONTENT_EXPORT WebRtcCodecSpecificParam { | |
jam
2013/10/11 16:47:14
this isn't used?
Alpha Left Google
2013/10/11 20:24:21
Thanks. I forgot to use this WebRtcRtpPayloadParam
| |
24 std::string key; | |
25 std::string value; | |
26 | |
27 WebRtcCodecSpecificParam(); | |
28 ~WebRtcCodecSpecificParam(); | |
29 }; | |
30 | |
31 // Defines the basic properties of a payload supported by cast transport. | |
32 struct CONTENT_EXPORT WebRtcRtpPayloadParam { | |
33 // RTP specific field that identifies the content type. | |
34 int payload_type; | |
35 | |
36 // RTP specific field to identify a stream. | |
37 int ssrc; | |
38 | |
39 // Update frequency of payload sample. | |
40 int clock_rate; | |
41 | |
42 // Uncompressed bitrate. | |
43 int bitrate; | |
44 | |
45 // Number of audio channels. | |
46 int channels; | |
47 | |
48 // Width and height of the video content. | |
49 int width; | |
50 int height; | |
51 | |
52 // Name of the codec used. | |
53 std::string codec_name; | |
54 | |
55 WebRtcRtpPayloadParam(); | |
jam
2013/10/11 16:47:14
can you inline this without getting a clang error?
Alpha Left Google
2013/10/11 20:24:21
I tried but clang complained that I should put the
| |
56 ~WebRtcRtpPayloadParam(); | |
57 }; | |
58 | |
59 // Defines the capabilities of the transport. | |
60 struct CONTENT_EXPORT WebRtcRtpCaps { | |
61 // Defines a list of supported payloads. | |
62 std::vector<WebRtcRtpPayloadParam> payloads; | |
63 | |
64 // Names of supported RTCP features. | |
65 std::vector<std::string> rtcp_features; | |
66 | |
67 // Names of supported FEC (Forward Error Correction) mechanisms. | |
68 std::vector<std::string> fec_mechanism; | |
69 | |
70 WebRtcRtpCaps(); | |
71 ~WebRtcRtpCaps(); | |
72 }; | |
73 | |
74 typedef WebRtcRtpCaps WebRtcRtpParams; | |
75 | |
76 // This interface defines operations needed by an application to use the | |
77 // Cast transport protocol and interact with WebRTC objects. | |
78 // This interface takes input from a WebMediaStreamTrack which contains | |
79 // audio or video stream and then send the encoded stream to the | |
80 // underlying transport, e.g. a UDP transport. | |
81 class CONTENT_EXPORT WebRtcCastSendTransport { | |
jam
2013/10/11 16:47:14
nit: export not needed
Alpha Left Google
2013/10/11 20:24:21
Done.
| |
82 public: | |
83 // Return capabilities currently spported by this transport. | |
84 virtual WebRtcRtpCaps getCaps() = 0; | |
jam
2013/10/11 16:47:14
nit: please check the google style guide
Alpha Left Google
2013/10/11 20:24:21
Oooops sorry.. Been doing too much blink lately.
| |
85 | |
86 // Return parameters set to this transport. | |
87 virtual WebRtcRtpParams getParams() = 0; | |
88 | |
89 // Return the best parameters given the capabilities of remote peer. | |
90 virtual WebRtcRtpParams createParams(WebRtcRtpCaps remote_caps) = 0; | |
91 | |
92 // Begin encoding of media stream from |track| and submit the encoded | |
93 // stream to underlying transport. | |
94 virtual void start( | |
95 WebKit::WebMediaStreamTrack* track, | |
96 WebRtcRtpParams params) = 0; | |
97 | |
98 // Stop encoding. | |
99 virtual void stop() = 0; | |
100 | |
101 protected: | |
102 virtual ~WebRtcCastSendTransport() {} | |
103 }; | |
104 | |
105 // Create a Cast send transport providing the underlying UDP transport. | |
106 CONTENT_EXPORT WebRtcCastSendTransport* CreateWebRtcCastSendTransport( | |
jam
2013/10/11 16:47:14
nit: put this as a static method in WebRtcCastSend
Alpha Left Google
2013/10/11 20:24:21
Done.
| |
107 WebRtcUdpTransport* udp_transport); | |
108 | |
109 } // namespace content | |
110 | |
111 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_WEBRTC_CAST_SEND_TRANSPORT_H_ | |
OLD | NEW |