summaryrefslogtreecommitdiff
path: root/chromium/media/renderers/win
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/media/renderers/win')
-rw-r--r--chromium/media/renderers/win/media_engine_extension.cc2
-rw-r--r--chromium/media/renderers/win/media_engine_extension.h2
-rw-r--r--chromium/media/renderers/win/media_engine_notify_impl.cc2
-rw-r--r--chromium/media/renderers/win/media_engine_notify_impl.h2
-rw-r--r--chromium/media/renderers/win/media_foundation_audio_stream.cc2
-rw-r--r--chromium/media/renderers/win/media_foundation_audio_stream.h2
-rw-r--r--chromium/media/renderers/win/media_foundation_protection_manager.cc5
-rw-r--r--chromium/media/renderers/win/media_foundation_protection_manager.h2
-rw-r--r--chromium/media/renderers/win/media_foundation_renderer.cc31
-rw-r--r--chromium/media/renderers/win/media_foundation_renderer.h6
-rw-r--r--chromium/media/renderers/win/media_foundation_renderer_extension.h6
-rw-r--r--chromium/media/renderers/win/media_foundation_renderer_integration_test.cc2
-rw-r--r--chromium/media/renderers/win/media_foundation_renderer_unittest.cc4
-rw-r--r--chromium/media/renderers/win/media_foundation_rendering_mode.cc2
-rw-r--r--chromium/media/renderers/win/media_foundation_rendering_mode.h2
-rw-r--r--chromium/media/renderers/win/media_foundation_source_wrapper.cc2
-rw-r--r--chromium/media/renderers/win/media_foundation_source_wrapper.h2
-rw-r--r--chromium/media/renderers/win/media_foundation_stream_wrapper.cc2
-rw-r--r--chromium/media/renderers/win/media_foundation_stream_wrapper.h2
-rw-r--r--chromium/media/renderers/win/media_foundation_texture_pool.cc2
-rw-r--r--chromium/media/renderers/win/media_foundation_texture_pool.h2
-rw-r--r--chromium/media/renderers/win/media_foundation_texture_pool_unittest.cc2
-rw-r--r--chromium/media/renderers/win/media_foundation_video_stream.cc2
-rw-r--r--chromium/media/renderers/win/media_foundation_video_stream.h2
24 files changed, 56 insertions, 34 deletions
diff --git a/chromium/media/renderers/win/media_engine_extension.cc b/chromium/media/renderers/win/media_engine_extension.cc
index fcb34978e31..51735b59a50 100644
--- a/chromium/media/renderers/win/media_engine_extension.cc
+++ b/chromium/media/renderers/win/media_engine_extension.cc
@@ -1,4 +1,4 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
+// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_engine_extension.h b/chromium/media/renderers/win/media_engine_extension.h
index cf5763167ef..4743474ded0 100644
--- a/chromium/media/renderers/win/media_engine_extension.h
+++ b/chromium/media/renderers/win/media_engine_extension.h
@@ -1,4 +1,4 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
+// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_engine_notify_impl.cc b/chromium/media/renderers/win/media_engine_notify_impl.cc
index eb4ad5ee058..872b15980d2 100644
--- a/chromium/media/renderers/win/media_engine_notify_impl.cc
+++ b/chromium/media/renderers/win/media_engine_notify_impl.cc
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_engine_notify_impl.h b/chromium/media/renderers/win/media_engine_notify_impl.h
index f94c20938cb..ad7ac6be43a 100644
--- a/chromium/media/renderers/win/media_engine_notify_impl.h
+++ b/chromium/media/renderers/win/media_engine_notify_impl.h
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_audio_stream.cc b/chromium/media/renderers/win/media_foundation_audio_stream.cc
index 765b083ef8c..1f34d67cf9e 100644
--- a/chromium/media/renderers/win/media_foundation_audio_stream.cc
+++ b/chromium/media/renderers/win/media_foundation_audio_stream.cc
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_audio_stream.h b/chromium/media/renderers/win/media_foundation_audio_stream.h
index 21f3586ee2e..52d5cc359d0 100644
--- a/chromium/media/renderers/win/media_foundation_audio_stream.h
+++ b/chromium/media/renderers/win/media_foundation_audio_stream.h
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_protection_manager.cc b/chromium/media/renderers/win/media_foundation_protection_manager.cc
index d9c7b087745..d426f0d90b4 100644
--- a/chromium/media/renderers/win/media_foundation_protection_manager.cc
+++ b/chromium/media/renderers/win/media_foundation_protection_manager.cc
@@ -1,4 +1,4 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
+// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,6 +14,7 @@
#include "base/win/core_winrt_util.h"
#include "base/win/scoped_hstring.h"
#include "base/win/windows_types.h"
+#include "media/base/win/hresults.h"
#include "media/base/win/mf_helpers.h"
namespace media {
@@ -37,7 +38,7 @@ HRESULT MediaFoundationProtectionManager::RuntimeClassInitialize(
waiting_cb_ = std::move(waiting_cb);
if (!base::win::ScopedHString::ResolveCoreWinRTStringDelayload())
- return E_FAIL;
+ return kErrorResolveCoreWinRTStringDelayload;
// Init an empty |property_set_| as MFMediaEngine could access it via
// |get_Properties| before we populate it within SetPMPServer.
diff --git a/chromium/media/renderers/win/media_foundation_protection_manager.h b/chromium/media/renderers/win/media_foundation_protection_manager.h
index a9dac608a9e..aad7fff7f05 100644
--- a/chromium/media/renderers/win/media_foundation_protection_manager.h
+++ b/chromium/media/renderers/win/media_foundation_protection_manager.h
@@ -1,4 +1,4 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
+// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_renderer.cc b/chromium/media/renderers/win/media_foundation_renderer.cc
index a02877b1e49..d6b9518b840 100644
--- a/chromium/media/renderers/win/media_foundation_renderer.cc
+++ b/chromium/media/renderers/win/media_foundation_renderer.cc
@@ -1,4 +1,4 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
+// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -179,6 +179,11 @@ void MediaFoundationRenderer::Initialize(MediaResource* media_resource,
}
}
+ // debug, force mode to dcomp
+ if (force_dcomp_mode_for_testing_) {
+ rendering_mode_ = MediaFoundationRenderingMode::DirectComposition;
+ }
+
MEDIA_LOG(INFO, media_log_)
<< "Starting MediaFoundationRenderingMode: " << rendering_mode_;
@@ -498,6 +503,9 @@ void MediaFoundationRenderer::SetMediaFoundationRenderingMode(
if (mf_media_engine_->HasVideo()) {
if (render_mode == MediaFoundationRenderingMode::FrameServer) {
+ // cannot change to frameserver if force_dcomp_mode_for_testing_ is true
+ DCHECK(!force_dcomp_mode_for_testing_);
+
// Make sure we reinitialize the texture pool
hr = InitializeTexturePool(native_video_size_);
} else if (render_mode == MediaFoundationRenderingMode::DirectComposition) {
@@ -569,6 +577,8 @@ void MediaFoundationRenderer::GetDCompSurface(GetDCompSurfaceCB callback) {
HRESULT hr = SetDCompModeInternal();
if (FAILED(hr)) {
+ base::UmaHistogramSparse(
+ "Media.MediaFoundationRenderer.FailedToSetDCompMode", hr);
OnError(PIPELINE_ERROR_COULD_NOT_RENDER, ErrorReason::kFailedToSetDCompMode,
hr);
std::move(callback).Run(base::win::ScopedHandle(), PrintHr(hr));
@@ -828,9 +838,16 @@ void MediaFoundationRenderer::OnLoadedData() {
void MediaFoundationRenderer::OnPlaying() {
DVLOG_FUNC(3);
+
+ has_reported_playing_ = true;
+
OnBufferingStateChange(
BufferingState::BUFFERING_HAVE_ENOUGH,
BufferingStateChangeReason::BUFFERING_CHANGE_REASON_UNKNOWN);
+
+ // Earliest time to request first frame to screen
+ RequestNextFrame();
+
// The OnPlaying callback from MediaEngineNotifyImpl lets us know that an
// MF_MEDIA_ENGINE_EVENT_PLAYING message has been received. At this point we
// can safely start sending Statistics as any asynchronous Flush action in
@@ -950,6 +967,14 @@ void MediaFoundationRenderer::OnError(PipelineStatus status,
// This is not an error, so special case it here.
PipelineStatus new_status = status;
if (hresult == static_cast<HRESULT>(0x8004CD12)) {
+ // TODO(crbug.com/1370844): Remove these after the investigation is done.
+ base::UmaHistogramBoolean(
+ "Media.MediaFoundationRenderer.InvalidHwdrmState.HasReportedPlaying",
+ has_reported_playing_);
+ base::UmaHistogramCounts10000(
+ "Media.MediaFoundationRenderer.InvalidHwdrmState.VideoFrameDecoded",
+ statistics_.video_frames_decoded);
+
new_status = PIPELINE_ERROR_HARDWARE_CONTEXT_RESET;
if (cdm_proxy_)
cdm_proxy_->OnHardwareContextReset();
@@ -966,9 +991,7 @@ void MediaFoundationRenderer::OnError(PipelineStatus status,
renderer_client_->OnError(new_status);
}
-void MediaFoundationRenderer::RequestNextFrameBetweenTimestamps(
- base::TimeTicks deadline_min,
- base::TimeTicks deadline_max) {
+void MediaFoundationRenderer::RequestNextFrame() {
DCHECK(task_runner_->RunsTasksInCurrentSequence());
if (rendering_mode_ != MediaFoundationRenderingMode::FrameServer) {
return;
diff --git a/chromium/media/renderers/win/media_foundation_renderer.h b/chromium/media/renderers/win/media_foundation_renderer.h
index 3fbd9a98303..1df21284f36 100644
--- a/chromium/media/renderers/win/media_foundation_renderer.h
+++ b/chromium/media/renderers/win/media_foundation_renderer.h
@@ -1,4 +1,4 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
+// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -94,8 +94,7 @@ class MEDIA_EXPORT MediaFoundationRenderer
void SetOutputRect(const gfx::Rect& output_rect,
SetOutputRectCB callback) override;
void NotifyFrameReleased(const base::UnguessableToken& frame_token) override;
- void RequestNextFrameBetweenTimestamps(base::TimeTicks deadline_min,
- base::TimeTicks deadline_max) override;
+ void RequestNextFrame() override;
void SetMediaFoundationRenderingMode(
MediaFoundationRenderingMode render_mode) override;
@@ -223,6 +222,7 @@ class MEDIA_EXPORT MediaFoundationRenderer
MediaFoundationRenderingMode rendering_mode_ =
MediaFoundationRenderingMode::DirectComposition;
+ bool has_reported_playing_ = false;
bool has_reported_significant_playback_ = false;
// NOTE: Weak pointers must be invalidated before all other member variables.
diff --git a/chromium/media/renderers/win/media_foundation_renderer_extension.h b/chromium/media/renderers/win/media_foundation_renderer_extension.h
index 768e4a317b4..927abb430c3 100644
--- a/chromium/media/renderers/win/media_foundation_renderer_extension.h
+++ b/chromium/media/renderers/win/media_foundation_renderer_extension.h
@@ -1,4 +1,4 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
+// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -42,9 +42,7 @@ class MEDIA_EXPORT MediaFoundationRendererExtension {
const base::UnguessableToken& frame_token) = 0;
// Request a new frame to be provided to the client.
- virtual void RequestNextFrameBetweenTimestamps(
- base::TimeTicks deadline_min,
- base::TimeTicks deadline_max) = 0;
+ virtual void RequestNextFrame() = 0;
// Change which mode we are using for video frame rendering.
virtual void SetMediaFoundationRenderingMode(
diff --git a/chromium/media/renderers/win/media_foundation_renderer_integration_test.cc b/chromium/media/renderers/win/media_foundation_renderer_integration_test.cc
index 5a0f7462117..fa6c37f06e0 100644
--- a/chromium/media/renderers/win/media_foundation_renderer_integration_test.cc
+++ b/chromium/media/renderers/win/media_foundation_renderer_integration_test.cc
@@ -1,4 +1,4 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
+// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_renderer_unittest.cc b/chromium/media/renderers/win/media_foundation_renderer_unittest.cc
index 2ad5326175c..a2dbc4515bf 100644
--- a/chromium/media/renderers/win/media_foundation_renderer_unittest.cc
+++ b/chromium/media/renderers/win/media_foundation_renderer_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
+// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -69,7 +69,7 @@ class MockMediaProtectionPMPServer
IMediaProtectionPMPServer> {
public:
MockMediaProtectionPMPServer() = default;
- virtual ~MockMediaProtectionPMPServer() = default;
+ ~MockMediaProtectionPMPServer() override = default;
static HRESULT MakeMockMediaProtectionPMPServer(
IMediaProtectionPMPServer** pmp_server) {
diff --git a/chromium/media/renderers/win/media_foundation_rendering_mode.cc b/chromium/media/renderers/win/media_foundation_rendering_mode.cc
index a1c4d509c6b..ed9461d2840 100644
--- a/chromium/media/renderers/win/media_foundation_rendering_mode.cc
+++ b/chromium/media/renderers/win/media_foundation_rendering_mode.cc
@@ -1,4 +1,4 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
+// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_rendering_mode.h b/chromium/media/renderers/win/media_foundation_rendering_mode.h
index e82ca89d0c9..ed9ae8567f1 100644
--- a/chromium/media/renderers/win/media_foundation_rendering_mode.h
+++ b/chromium/media/renderers/win/media_foundation_rendering_mode.h
@@ -1,4 +1,4 @@
-// Copyright 2022 The Chromium Authors. All rights reserved.
+// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_source_wrapper.cc b/chromium/media/renderers/win/media_foundation_source_wrapper.cc
index 8d5d492a201..7f5c7d6bd28 100644
--- a/chromium/media/renderers/win/media_foundation_source_wrapper.cc
+++ b/chromium/media/renderers/win/media_foundation_source_wrapper.cc
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_source_wrapper.h b/chromium/media/renderers/win/media_foundation_source_wrapper.h
index 5a25e181382..4bc06577ac4 100644
--- a/chromium/media/renderers/win/media_foundation_source_wrapper.h
+++ b/chromium/media/renderers/win/media_foundation_source_wrapper.h
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_stream_wrapper.cc b/chromium/media/renderers/win/media_foundation_stream_wrapper.cc
index 2102ff8cc00..2b817dfd5f5 100644
--- a/chromium/media/renderers/win/media_foundation_stream_wrapper.cc
+++ b/chromium/media/renderers/win/media_foundation_stream_wrapper.cc
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_stream_wrapper.h b/chromium/media/renderers/win/media_foundation_stream_wrapper.h
index 22cf6c3a874..2100e93fc86 100644
--- a/chromium/media/renderers/win/media_foundation_stream_wrapper.h
+++ b/chromium/media/renderers/win/media_foundation_stream_wrapper.h
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_texture_pool.cc b/chromium/media/renderers/win/media_foundation_texture_pool.cc
index 6b1838a4084..34df928ae90 100644
--- a/chromium/media/renderers/win/media_foundation_texture_pool.cc
+++ b/chromium/media/renderers/win/media_foundation_texture_pool.cc
@@ -1,4 +1,4 @@
-// Copyright 2021 The Chromium Authors. All rights reserved.
+// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_texture_pool.h b/chromium/media/renderers/win/media_foundation_texture_pool.h
index fe0105554af..7c427fc57e4 100644
--- a/chromium/media/renderers/win/media_foundation_texture_pool.h
+++ b/chromium/media/renderers/win/media_foundation_texture_pool.h
@@ -1,4 +1,4 @@
-// Copyright 2021 The Chromium Authors. All rights reserved.
+// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_texture_pool_unittest.cc b/chromium/media/renderers/win/media_foundation_texture_pool_unittest.cc
index e776a2535e7..fb0ca913e91 100644
--- a/chromium/media/renderers/win/media_foundation_texture_pool_unittest.cc
+++ b/chromium/media/renderers/win/media_foundation_texture_pool_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright 2021 The Chromium Authors. All rights reserved.
+// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_video_stream.cc b/chromium/media/renderers/win/media_foundation_video_stream.cc
index a2d575118db..95019a21121 100644
--- a/chromium/media/renderers/win/media_foundation_video_stream.cc
+++ b/chromium/media/renderers/win/media_foundation_video_stream.cc
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/chromium/media/renderers/win/media_foundation_video_stream.h b/chromium/media/renderers/win/media_foundation_video_stream.h
index 33e43def6c6..c2c044e0a55 100644
--- a/chromium/media/renderers/win/media_foundation_video_stream.h
+++ b/chromium/media/renderers/win/media_foundation_video_stream.h
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.