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) {} |
61 | 62 |
62 BrowserDemuxerAndroid::~BrowserDemuxerAndroid() {} | 63 BrowserDemuxerAndroid::~BrowserDemuxerAndroid() {} |
63 | 64 |
64 void BrowserDemuxerAndroid::OverrideThreadForMessage( | 65 void BrowserDemuxerAndroid::OverrideThreadForMessage( |
65 const IPC::Message& message, | 66 const IPC::Message& message, |
66 BrowserThread::ID* thread) { | 67 BrowserThread::ID* thread) { |
67 switch (message.type()) { | 68 switch (message.type()) { |
68 case MediaPlayerHostMsg_DemuxerReady::ID: | 69 case MediaPlayerHostMsg_DemuxerReady::ID: |
69 case MediaPlayerHostMsg_ReadFromDemuxerAck::ID: | 70 case MediaPlayerHostMsg_ReadFromDemuxerAck::ID: |
70 case MediaPlayerHostMsg_DurationChanged::ID: | 71 case MediaPlayerHostMsg_DurationChanged::ID: |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 140 |
140 void BrowserDemuxerAndroid::OnDurationChanged(int demuxer_client_id, | 141 void BrowserDemuxerAndroid::OnDurationChanged(int demuxer_client_id, |
141 const base::TimeDelta& duration) { | 142 const base::TimeDelta& duration) { |
142 media::DemuxerAndroidClient* client = | 143 media::DemuxerAndroidClient* client = |
143 demuxer_clients_.Lookup(demuxer_client_id); | 144 demuxer_clients_.Lookup(demuxer_client_id); |
144 if (client) | 145 if (client) |
145 client->OnDemuxerDurationChanged(duration); | 146 client->OnDemuxerDurationChanged(duration); |
146 } | 147 } |
147 | 148 |
148 } // namespace content | 149 } // namespace content |
OLD | NEW |