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 "content/browser/media/android/browser_demuxer_android.h" | 5 #include "content/browser/media/android/browser_demuxer_android.h" |
6 | 6 |
7 #include "content/common/media/media_player_messages_android.h" | 7 #include "content/common/media/media_player_messages_android.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 bool ClientIDExists() { | 50 bool ClientIDExists() { |
51 return demuxer_->demuxer_clients_.Lookup(demuxer_client_id_); | 51 return demuxer_->demuxer_clients_.Lookup(demuxer_client_id_); |
52 } | 52 } |
53 | 53 |
54 scoped_refptr<BrowserDemuxerAndroid> demuxer_; | 54 scoped_refptr<BrowserDemuxerAndroid> demuxer_; |
55 int demuxer_client_id_; | 55 int demuxer_client_id_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(Internal); | 57 DISALLOW_COPY_AND_ASSIGN(Internal); |
58 }; | 58 }; |
59 | 59 |
60 BrowserDemuxerAndroid::BrowserDemuxerAndroid() | 60 BrowserDemuxerAndroid::BrowserDemuxerAndroid() {} |
61 : BrowserMessageFilter(MediaPlayerMsgStart) {} | |
62 | 61 |
63 BrowserDemuxerAndroid::~BrowserDemuxerAndroid() {} | 62 BrowserDemuxerAndroid::~BrowserDemuxerAndroid() {} |
64 | 63 |
65 void BrowserDemuxerAndroid::OverrideThreadForMessage( | 64 void BrowserDemuxerAndroid::OverrideThreadForMessage( |
66 const IPC::Message& message, | 65 const IPC::Message& message, |
67 BrowserThread::ID* thread) { | 66 BrowserThread::ID* thread) { |
68 switch (message.type()) { | 67 switch (message.type()) { |
69 case MediaPlayerHostMsg_DemuxerReady::ID: | 68 case MediaPlayerHostMsg_DemuxerReady::ID: |
70 case MediaPlayerHostMsg_ReadFromDemuxerAck::ID: | 69 case MediaPlayerHostMsg_ReadFromDemuxerAck::ID: |
71 case MediaPlayerHostMsg_DurationChanged::ID: | 70 case MediaPlayerHostMsg_DurationChanged::ID: |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 139 |
141 void BrowserDemuxerAndroid::OnDurationChanged(int demuxer_client_id, | 140 void BrowserDemuxerAndroid::OnDurationChanged(int demuxer_client_id, |
142 const base::TimeDelta& duration) { | 141 const base::TimeDelta& duration) { |
143 media::DemuxerAndroidClient* client = | 142 media::DemuxerAndroidClient* client = |
144 demuxer_clients_.Lookup(demuxer_client_id); | 143 demuxer_clients_.Lookup(demuxer_client_id); |
145 if (client) | 144 if (client) |
146 client->OnDemuxerDurationChanged(duration); | 145 client->OnDemuxerDurationChanged(duration); |
147 } | 146 } |
148 | 147 |
149 } // namespace content | 148 } // namespace content |
OLD | NEW |