| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 return result.str(); | 83 return result.str(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 static std::string SerializeMediaStreamComponent( | 86 static std::string SerializeMediaStreamComponent( |
| 87 const blink::WebMediaStreamTrack& component) { | 87 const blink::WebMediaStreamTrack& component) { |
| 88 return base::UTF16ToUTF8(base::StringPiece16(component.source().id())); | 88 return base::UTF16ToUTF8(base::StringPiece16(component.source().id())); |
| 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 label = base::UTF16ToUTF8(base::StringPiece16(stream.id())); | 93 std::string id = base::UTF16ToUTF8(base::StringPiece16(stream.id())); |
| 94 std::string result = "label: " + label; | 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.isEmpty()) { |
| 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 += "]"; |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 DCHECK(main_thread_.CalledOnValidThread()); | 743 DCHECK(main_thread_.CalledOnValidThread()); |
| 744 SendTarget()->Send(new PeerConnectionTrackerHost_UpdatePeerConnection( | 744 SendTarget()->Send(new PeerConnectionTrackerHost_UpdatePeerConnection( |
| 745 local_id, std::string(callback_type), value)); | 745 local_id, std::string(callback_type), value)); |
| 746 } | 746 } |
| 747 | 747 |
| 748 void PeerConnectionTracker::OverrideSendTargetForTesting(RenderThread* target) { | 748 void PeerConnectionTracker::OverrideSendTargetForTesting(RenderThread* target) { |
| 749 send_target_for_test_ = target; | 749 send_target_for_test_ = target; |
| 750 } | 750 } |
| 751 | 751 |
| 752 } // namespace content | 752 } // namespace content |
| OLD | NEW |