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

Side by Side Diff: chrome/renderer/media/cast_session_delegate.cc

Issue 317823008: Cast: Add GeneralDescription proto to LogMetadata and populate it when (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « no previous file | media/cast/logging/proto/raw_events.proto » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 "chrome/renderer/media/cast_session_delegate.h" 5 #include "chrome/renderer/media/cast_session_delegate.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "chrome/common/chrome_version_info.h"
10 #include "chrome/renderer/media/cast_threads.h" 11 #include "chrome/renderer/media/cast_threads.h"
11 #include "chrome/renderer/media/cast_transport_sender_ipc.h" 12 #include "chrome/renderer/media/cast_transport_sender_ipc.h"
12 #include "content/public/renderer/render_thread.h" 13 #include "content/public/renderer/render_thread.h"
13 #include "media/cast/cast_config.h" 14 #include "media/cast/cast_config.h"
14 #include "media/cast/cast_environment.h" 15 #include "media/cast/cast_environment.h"
15 #include "media/cast/cast_sender.h" 16 #include "media/cast/cast_sender.h"
16 #include "media/cast/logging/log_serializer.h" 17 #include "media/cast/logging/log_serializer.h"
17 #include "media/cast/logging/logging_defines.h" 18 #include "media/cast/logging/logging_defines.h"
18 #include "media/cast/logging/proto/raw_events.pb.h" 19 #include "media/cast/logging/proto/raw_events.pb.h"
19 #include "media/cast/logging/raw_event_subscriber_bundle.h" 20 #include "media/cast/logging/raw_event_subscriber_bundle.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 138 }
138 139
139 media::cast::proto::LogMetadata metadata; 140 media::cast::proto::LogMetadata metadata;
140 media::cast::FrameEventList frame_events; 141 media::cast::FrameEventList frame_events;
141 media::cast::PacketEventList packet_events; 142 media::cast::PacketEventList packet_events;
142 143
143 subscriber->GetEventsAndReset(&metadata, &frame_events, &packet_events); 144 subscriber->GetEventsAndReset(&metadata, &frame_events, &packet_events);
144 145
145 if (!extra_data.empty()) 146 if (!extra_data.empty())
146 metadata.set_extra_data(extra_data); 147 metadata.set_extra_data(extra_data);
148 media::cast::proto::GeneralDescription* gen_desc =
149 metadata.mutable_general_description();
150 chrome::VersionInfo version_info;
151 gen_desc->set_product(version_info.Name());
152 gen_desc->set_product_version(version_info.Version());
153 gen_desc->set_os(version_info.OSType());
147 154
148 scoped_ptr<char[]> serialized_log(new char[media::cast::kMaxSerializedBytes]); 155 scoped_ptr<char[]> serialized_log(new char[media::cast::kMaxSerializedBytes]);
149 int output_bytes; 156 int output_bytes;
150 bool success = media::cast::SerializeEvents(metadata, 157 bool success = media::cast::SerializeEvents(metadata,
151 frame_events, 158 frame_events,
152 packet_events, 159 packet_events,
153 true, 160 true,
154 media::cast::kMaxSerializedBytes, 161 media::cast::kMaxSerializedBytes,
155 serialized_log.get(), 162 serialized_log.get(),
156 &output_bytes); 163 &output_bytes);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 cast_environment_->Logging()->InsertPacketEvent(it->timestamp, 228 cast_environment_->Logging()->InsertPacketEvent(it->timestamp,
222 it->type, 229 it->type,
223 it->media_type, 230 it->media_type,
224 it->rtp_timestamp, 231 it->rtp_timestamp,
225 it->frame_id, 232 it->frame_id,
226 it->packet_id, 233 it->packet_id,
227 it->max_packet_id, 234 it->max_packet_id,
228 it->size); 235 it->size);
229 } 236 }
230 } 237 }
OLDNEW
« no previous file with comments | « no previous file | media/cast/logging/proto/raw_events.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698