Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 329663002: Fix MediaSource renderer to limit memory consumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/client/plugin/media_source_video_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698