Commit 079fa037 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Run MediaService on a sequence instead of on its own thread

BUG=783973

Change-Id: I74cdc80d3cd4187ce0741fa722e2527329347ec5
Reviewed-on: https://chromium-review.googlesource.com/770991Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517503}
parent eada5782
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <memory> #include <memory>
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "services/shape_detection/public/interfaces/constants.mojom.h" #include "services/shape_detection/public/interfaces/constants.mojom.h"
#include "services/shape_detection/shape_detection_service.h" #include "services/shape_detection/shape_detection_service.h"
...@@ -37,7 +38,12 @@ void GpuServiceFactory::RegisterServices(ServiceMap* services) { ...@@ -37,7 +38,12 @@ void GpuServiceFactory::RegisterServices(ServiceMap* services) {
info.factory = info.factory =
base::Bind(&media::CreateGpuMediaService, gpu_preferences_, task_runner_, base::Bind(&media::CreateGpuMediaService, gpu_preferences_, task_runner_,
media_gpu_channel_manager_, android_overlay_factory_cb_); media_gpu_channel_manager_, android_overlay_factory_cb_);
info.use_own_thread = true; // This service will host audio/video decoders, and if these decoding
// operations are blocked, user may hear audio glitch or see video freezing,
// hence "user blocking".
// TODO(crbug.com/786169): Check whether this needs to be single threaded.
info.task_runner = base::CreateSingleThreadTaskRunnerWithTraits(
{base::TaskPriority::USER_BLOCKING});
services->insert(std::make_pair("media", info)); services->insert(std::make_pair("media", info));
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment