Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: media/base/android/media_source_player_impl.cc

Issue 1076013002: Added stub MediaSourcePlayer for developing behind the flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed old and new players, addressed some Xiaohan comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #include "media/base/android/media_source_player_impl.h"
2
3 #include "base/bind.h"
4 #include "base/logging.h"
5
6 #include "media/base/android/media_source_player_with_dedicated_thread.h"
7
8 namespace media {
9
10 // Called on UI thread
11 MediaSourcePlayerImpl::MediaSourcePlayerImpl(scoped_ptr<DemuxerAndroid> demuxer)
12 : demuxer_(demuxer.Pass()),
13 weak_factory_(this) {
14 // UI thread
15 DVLOG(1) << "MediaSourcePlayerImpl::MediaSourcePlayerImpl";
16
17 weak_this_ = weak_factory_.GetWeakPtr();
18
19 // Finish initializaton on Media thread
20 GetMediaTaskRunner()->PostTask(
21 FROM_HERE, base::Bind(&MediaSourcePlayerImpl::Initialize, weak_this_));
22 }
23
24 MediaSourcePlayerImpl::~MediaSourcePlayerImpl()
25 {
26 // Media thread
27 DVLOG(1) << "MediaSourcePlayerImpl::~MediaSourcePlayerImpl";
28 }
29
30 void MediaSourcePlayerImpl::Initialize() {
31 // Media thread
32 DVLOG(1) << "MediaSourcePlayerImpl::" << __FUNCTION__;
33
34 demuxer_->Initialize(this);
35 }
36
37 void MediaSourcePlayerImpl::DestroySelf() {
38 // Media thread
39 DVLOG(1) << __FUNCTION__;
40 delete this;
41 }
42
43 // Calls forwarded from MediaSourcePlayerWithDedicatedThread
44
45 void MediaSourcePlayerImpl::SetVideoSurface(gfx::ScopedJavaSurface surface) {
46 // Media thread
47 DVLOG(1) << __FUNCTION__;
48 }
49
50 void MediaSourcePlayerImpl::Start() {
51 // Media thread
52 DVLOG(1) << __FUNCTION__;
53 }
54
55 void MediaSourcePlayerImpl::Pause() {
56 // Media thread
57 DVLOG(1) << __FUNCTION__;
58 }
59
60 void MediaSourcePlayerImpl::SeekTo(base::TimeDelta timestamp) {
61 // Media thread
62 DVLOG(1) << __FUNCTION__ << " " << timestamp;
63 }
64
65 void MediaSourcePlayerImpl::Release() {
66 // Media thread
67 DVLOG(1) << __FUNCTION__;
68 }
69
70 void MediaSourcePlayerImpl::SetVolume(double volume) {
71 // Media thread
72 DVLOG(1) << __FUNCTION__ << " " << volume;
73 }
74
75 int MediaSourcePlayerImpl::GetVideoWidth() {
76 // UI thread
77 return 320;
78 }
79
80 int MediaSourcePlayerImpl::GetVideoHeight() {
81 // UI thread
82 return 240;
83 }
84
85 base::TimeDelta MediaSourcePlayerImpl::GetCurrentTime() {
86 // UI thread, Media thread
87 return base::TimeDelta();
88 }
89
90 base::TimeDelta MediaSourcePlayerImpl::GetDuration() {
91 // UI thread
92 return base::TimeDelta();
93 }
94
95 bool MediaSourcePlayerImpl::IsPlaying() {
96 // UI thread
97 return false;
98 }
99
100 bool MediaSourcePlayerImpl::CanPause() {
101 // UI thread
102 return false;
103 }
104
105 bool MediaSourcePlayerImpl::CanSeekForward() {
106 // UI thread
107 return false;
108 }
109
110 bool MediaSourcePlayerImpl::CanSeekBackward() {
111 // UI thread
112 return false;
113 }
114
115 bool MediaSourcePlayerImpl::IsPlayerReady() {
116 // UI thread
117 DVLOG(1) << __FUNCTION__;
118 return true;
119 }
120
121 void MediaSourcePlayerImpl::SetCdm(BrowserCdm* cdm) {
122 DVLOG(1) << __FUNCTION__;
123 }
124
125 // Callbacks from Demuxer.
126
127 void MediaSourcePlayerImpl::OnDemuxerConfigsAvailable(
128 const DemuxerConfigs& configs) {
129 // Media thread
130 DVLOG(1) << __FUNCTION__;
131 }
132
133 void MediaSourcePlayerImpl::OnDemuxerDataAvailable(const DemuxerData& data) {
134 // Media thread
135 }
136
137 void MediaSourcePlayerImpl::OnDemuxerSeekDone(
138 base::TimeDelta actual_browser_seek_time) {
139 // Media thread
140 DVLOG(1) << __FUNCTION__ << " actual_time:" << actual_browser_seek_time;
141 }
142
143 void MediaSourcePlayerImpl::OnDemuxerDurationChanged(
144 base::TimeDelta duration) {
145 // Media thread
146 DVLOG(1) << __FUNCTION__ << " duration:" << duration;
147 }
148
149 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698