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

Unified Diff: media/mojo/services/mojo_demuxer_stream_impl.cc

Issue 684963003: Add support for external video renderers in mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo_config
Patch Set: More MSVC... Created 6 years, 1 month 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 | « media/mojo/services/mojo_demuxer_stream_adapter.cc ('k') | media/mojo/services/mojo_renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_demuxer_stream_impl.cc
diff --git a/media/mojo/services/mojo_demuxer_stream_impl.cc b/media/mojo/services/mojo_demuxer_stream_impl.cc
index 0bce8a29fda84e93917fd7b0153d247828bfdaa6..861ba2de7787735cce56eff1b0fc77787343333a 100644
--- a/media/mojo/services/mojo_demuxer_stream_impl.cc
+++ b/media/mojo/services/mojo_demuxer_stream_impl.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/macros.h"
#include "media/base/audio_decoder_config.h"
+#include "media/base/video_decoder_config.h"
#include "media/mojo/interfaces/demuxer_stream.mojom.h"
#include "media/mojo/services/media_type_converters.h"
#include "mojo/public/cpp/bindings/interface_impl.h"
@@ -35,8 +36,13 @@ void MojoDemuxerStreamImpl::OnBufferReady(
if (status == media::DemuxerStream::kConfigChanged) {
// Send the config change so our client can read it once it parses the
// Status obtained via Run() below.
- client()->OnAudioDecoderConfigChanged(
- mojo::AudioDecoderConfig::From(stream_->audio_decoder_config()));
+ if (stream_->type() == media::DemuxerStream::AUDIO) {
+ client()->OnAudioDecoderConfigChanged(
+ mojo::AudioDecoderConfig::From(stream_->audio_decoder_config()));
+ } else if (stream_->type() == media::DemuxerStream::VIDEO) {
+ client()->OnVideoDecoderConfigChanged(
+ mojo::VideoDecoderConfig::From(stream_->video_decoder_config()));
+ }
}
// TODO(tim): Once using DataPipe, fill via the producer handle and then
@@ -49,8 +55,13 @@ void MojoDemuxerStreamImpl::OnConnectionEstablished() {
// This is called when our DemuxerStreamClient has connected itself and is
// ready to receive messages. Send an initial config and notify it that
// we are now ready for business.
- client()->OnAudioDecoderConfigChanged(
- mojo::AudioDecoderConfig::From(stream_->audio_decoder_config()));
+ if (stream_->type() == media::DemuxerStream::AUDIO) {
+ client()->OnAudioDecoderConfigChanged(
+ mojo::AudioDecoderConfig::From(stream_->audio_decoder_config()));
+ } else if (stream_->type() == media::DemuxerStream::VIDEO) {
+ client()->OnVideoDecoderConfigChanged(
+ mojo::VideoDecoderConfig::From(stream_->video_decoder_config()));
+ }
// TODO(tim): Create a DataPipe, hold the producer handle, and pass the
// consumer handle here.
« no previous file with comments | « media/mojo/services/mojo_demuxer_stream_adapter.cc ('k') | media/mojo/services/mojo_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698