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

Unified Diff: webrtc/api/videotrack.cc

Issue 2579993003: Add support for content hints to VideoTrack. (Closed)
Patch Set: rename test + add comments Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/videotrack.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/videotrack.cc
diff --git a/webrtc/api/videotrack.cc b/webrtc/api/videotrack.cc
index b47a32044f33d4ee7f0e52bf41016076a5fb4b3b..2fa2ba671a8724b3f8a6fff3fa5b1015b2a15bf2 100644
--- a/webrtc/api/videotrack.cc
+++ b/webrtc/api/videotrack.cc
@@ -19,7 +19,8 @@ const char MediaStreamTrackInterface::kVideoKind[] = "video";
VideoTrack::VideoTrack(const std::string& label,
VideoTrackSourceInterface* video_source)
: MediaStreamTrack<VideoTrackInterface>(label),
- video_source_(video_source) {
+ video_source_(video_source),
+ content_hint_(ContentHint::kNone) {
worker_thread_checker_.DetachFromThread();
video_source_->RegisterObserver(this);
}
@@ -49,6 +50,19 @@ void VideoTrack::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
video_source_->RemoveSink(sink);
}
+VideoTrackInterface::ContentHint VideoTrack::content_hint() const {
+ RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
+ return content_hint_;
+}
+
+void VideoTrack::set_content_hint(ContentHint hint) {
+ RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
+ if (content_hint_ == hint)
+ return;
+ content_hint_ = hint;
+ Notifier<VideoTrackInterface>::FireOnChanged();
+}
+
bool VideoTrack::set_enabled(bool enable) {
RTC_DCHECK(signaling_thread_checker_.CalledOnValidThread());
for (auto& sink_pair : sink_pairs()) {
« no previous file with comments | « webrtc/api/videotrack.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698