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 <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
7 #include <algorithm> | 10 #include <algorithm> |
8 #include <functional> | 11 #include <functional> |
9 #include <iterator> | 12 #include <iterator> |
10 #include <string> | 13 #include <string> |
11 #include <vector> | 14 #include <vector> |
12 | 15 |
13 #include "base/location.h" | 16 #include "base/location.h" |
14 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/macros.h" |
15 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
16 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
17 #include "base/thread_task_runner_handle.h" | 21 #include "base/thread_task_runner_handle.h" |
18 #include "chrome/common/extensions/api/cast_streaming_receiver_session.h" | 22 #include "chrome/common/extensions/api/cast_streaming_receiver_session.h" |
19 #include "chrome/common/extensions/api/cast_streaming_rtp_stream.h" | 23 #include "chrome/common/extensions/api/cast_streaming_rtp_stream.h" |
20 #include "chrome/common/extensions/api/cast_streaming_udp_transport.h" | 24 #include "chrome/common/extensions/api/cast_streaming_udp_transport.h" |
21 #include "chrome/renderer/media/cast_receiver_session.h" | 25 #include "chrome/renderer/media/cast_receiver_session.h" |
22 #include "chrome/renderer/media/cast_rtp_stream.h" | 26 #include "chrome/renderer/media/cast_rtp_stream.h" |
23 #include "chrome/renderer/media/cast_session.h" | 27 #include "chrome/renderer/media/cast_session.h" |
24 #include "chrome/renderer/media/cast_udp_transport.h" | 28 #include "chrome/renderer/media/cast_udp_transport.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 74 } |
71 | 75 |
72 void FromCastCodecSpecificParams(const CastCodecSpecificParams& cast_params, | 76 void FromCastCodecSpecificParams(const CastCodecSpecificParams& cast_params, |
73 CodecSpecificParams* ext_params) { | 77 CodecSpecificParams* ext_params) { |
74 ext_params->key = cast_params.key; | 78 ext_params->key = cast_params.key; |
75 ext_params->value = cast_params.value; | 79 ext_params->value = cast_params.value; |
76 } | 80 } |
77 | 81 |
78 namespace { | 82 namespace { |
79 bool HexDecode(const std::string& input, std::string* output) { | 83 bool HexDecode(const std::string& input, std::string* output) { |
80 std::vector<uint8> bytes; | 84 std::vector<uint8_t> bytes; |
81 if (!base::HexStringToBytes(input, &bytes)) | 85 if (!base::HexStringToBytes(input, &bytes)) |
82 return false; | 86 return false; |
83 output->assign(reinterpret_cast<const char*>(&bytes[0]), bytes.size()); | 87 output->assign(reinterpret_cast<const char*>(&bytes[0]), bytes.size()); |
84 return true; | 88 return true; |
85 } | 89 } |
86 } // namespace | 90 } // namespace |
87 | 91 |
88 bool ToCastRtpPayloadParamsOrThrow(v8::Isolate* isolate, | 92 bool ToCastRtpPayloadParamsOrThrow(v8::Isolate* isolate, |
89 const RtpPayloadParams& ext_params, | 93 const RtpPayloadParams& ext_params, |
90 CastRtpPayloadParams* cast_params) { | 94 CastRtpPayloadParams* cast_params) { |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 void CastStreamingNativeHandler::AddTracksToMediaStream( | 861 void CastStreamingNativeHandler::AddTracksToMediaStream( |
858 const std::string& url, | 862 const std::string& url, |
859 const media::AudioParameters& params, | 863 const media::AudioParameters& params, |
860 scoped_refptr<media::AudioCapturerSource> audio, | 864 scoped_refptr<media::AudioCapturerSource> audio, |
861 scoped_ptr<media::VideoCapturerSource> video) { | 865 scoped_ptr<media::VideoCapturerSource> video) { |
862 content::AddAudioTrackToMediaStream(audio, params, true, true, url); | 866 content::AddAudioTrackToMediaStream(audio, params, true, true, url); |
863 content::AddVideoTrackToMediaStream(video.Pass(), true, true, url); | 867 content::AddVideoTrackToMediaStream(video.Pass(), true, true, url); |
864 } | 868 } |
865 | 869 |
866 } // namespace extensions | 870 } // namespace extensions |
OLD | NEW |