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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2363303002: [WIP] Proxy RtcVideoDecoder calls to a media::VideoDecoder.
Patch Set: Now working with remote ffmpeg decoder Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index fba5aa2b40f57787e45b8ece9b2b59b3f6c0de4a..5cd1d61b0115d5bb0253ee2d0955ca27d45a6231 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -381,8 +381,40 @@ using extensions::Manifest;
using plugins::ChromeContentBrowserClientPluginsPart;
#endif
+#include "media/filters/ffmpeg_video_decoder.h"
+#include "media/mojo/interfaces/video_decoder.mojom.h"
+#include "media/mojo/services/mojo_media_client.h"
+#include "media/mojo/services/mojo_video_decoder_service.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+
namespace {
+/////////////// DEBUG //////////////////////////////////////////////////////////
+// This MojoMediaClient is only good for one thing: creating FFmpegVideoDecoders
+class FFmpegMojoMediaClient : public media::MojoMediaClient {
+ public:
+ FFmpegMojoMediaClient() {}
+ ~FFmpegMojoMediaClient() override {}
+
+ // media::MojoMediaClient implementation:
+ std::unique_ptr<media::VideoDecoder> CreateVideoDecoder(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner) override {
+ return base::MakeUnique<media::FFmpegVideoDecoder>();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(FFmpegMojoMediaClient);
+};
+
+static void CreateVideoDecoder(media::mojom::VideoDecoderRequest request) {
+ // Note(slan): Just leak the client for now.
+ mojo::MakeStrongBinding<::media::mojom::VideoDecoder>(
+ base::MakeUnique<::media::MojoVideoDecoderService>(
+ new FFmpegMojoMediaClient()),
+ std::move(request));
+}
+/////////////// DEBUG //////////////////////////////////////////////////////////
+
// Cached version of the locale so we can return the locale on the I/O
// thread.
base::LazyInstance<std::string> g_io_thread_application_locale;
@@ -2938,6 +2970,7 @@ void ChromeContentBrowserClient::ExposeInterfacesToRenderer(
registry->AddInterface(
base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()),
ui_task_runner);
+ registry->AddInterface(base::Bind(&CreateVideoDecoder));
#if defined(OS_CHROMEOS)
registry->AddInterface<metrics::mojom::LeakDetector>(
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698