| OLD | NEW |
| 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/extensions/cast_streaming_native_handler.h" | 5 #include "chrome/renderer/extensions/cast_streaming_native_handler.h" |
| 6 | 6 |
| 7 #include <functional> | 7 #include <functional> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 output->assign(reinterpret_cast<const char*>(&bytes[0]), bytes.size()); | 64 output->assign(reinterpret_cast<const char*>(&bytes[0]), bytes.size()); |
| 65 return true; | 65 return true; |
| 66 } | 66 } |
| 67 } // namespace | 67 } // namespace |
| 68 | 68 |
| 69 bool ToCastRtpPayloadParamsOrThrow(v8::Isolate* isolate, | 69 bool ToCastRtpPayloadParamsOrThrow(v8::Isolate* isolate, |
| 70 const RtpPayloadParams& ext_params, | 70 const RtpPayloadParams& ext_params, |
| 71 CastRtpPayloadParams* cast_params) { | 71 CastRtpPayloadParams* cast_params) { |
| 72 cast_params->payload_type = ext_params.payload_type; | 72 cast_params->payload_type = ext_params.payload_type; |
| 73 cast_params->max_latency_ms = ext_params.max_latency; | 73 cast_params->max_latency_ms = ext_params.max_latency; |
| 74 cast_params->min_latency_ms = |
| 75 ext_params.min_latency ? *ext_params.min_latency : ext_params.max_latency; |
| 74 cast_params->codec_name = ext_params.codec_name; | 76 cast_params->codec_name = ext_params.codec_name; |
| 75 cast_params->ssrc = ext_params.ssrc; | 77 cast_params->ssrc = ext_params.ssrc; |
| 76 cast_params->feedback_ssrc = ext_params.feedback_ssrc; | 78 cast_params->feedback_ssrc = ext_params.feedback_ssrc; |
| 77 cast_params->clock_rate = ext_params.clock_rate ? *ext_params.clock_rate : 0; | 79 cast_params->clock_rate = ext_params.clock_rate ? *ext_params.clock_rate : 0; |
| 78 cast_params->min_bitrate = | 80 cast_params->min_bitrate = |
| 79 ext_params.min_bitrate ? *ext_params.min_bitrate : 0; | 81 ext_params.min_bitrate ? *ext_params.min_bitrate : 0; |
| 80 cast_params->max_bitrate = | 82 cast_params->max_bitrate = |
| 81 ext_params.max_bitrate ? *ext_params.max_bitrate : 0; | 83 ext_params.max_bitrate ? *ext_params.max_bitrate : 0; |
| 82 cast_params->channels = ext_params.channels ? *ext_params.channels : 0; | 84 cast_params->channels = ext_params.channels ? *ext_params.channels : 0; |
| 83 cast_params->max_frame_rate = | 85 cast_params->max_frame_rate = |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 transport_id); | 582 transport_id); |
| 581 if (iter != udp_transport_map_.end()) | 583 if (iter != udp_transport_map_.end()) |
| 582 return iter->second.get(); | 584 return iter->second.get(); |
| 583 v8::Isolate* isolate = context()->v8_context()->GetIsolate(); | 585 v8::Isolate* isolate = context()->v8_context()->GetIsolate(); |
| 584 isolate->ThrowException(v8::Exception::RangeError( | 586 isolate->ThrowException(v8::Exception::RangeError( |
| 585 v8::String::NewFromUtf8(isolate, kUdpTransportNotFound))); | 587 v8::String::NewFromUtf8(isolate, kUdpTransportNotFound))); |
| 586 return NULL; | 588 return NULL; |
| 587 } | 589 } |
| 588 | 590 |
| 589 } // namespace extensions | 591 } // namespace extensions |
| OLD | NEW |