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

Unified Diff: media/mojo/services/demuxer_stream_provider_shim.h

Issue 2491043003: MediaResource refactoring to support multiple streams (Closed)
Patch Set: rebase Created 3 years, 11 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
Index: media/mojo/services/demuxer_stream_provider_shim.h
diff --git a/media/mojo/services/demuxer_stream_provider_shim.h b/media/mojo/services/demuxer_stream_provider_shim.h
deleted file mode 100644
index b1b6da9a1a30a33e79ed9530a8ddecefab93e81b..0000000000000000000000000000000000000000
--- a/media/mojo/services/demuxer_stream_provider_shim.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MEDIA_MOJO_SERVICES_DEMUXER_STREAM_PROVIDER_SHIM_H_
-#define MEDIA_MOJO_SERVICES_DEMUXER_STREAM_PROVIDER_SHIM_H_
-
-#include <stddef.h>
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "media/base/demuxer_stream_provider.h"
-#include "media/mojo/services/mojo_demuxer_stream_adapter.h"
-
-namespace media {
-
-// DemuxerStreamProvider shim for mojom::DemuxerStreams.
-class DemuxerStreamProviderShim : public DemuxerStreamProvider {
- public:
- // Constructs the shim; at least a single audio or video stream must be
- // provided. |demuxer_ready_cb| will be called once the streams have been
- // initialized. Calling any method before then is an error.
- DemuxerStreamProviderShim(std::vector<mojom::DemuxerStreamPtr> streams,
- const base::Closure& demuxer_ready_cb);
- ~DemuxerStreamProviderShim() override;
-
- // DemuxerStreamProvider interface.
- DemuxerStream* GetStream(DemuxerStream::Type type) override;
-
- private:
- // Called as each mojom::DemuxerStream becomes ready. Once all streams
- // are ready it will fire the |demuxer_ready_cb_| provided during
- // construction.
- void OnStreamReady();
-
- // Stored copy the ready callback provided during construction; cleared once
- // all streams are ready.
- base::Closure demuxer_ready_cb_;
-
- // Container for demuxer stream adapters which interface with the mojo level
- // demuxer streams. |streams_ready_| tracks how many streams are ready and is
- // used by OnStreamReady() to know when |demuxer_ready_cb_| should be fired.
- std::vector<std::unique_ptr<MojoDemuxerStreamAdapter>> streams_;
- size_t streams_ready_;
-
- // WeakPtrFactorys must always be the last member variable.
- base::WeakPtrFactory<DemuxerStreamProviderShim> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProviderShim);
-};
-
-} // namespace media
-
-#endif // MEDIA_MOJO_SERVICES_DEMUXER_STREAM_PROVIDER_SHIM_H_

Powered by Google App Engine
This is Rietveld 408576698