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 "media/blink/websourcebuffer_impl.h" | 5 #include "media/blink/websourcebuffer_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <limits> | 10 #include <limits> |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 case MediaTrack::Video: | 175 case MediaTrack::Video: |
176 return blink::WebMediaPlayer::VideoTrack; | 176 return blink::WebMediaPlayer::VideoTrack; |
177 } | 177 } |
178 NOTREACHED(); | 178 NOTREACHED(); |
179 return blink::WebMediaPlayer::AudioTrack; | 179 return blink::WebMediaPlayer::AudioTrack; |
180 } | 180 } |
181 | 181 |
182 void WebSourceBufferImpl::InitSegmentReceived( | 182 void WebSourceBufferImpl::InitSegmentReceived( |
183 std::unique_ptr<MediaTracks> tracks) { | 183 std::unique_ptr<MediaTracks> tracks) { |
184 DCHECK(tracks.get()); | 184 DCHECK(tracks.get()); |
185 DVLOG(1) << __FUNCTION__ << " tracks=" << tracks->tracks().size(); | 185 DVLOG(1) << __func__ << " tracks=" << tracks->tracks().size(); |
186 | 186 |
187 std::vector<blink::WebSourceBufferClient::MediaTrackInfo> trackInfoVector; | 187 std::vector<blink::WebSourceBufferClient::MediaTrackInfo> trackInfoVector; |
188 for (const auto& track : tracks->tracks()) { | 188 for (const auto& track : tracks->tracks()) { |
189 blink::WebSourceBufferClient::MediaTrackInfo trackInfo; | 189 blink::WebSourceBufferClient::MediaTrackInfo trackInfo; |
190 trackInfo.trackType = mediaTrackTypeToBlink(track->type()); | 190 trackInfo.trackType = mediaTrackTypeToBlink(track->type()); |
191 trackInfo.id = blink::WebString::fromUTF8(track->id()); | 191 trackInfo.id = blink::WebString::fromUTF8(track->id()); |
192 trackInfo.byteStreamTrackID = blink::WebString::fromUTF8( | 192 trackInfo.byteStreamTrackID = blink::WebString::fromUTF8( |
193 base::UintToString(track->bytestream_track_id())); | 193 base::UintToString(track->bytestream_track_id())); |
194 trackInfo.kind = blink::WebString::fromUTF8(track->kind()); | 194 trackInfo.kind = blink::WebString::fromUTF8(track->kind()); |
195 trackInfo.label = blink::WebString::fromUTF8(track->label()); | 195 trackInfo.label = blink::WebString::fromUTF8(track->label()); |
196 trackInfo.language = blink::WebString::fromUTF8(track->language()); | 196 trackInfo.language = blink::WebString::fromUTF8(track->language()); |
197 trackInfoVector.push_back(trackInfo); | 197 trackInfoVector.push_back(trackInfo); |
198 } | 198 } |
199 | 199 |
200 client_->initializationSegmentReceived(trackInfoVector); | 200 client_->initializationSegmentReceived(trackInfoVector); |
201 } | 201 } |
202 | 202 |
203 } // namespace media | 203 } // namespace media |
OLD | NEW |