diff options
author | mikhal@google.com <mikhal@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-20 03:24:01 +0000 |
---|---|---|
committer | mikhal@google.com <mikhal@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-20 03:24:01 +0000 |
commit | 7df9716b1c460092a3caca82dddfe78739940aa9 (patch) | |
tree | a57328270dafca2b95affd5bc47e546f255ea66e /media/cast/cast_environment.cc | |
parent | 7cc7a2e71c9b9dc1fe1d2cf67839ed8f00169bb1 (diff) | |
download | chromium_src-7df9716b1c460092a3caca82dddfe78739940aa9.zip chromium_src-7df9716b1c460092a3caca82dddfe78739940aa9.tar.gz chromium_src-7df9716b1c460092a3caca82dddfe78739940aa9.tar.bz2 |
Incorporating logging into Cast:
1. Adding logging to CastEnvironment.
2. Actually triggering logging within the cast library.
3. Adding thread checks.
4. Removing trace calls outside of the logging class.
Open issues:
1.Use of rtp_timestamp and frame id is not consistent.
In addition, the AudioBus does not include these values.
2. There is a pending cl to switch frame_id to int. This cl does not include that.
3. There are a few more places to add logging.
As this cl is already big enough, all of the above will come in a follow-up cl.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=236034
Review URL: https://codereview.chromium.org/69603002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236118 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/cast/cast_environment.cc')
-rw-r--r-- | media/cast/cast_environment.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/media/cast/cast_environment.cc b/media/cast/cast_environment.cc index dddec16..be636bb 100644 --- a/media/cast/cast_environment.cc +++ b/media/cast/cast_environment.cc @@ -17,13 +17,15 @@ CastEnvironment::CastEnvironment( scoped_refptr<TaskRunner> audio_encode_thread_proxy, scoped_refptr<TaskRunner> audio_decode_thread_proxy, scoped_refptr<TaskRunner> video_encode_thread_proxy, - scoped_refptr<TaskRunner> video_decode_thread_proxy) + scoped_refptr<TaskRunner> video_decode_thread_proxy, + const CastLoggingConfig& config) : clock_(clock), main_thread_proxy_(main_thread_proxy), audio_encode_thread_proxy_(audio_encode_thread_proxy), audio_decode_thread_proxy_(audio_decode_thread_proxy), video_encode_thread_proxy_(video_encode_thread_proxy), - video_decode_thread_proxy_(video_decode_thread_proxy) { + video_decode_thread_proxy_(video_decode_thread_proxy), + logging_(new LoggingImpl(clock, main_thread_proxy, config)) { DCHECK(main_thread_proxy) << "Main thread required"; } @@ -62,7 +64,7 @@ scoped_refptr<TaskRunner> CastEnvironment::GetMessageTaskRunnerForThread( case CastEnvironment::VIDEO_DECODER: return video_decode_thread_proxy_; default: - NOTREACHED() << "Invalid Thread ID."; + NOTREACHED() << "Invalid Thread identifier"; return NULL; } } @@ -80,14 +82,20 @@ bool CastEnvironment::CurrentlyOn(ThreadId identifier) { case CastEnvironment::VIDEO_DECODER: return video_decode_thread_proxy_->RunsTasksOnCurrentThread(); default: - NOTREACHED() << "Wrong thread identifier"; + NOTREACHED() << "Invalid thread identifier"; return false; } } -base::TickClock* CastEnvironment::Clock() { +base::TickClock* CastEnvironment::Clock() const { return clock_; } +LoggingImpl* CastEnvironment::Logging() { + DCHECK(CurrentlyOn(CastEnvironment::MAIN)) << + "Must be called from main thread"; + return logging_.get(); +} + } // namespace cast } // namespace media |