| Index: content/renderer/media/android/media_source_delegate.cc
|
| diff --git a/content/renderer/media/android/media_source_delegate.cc b/content/renderer/media/android/media_source_delegate.cc
|
| index bd4cf1a02adcf5ee482d2fe9117035aca8e8136c..febdda84f9ace8d1f5809f50068f60390bf5228e 100644
|
| --- a/content/renderer/media/android/media_source_delegate.cc
|
| +++ b/content/renderer/media/android/media_source_delegate.cc
|
| @@ -66,9 +66,6 @@ MediaSourceDelegate::MediaSourceDelegate(
|
| doing_browser_seek_(false),
|
| browser_seek_time_(media::kNoTimestamp()),
|
| expecting_regular_seek_(false),
|
| -#if defined(GOOGLE_TV)
|
| - key_added_(false),
|
| -#endif
|
| access_unit_size_(0) {
|
| DCHECK(main_loop_->BelongsToCurrentThread());
|
| }
|
| @@ -174,26 +171,6 @@ void MediaSourceDelegate::InitializeDemuxer() {
|
| false);
|
| }
|
|
|
| -#if defined(GOOGLE_TV)
|
| -void MediaSourceDelegate::InitializeMediaStream(
|
| - media::Demuxer* demuxer,
|
| - const UpdateNetworkStateCB& update_network_state_cb) {
|
| - DCHECK(main_loop_->BelongsToCurrentThread());
|
| - DCHECK(demuxer);
|
| - demuxer_ = demuxer;
|
| - update_network_state_cb_ = media::BindToCurrentLoop(update_network_state_cb);
|
| - // When playing Media Stream, don't wait to accumulate multiple packets per
|
| - // IPC communication.
|
| - access_unit_size_ = 1;
|
| -
|
| - // |this| will be retained until StopDemuxer() is posted, so Unretained() is
|
| - // safe here.
|
| - media_loop_->PostTask(FROM_HERE,
|
| - base::Bind(&MediaSourceDelegate::InitializeDemuxer,
|
| - base::Unretained(this)));
|
| -}
|
| -#endif
|
| -
|
| const blink::WebTimeRanges& MediaSourceDelegate::Buffered() {
|
| buffered_web_time_ranges_ =
|
| ConvertToWebTimeRanges(buffered_time_ranges_);
|
| @@ -451,7 +428,6 @@ void MediaSourceDelegate::OnBufferReady(
|
|
|
| data->access_units[index].data.assign(
|
| buffer->data(), buffer->data() + buffer->data_size());
|
| -#if !defined(GOOGLE_TV)
|
| // Vorbis needs 4 extra bytes padding on Android. Check
|
| // NuMediaExtractor.cpp in Android source code.
|
| if (is_audio && media::kCodecVorbis ==
|
| @@ -460,7 +436,6 @@ void MediaSourceDelegate::OnBufferReady(
|
| data->access_units[index].data.end(), kVorbisPadding,
|
| kVorbisPadding + 4);
|
| }
|
| -#endif
|
| if (buffer->decrypt_config()) {
|
| data->access_units[index].key_id = std::vector<char>(
|
| buffer->decrypt_config()->key_id().begin(),
|
| @@ -677,42 +652,9 @@ void MediaSourceDelegate::OnMediaConfigRequest() {
|
| NotifyDemuxerReady();
|
| }
|
|
|
| -#if defined(GOOGLE_TV)
|
| -// TODO(kjyoun): Enhance logic to detect when to call NotifyDemuxerReady()
|
| -// For now, we call it when the first key is added. See http://crbug.com/255781
|
| -void MediaSourceDelegate::NotifyKeyAdded(const std::string& key_system) {
|
| - if (!media_loop_->BelongsToCurrentThread()) {
|
| - media_loop_->PostTask(FROM_HERE,
|
| - base::Bind(&MediaSourceDelegate::NotifyKeyAdded,
|
| - base::Unretained(this), key_system));
|
| - return;
|
| - }
|
| - DVLOG(1) << __FUNCTION__ << " : " << demuxer_client_id_;
|
| - if (key_added_)
|
| - return;
|
| - key_added_ = true;
|
| - key_system_ = key_system;
|
| - if (!CanNotifyDemuxerReady())
|
| - return;
|
| - if (HasEncryptedStream())
|
| - NotifyDemuxerReady();
|
| -}
|
| -#endif // defined(GOOGLE_TV)
|
| -
|
| bool MediaSourceDelegate::CanNotifyDemuxerReady() {
|
| DCHECK(media_loop_->BelongsToCurrentThread());
|
| - // This can happen when a key is added before the demuxer is initialized.
|
| - // See NotifyKeyAdded().
|
| - // TODO(kjyoun): Remove NotifyDemxuerReady() call from NotifyKeyAdded() so
|
| - // that we can remove all is_demuxer_ready_/key_added_/key_system_ madness.
|
| - // See http://crbug.com/255781
|
| - if (!is_demuxer_ready_)
|
| - return false;
|
| -#if defined(GOOGLE_TV)
|
| - if (HasEncryptedStream() && !key_added_)
|
| - return false;
|
| -#endif // defined(GOOGLE_TV)
|
| - return true;
|
| + return is_demuxer_ready_;
|
| }
|
|
|
| void MediaSourceDelegate::NotifyDemuxerReady() {
|
| @@ -741,10 +683,6 @@ void MediaSourceDelegate::NotifyDemuxerReady() {
|
| }
|
| configs->duration_ms = GetDurationMs();
|
|
|
| -#if defined(GOOGLE_TV)
|
| - configs->key_system = HasEncryptedStream() ? key_system_ : "";
|
| -#endif
|
| -
|
| if (demuxer_client_)
|
| demuxer_client_->DemuxerReady(demuxer_client_id_, *configs);
|
| }
|
|
|