OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "content/renderer/media/peer_connection_tracker.h" | 5 #include "content/renderer/media/peer_connection_tracker.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 const blink::WebMediaStreamTrack& component) { | 87 const blink::WebMediaStreamTrack& component) { |
88 return component.source().id().utf8(); | 88 return component.source().id().utf8(); |
89 } | 89 } |
90 | 90 |
91 static std::string SerializeMediaDescriptor( | 91 static std::string SerializeMediaDescriptor( |
92 const blink::WebMediaStream& stream) { | 92 const blink::WebMediaStream& stream) { |
93 std::string id = stream.id().utf8(); | 93 std::string id = stream.id().utf8(); |
94 std::string result = "id: " + id; | 94 std::string result = "id: " + id; |
95 blink::WebVector<blink::WebMediaStreamTrack> tracks; | 95 blink::WebVector<blink::WebMediaStreamTrack> tracks; |
96 stream.audioTracks(tracks); | 96 stream.audioTracks(tracks); |
97 if (!tracks.isEmpty()) { | 97 if (!tracks.empty()) { |
98 result += ", audio: ["; | 98 result += ", audio: ["; |
99 for (size_t i = 0; i < tracks.size(); ++i) { | 99 for (size_t i = 0; i < tracks.size(); ++i) { |
100 result += SerializeMediaStreamComponent(tracks[i]); | 100 result += SerializeMediaStreamComponent(tracks[i]); |
101 if (i != tracks.size() - 1) | 101 if (i != tracks.size() - 1) |
102 result += ", "; | 102 result += ", "; |
103 } | 103 } |
104 result += "]"; | 104 result += "]"; |
105 } | 105 } |
106 stream.videoTracks(tracks); | 106 stream.videoTracks(tracks); |
107 if (!tracks.isEmpty()) { | 107 if (!tracks.empty()) { |
108 result += ", video: ["; | 108 result += ", video: ["; |
109 for (size_t i = 0; i < tracks.size(); ++i) { | 109 for (size_t i = 0; i < tracks.size(); ++i) { |
110 result += SerializeMediaStreamComponent(tracks[i]); | 110 result += SerializeMediaStreamComponent(tracks[i]); |
111 if (i != tracks.size() - 1) | 111 if (i != tracks.size() - 1) |
112 result += ", "; | 112 result += ", "; |
113 } | 113 } |
114 result += "]"; | 114 result += "]"; |
115 } | 115 } |
116 return result; | 116 return result; |
117 } | 117 } |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 DCHECK(main_thread_.CalledOnValidThread()); | 741 DCHECK(main_thread_.CalledOnValidThread()); |
742 SendTarget()->Send(new PeerConnectionTrackerHost_UpdatePeerConnection( | 742 SendTarget()->Send(new PeerConnectionTrackerHost_UpdatePeerConnection( |
743 local_id, std::string(callback_type), value)); | 743 local_id, std::string(callback_type), value)); |
744 } | 744 } |
745 | 745 |
746 void PeerConnectionTracker::OverrideSendTargetForTesting(RenderThread* target) { | 746 void PeerConnectionTracker::OverrideSendTargetForTesting(RenderThread* target) { |
747 send_target_for_test_ = target; | 747 send_target_for_test_ = target; |
748 } | 748 } |
749 | 749 |
750 } // namespace content | 750 } // namespace content |
OLD | NEW |