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

Side by Side Diff: media/blink/webmediaplayer_impl.h

Issue 2956713003: Replaces VideoLayer with a SurfaceLayer in WebMediaPlayerImpl (Closed)
Patch Set: Addresses comments #56-58. Created 3 years, 5 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
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 26 matching lines...) Expand all
37 #include "media/blink/multibuffer_data_source.h" 37 #include "media/blink/multibuffer_data_source.h"
38 #include "media/blink/video_frame_compositor.h" 38 #include "media/blink/video_frame_compositor.h"
39 #include "media/blink/webmediaplayer_delegate.h" 39 #include "media/blink/webmediaplayer_delegate.h"
40 #include "media/blink/webmediaplayer_params.h" 40 #include "media/blink/webmediaplayer_params.h"
41 #include "media/blink/webmediaplayer_util.h" 41 #include "media/blink/webmediaplayer_util.h"
42 #include "media/filters/pipeline_controller.h" 42 #include "media/filters/pipeline_controller.h"
43 #include "media/renderers/skcanvas_video_renderer.h" 43 #include "media/renderers/skcanvas_video_renderer.h"
44 #include "third_party/WebKit/public/platform/WebAudioSourceProvider.h" 44 #include "third_party/WebKit/public/platform/WebAudioSourceProvider.h"
45 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" 45 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
46 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" 46 #include "third_party/WebKit/public/platform/WebMediaPlayer.h"
47 #include "third_party/WebKit/public/platform/WebSurfaceLayerBridge.h"
47 #include "url/gurl.h" 48 #include "url/gurl.h"
48 49
49 #if defined(OS_ANDROID) // WMPI_CAST 50 #if defined(OS_ANDROID) // WMPI_CAST
50 // Delete this file when WMPI_CAST is no longer needed. 51 // Delete this file when WMPI_CAST is no longer needed.
51 #include "media/blink/webmediaplayer_cast_android.h" 52 #include "media/blink/webmediaplayer_cast_android.h"
52 #endif 53 #endif
53 54
54 namespace blink { 55 namespace blink {
55 class WebLocalFrame; 56 class WebLocalFrame;
56 class WebMediaPlayerClient; 57 class WebMediaPlayerClient;
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 // Used to track loading progress, used by IsPrerollAttemptNeeded(). 715 // Used to track loading progress, used by IsPrerollAttemptNeeded().
715 // |preroll_attempt_pending_| indicates that the clock has been reset 716 // |preroll_attempt_pending_| indicates that the clock has been reset
716 // (awaiting a resume to start), while |preroll_attempt_start_time_| tracks 717 // (awaiting a resume to start), while |preroll_attempt_start_time_| tracks
717 // when a preroll attempt began. 718 // when a preroll attempt began.
718 bool preroll_attempt_pending_; 719 bool preroll_attempt_pending_;
719 base::TimeTicks preroll_attempt_start_time_; 720 base::TimeTicks preroll_attempt_start_time_;
720 721
721 // Monitors the player events. 722 // Monitors the player events.
722 base::WeakPtr<MediaObserver> observer_; 723 base::WeakPtr<MediaObserver> observer_;
723 724
725 // Owns the weblayer and obtains/maintains SurfaceIds for
726 // kUseSurfaceLayerForVideo feature.
727 std::unique_ptr<blink::WebSurfaceLayerBridge> bridge_;
728
724 // The maximum video keyframe distance that allows triggering background 729 // The maximum video keyframe distance that allows triggering background
725 // playback optimizations (non-MSE). 730 // playback optimizations (non-MSE).
726 base::TimeDelta max_keyframe_distance_to_disable_background_video_; 731 base::TimeDelta max_keyframe_distance_to_disable_background_video_;
727 732
728 // The maximum video keyframe distance that allows triggering background 733 // The maximum video keyframe distance that allows triggering background
729 // playback optimizations (MSE). 734 // playback optimizations (MSE).
730 base::TimeDelta max_keyframe_distance_to_disable_background_video_mse_; 735 base::TimeDelta max_keyframe_distance_to_disable_background_video_mse_;
731 736
732 // When MSE memory pressure based garbage collection is enabled, the 737 // When MSE memory pressure based garbage collection is enabled, the
733 // |enable_instant_source_buffer_gc| controls whether the GC is done 738 // |enable_instant_source_buffer_gc| controls whether the GC is done
(...skipping 16 matching lines...) Expand all
750 // Pipeline media duration overridden by tests. 755 // Pipeline media duration overridden by tests.
751 base::Optional<base::TimeDelta> pipeline_media_duration_for_test_; 756 base::Optional<base::TimeDelta> pipeline_media_duration_for_test_;
752 757
753 // Whether the video requires a user gesture to resume after it was paused in 758 // Whether the video requires a user gesture to resume after it was paused in
754 // the background. Affects the value of ShouldPauseVideoWhenHidden(). 759 // the background. Affects the value of ShouldPauseVideoWhenHidden().
755 bool video_locked_when_paused_when_hidden_ = false; 760 bool video_locked_when_paused_when_hidden_ = false;
756 761
757 // Whether embedded media experience is currently enabled. 762 // Whether embedded media experience is currently enabled.
758 bool embedded_media_experience_enabled_ = false; 763 bool embedded_media_experience_enabled_ = false;
759 764
765 // Whether the use of a surface layer instead of a video layer is enabled.
766 bool surface_layer_for_video_enabled_ = false;
767
760 gfx::Size last_uploaded_frame_size_; 768 gfx::Size last_uploaded_frame_size_;
761 base::TimeDelta last_uploaded_frame_timestamp_; 769 base::TimeDelta last_uploaded_frame_timestamp_;
762 770
763 base::CancelableCallback<void(base::TimeTicks)> frame_time_report_cb_; 771 base::CancelableCallback<void(base::TimeTicks)> frame_time_report_cb_;
764 772
765 bool initial_video_height_recorded_ = false; 773 bool initial_video_height_recorded_ = false;
766 774
767 enum class OverlayMode { 775 enum class OverlayMode {
768 // All overlays are turned off. 776 // All overlays are turned off.
769 kNoOverlays, 777 kNoOverlays,
(...skipping 19 matching lines...) Expand all
789 OverlayInfo::RoutingToken overlay_routing_token_; 797 OverlayInfo::RoutingToken overlay_routing_token_;
790 798
791 OverlayInfo overlay_info_; 799 OverlayInfo overlay_info_;
792 800
793 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 801 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
794 }; 802 };
795 803
796 } // namespace media 804 } // namespace media
797 805
798 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 806 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698