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

Side by Side Diff: content/renderer/media/webmediaplayer_ms_compositor.h

Issue 1417533006: Unit test for WebMediaPlayerMS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unittest Created 5 years, 2 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H 5 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H
6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H 6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 25 matching lines...) Expand all
36 // WebMediaPlayerMS. It will be instantiated on the main thread, but destroyed 36 // WebMediaPlayerMS. It will be instantiated on the main thread, but destroyed
37 // on the compositor thread. 37 // on the compositor thread.
38 // 38 //
39 // WebMediaPlayerMSCompositor utilizes VideoRendererAlgorithm to store the 39 // WebMediaPlayerMSCompositor utilizes VideoRendererAlgorithm to store the
40 // incoming frames and select the best frame for rendering to maximize the 40 // incoming frames and select the best frame for rendering to maximize the
41 // smoothness, if REFERENCE_TIMEs are populated for incoming VideoFrames. 41 // smoothness, if REFERENCE_TIMEs are populated for incoming VideoFrames.
42 // Otherwise, WebMediaPlayerMSCompositor will simply store the most recent 42 // Otherwise, WebMediaPlayerMSCompositor will simply store the most recent
43 // frame, and submit it whenever asked by the compositor. 43 // frame, and submit it whenever asked by the compositor.
44 class WebMediaPlayerMSCompositor : public cc::VideoFrameProvider { 44 class WebMediaPlayerMSCompositor : public cc::VideoFrameProvider {
45 public: 45 public:
46 // This |url| represents the media stream we are rendering. 46 // This |url| represents the media stream we are rendering. |url| is used to
47 // determine whether we enable algorithm or not by looking up
48 // MediaStreamDescriptor.
mcasas 2015/10/21 19:54:02 Incorrect, |url| is used to find the MediaStream W
qiangchen 2015/10/22 17:22:58 It is decided here. And the main usage of |url| is
47 WebMediaPlayerMSCompositor( 49 WebMediaPlayerMSCompositor(
48 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, 50 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner,
49 const blink::WebURL& url); 51 const blink::WebURL& url);
52
53 WebMediaPlayerMSCompositor(
54 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner,
55 const bool algorithm_enabled);
mcasas 2015/10/21 19:54:02 I think you could get rid of this ctor by: a) reg
qiangchen 2015/10/22 17:22:58 Plan a) sounds better, but here is some difficulty
56
50 ~WebMediaPlayerMSCompositor() override; 57 ~WebMediaPlayerMSCompositor() override;
51 58
52 void EnqueueFrame(const scoped_refptr<media::VideoFrame>& frame); 59 void EnqueueFrame(const scoped_refptr<media::VideoFrame>& frame);
53 60
54 // Statistical data 61 // Statistical data
55 gfx::Size GetCurrentSize(); 62 gfx::Size GetCurrentSize();
56 base::TimeDelta GetCurrentTime(); 63 base::TimeDelta GetCurrentTime();
57 size_t total_frame_count() const; 64 size_t total_frame_count() const;
58 size_t dropped_frame_count() const; 65 size_t dropped_frame_count() const;
59 66
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 133
127 std::map<base::TimeDelta, base::TimeTicks> timestamps_to_clock_times_; 134 std::map<base::TimeDelta, base::TimeTicks> timestamps_to_clock_times_;
128 135
129 // |current_frame_lock_| protects |current_frame_used_by_compositor_|, 136 // |current_frame_lock_| protects |current_frame_used_by_compositor_|,
130 // |current_frame_|, and |rendering_frame_buffer_|. 137 // |current_frame_|, and |rendering_frame_buffer_|.
131 base::Lock current_frame_lock_; 138 base::Lock current_frame_lock_;
132 }; 139 };
133 } 140 }
134 141
135 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H 142 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698