OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "webkit/media/android/media_source_delegate.h" | 5 #include "webkit/media/android/media_source_delegate.h" |
6 | 6 |
7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "media/base/android/demuxer_stream_player_params.h" | 9 #include "media/base/android/demuxer_stream_player_params.h" |
10 #include "media/base/bind_to_loop.h" | 10 #include "media/base/bind_to_loop.h" |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 366 |
367 if (proxy_) | 367 if (proxy_) |
368 proxy_->ReadFromDemuxerAck(player_id_, *params); | 368 proxy_->ReadFromDemuxerAck(player_id_, *params); |
369 params->access_units.resize(0); | 369 params->access_units.resize(0); |
370 } | 370 } |
371 | 371 |
372 void MediaSourceDelegate::OnDemuxerError( | 372 void MediaSourceDelegate::OnDemuxerError( |
373 media::PipelineStatus status) { | 373 media::PipelineStatus status) { |
374 DVLOG(1) << "MediaSourceDelegate::OnDemuxerError(" << status << ") : " | 374 DVLOG(1) << "MediaSourceDelegate::OnDemuxerError(" << status << ") : " |
375 << player_id_; | 375 << player_id_; |
376 if (status != media::PIPELINE_OK) { | 376 if (status != media::PIPELINE_OK && !update_network_state_cb_.is_null()) |
377 DCHECK(status == media::DEMUXER_ERROR_COULD_NOT_OPEN || | 377 update_network_state_cb_.Run(PipelineErrorToNetworkState(status)); |
378 status == media::DEMUXER_ERROR_COULD_NOT_PARSE || | |
379 status == media::DEMUXER_ERROR_NO_SUPPORTED_STREAMS) | |
380 << "Unexpected error from demuxer: " << static_cast<int>(status); | |
381 if (!update_network_state_cb_.is_null()) | |
382 update_network_state_cb_.Run(WebMediaPlayer::NetworkStateFormatError); | |
383 } | |
384 } | 378 } |
385 | 379 |
386 void MediaSourceDelegate::OnDemuxerInitDone( | 380 void MediaSourceDelegate::OnDemuxerInitDone( |
387 media::PipelineStatus status) { | 381 media::PipelineStatus status) { |
388 DVLOG(1) << "MediaSourceDelegate::OnDemuxerInitDone(" << status << ") : " | 382 DVLOG(1) << "MediaSourceDelegate::OnDemuxerInitDone(" << status << ") : " |
389 << player_id_; | 383 << player_id_; |
390 if (status != media::PIPELINE_OK) { | 384 if (status != media::PIPELINE_OK) { |
391 OnDemuxerError(status); | 385 OnDemuxerError(status); |
392 return; | 386 return; |
393 } | 387 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 void MediaSourceDelegate::OnDecryptorReady(media::Decryptor* decryptor) {} | 505 void MediaSourceDelegate::OnDecryptorReady(media::Decryptor* decryptor) {} |
512 | 506 |
513 scoped_ptr<media::TextTrack> MediaSourceDelegate::OnAddTextTrack( | 507 scoped_ptr<media::TextTrack> MediaSourceDelegate::OnAddTextTrack( |
514 media::TextKind kind, | 508 media::TextKind kind, |
515 const std::string& label, | 509 const std::string& label, |
516 const std::string& language) { | 510 const std::string& language) { |
517 return scoped_ptr<media::TextTrack>(); | 511 return scoped_ptr<media::TextTrack>(); |
518 } | 512 } |
519 | 513 |
520 } // namespace webkit_media | 514 } // namespace webkit_media |
OLD | NEW |