diff options
author | mikhal@google.com <mikhal@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-19 19:51:56 +0000 |
---|---|---|
committer | mikhal@google.com <mikhal@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-19 19:51:56 +0000 |
commit | 58bc947c9f63ecd1070ef4dffdd88e7658615258 (patch) | |
tree | a3f52f698f023718abeda63d41c0962b2343c3b4 /media/cast/cast_environment.cc | |
parent | 6787c5d9afc8fe956e8a85a07a1a85d7954f5fb0 (diff) | |
download | chromium_src-58bc947c9f63ecd1070ef4dffdd88e7658615258.zip chromium_src-58bc947c9f63ecd1070ef4dffdd88e7658615258.tar.gz chromium_src-58bc947c9f63ecd1070ef4dffdd88e7658615258.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.
Review URL: https://codereview.chromium.org/69603002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236034 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 |