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/renderer/media/android/media_source_delegate.h" | 5 #include "content/renderer/media/android/media_source_delegate.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 static void LogMediaSourceError(const scoped_refptr<media::MediaLog>& media_log, | 43 static void LogMediaSourceError(const scoped_refptr<media::MediaLog>& media_log, |
44 const std::string& error) { | 44 const std::string& error) { |
45 media_log->AddEvent(media_log->CreateMediaSourceErrorEvent(error)); | 45 media_log->AddEvent(media_log->CreateMediaSourceErrorEvent(error)); |
46 } | 46 } |
47 | 47 |
48 MediaSourceDelegate::MediaSourceDelegate( | 48 MediaSourceDelegate::MediaSourceDelegate( |
49 RendererDemuxerAndroid* demuxer_client, | 49 RendererDemuxerAndroid* demuxer_client, |
50 int demuxer_client_id, | 50 int demuxer_client_id, |
51 const scoped_refptr<base::MessageLoopProxy>& media_loop, | 51 const scoped_refptr<base::MessageLoopProxy>& media_loop, |
52 media::MediaLog* media_log) | 52 media::MediaLog* media_log) |
53 : main_loop_(base::MessageLoopProxy::current()), | 53 : demuxer_client_(demuxer_client), |
54 main_weak_factory_(this), | |
55 main_weak_this_(main_weak_factory_.GetWeakPtr()), | |
56 media_loop_(media_loop), | |
57 media_weak_factory_(this), | |
58 demuxer_client_(demuxer_client), | |
59 demuxer_client_id_(demuxer_client_id), | 54 demuxer_client_id_(demuxer_client_id), |
60 media_log_(media_log), | 55 media_log_(media_log), |
61 is_demuxer_ready_(false), | 56 is_demuxer_ready_(false), |
62 audio_stream_(NULL), | 57 audio_stream_(NULL), |
63 video_stream_(NULL), | 58 video_stream_(NULL), |
64 seeking_(false), | 59 seeking_(false), |
65 is_video_encrypted_(false), | 60 is_video_encrypted_(false), |
66 doing_browser_seek_(false), | 61 doing_browser_seek_(false), |
67 browser_seek_time_(media::kNoTimestamp()), | 62 browser_seek_time_(media::kNoTimestamp()), |
68 expecting_regular_seek_(false), | 63 expecting_regular_seek_(false), |
69 access_unit_size_(0) { | 64 access_unit_size_(0), |
65 main_loop_(base::MessageLoopProxy::current()), | |
66 media_loop_(media_loop), | |
67 main_weak_factory_(this), | |
68 media_weak_factory_(this) { | |
70 DCHECK(main_loop_->BelongsToCurrentThread()); | 69 DCHECK(main_loop_->BelongsToCurrentThread()); |
70 main_weak_this_ = main_weak_factory_.GetWeakPtr(); | |
Ami GONE FROM CHROMIUM
2014/03/10 22:02:08
(if you take my suggestion in the .h then you can
DaleCurtis
2014/03/10 23:47:46
Done.
| |
71 } | 71 } |
72 | 72 |
73 MediaSourceDelegate::~MediaSourceDelegate() { | 73 MediaSourceDelegate::~MediaSourceDelegate() { |
74 DCHECK(main_loop_->BelongsToCurrentThread()); | 74 DCHECK(main_loop_->BelongsToCurrentThread()); |
75 DVLOG(1) << __FUNCTION__ << " : " << demuxer_client_id_; | 75 DVLOG(1) << __FUNCTION__ << " : " << demuxer_client_id_; |
76 DCHECK(!chunk_demuxer_); | 76 DCHECK(!chunk_demuxer_); |
77 DCHECK(!demuxer_client_); | 77 DCHECK(!demuxer_client_); |
78 DCHECK(!audio_decrypting_demuxer_stream_); | 78 DCHECK(!audio_decrypting_demuxer_stream_); |
79 DCHECK(!video_decrypting_demuxer_stream_); | 79 DCHECK(!video_decrypting_demuxer_stream_); |
80 DCHECK(!audio_stream_); | 80 DCHECK(!audio_stream_); |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
765 // current time have been garbage collected or removed by the web app, this is | 765 // current time have been garbage collected or removed by the web app, this is |
766 // unlikely. This may cause unexpected playback stall due to seek pending an | 766 // unlikely. This may cause unexpected playback stall due to seek pending an |
767 // append for a GOP prior to the last GOP demuxed. | 767 // append for a GOP prior to the last GOP demuxed. |
768 // TODO(wolenetz): Remove the possibility for this seek to cause unexpected | 768 // TODO(wolenetz): Remove the possibility for this seek to cause unexpected |
769 // player stall by replaying cached data since last keyframe in browser player | 769 // player stall by replaying cached data since last keyframe in browser player |
770 // rather than issuing browser seek. See http://crbug.com/304234. | 770 // rather than issuing browser seek. See http://crbug.com/304234. |
771 return seek_time; | 771 return seek_time; |
772 } | 772 } |
773 | 773 |
774 } // namespace content | 774 } // namespace content |
OLD | NEW |