OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/client/plugin/chromoting_instance.h" | 5 #include "remoting/client/plugin/chromoting_instance.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 const webrtc::DesktopRegion& shape) { | 1189 const webrtc::DesktopRegion& shape) { |
1190 SetDesktopShape(shape); | 1190 SetDesktopShape(shape); |
1191 } | 1191 } |
1192 | 1192 |
1193 void ChromotingInstance::OnMediaSourceReset(const std::string& format) { | 1193 void ChromotingInstance::OnMediaSourceReset(const std::string& format) { |
1194 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 1194 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
1195 data->SetString("format", format); | 1195 data->SetString("format", format); |
1196 PostLegacyJsonMessage("mediaSourceReset", data.Pass()); | 1196 PostLegacyJsonMessage("mediaSourceReset", data.Pass()); |
1197 } | 1197 } |
1198 | 1198 |
1199 void ChromotingInstance::OnMediaSourceData(uint8_t* buffer, | 1199 void ChromotingInstance::OnMediaSourceData(uint8_t* buffer, size_t buffer_size, |
1200 size_t buffer_size) { | 1200 bool keyframe) { |
1201 pp::VarArrayBuffer array_buffer(buffer_size); | 1201 pp::VarArrayBuffer array_buffer(buffer_size); |
1202 void* data_ptr = array_buffer.Map(); | 1202 void* data_ptr = array_buffer.Map(); |
1203 memcpy(data_ptr, buffer, buffer_size); | 1203 memcpy(data_ptr, buffer, buffer_size); |
1204 array_buffer.Unmap(); | 1204 array_buffer.Unmap(); |
1205 pp::VarDictionary data_dictionary; | 1205 pp::VarDictionary data_dictionary; |
1206 data_dictionary.Set(pp::Var("buffer"), array_buffer); | 1206 data_dictionary.Set(pp::Var("buffer"), array_buffer); |
| 1207 data_dictionary.Set(pp::Var("keyframe"), keyframe); |
1207 PostChromotingMessage("mediaSourceData", data_dictionary); | 1208 PostChromotingMessage("mediaSourceData", data_dictionary); |
1208 } | 1209 } |
1209 | 1210 |
1210 } // namespace remoting | 1211 } // namespace remoting |
OLD | NEW |