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

Side by Side Diff: media/base/android/media_url_provider.h

Issue 2090343004: Add GetUrl to DemuxerStreamProvider interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added UTs Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_BASE_ANDROID_MEDIA_URL_PRODIVDER_H_
DaleCurtis 2016/06/24 00:42:30 watk@ is going to have a fit, PRODIVDER? :p
tguilbert 2016/06/24 03:13:19 Woops! :P
6 #define MEDIA_BASE_ANDROID_MEDIA_URL_PRODIVDER_H_
7
8 #include <stddef.h>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h"
13 #include "media/base/demuxer.h"
14 #include "url/gurl.h"
15
16 namespace media {
17
18 // Class that saves a URL for later retrieval. To be used in conjunction with
19 // the MediaPlayerRenderer.
20 //
21 // Its primary purpose is to act as a dummy Demuxer, when there is no need
22 // for DemuxerStreams (e.g. in the MediaPlayerRenderer case). For the most part,
23 // its implementation of the Demuxer are NOPs that return the default values and
24 // fire any provided callbacks immediately.
25 //
26 // If Pipeline where to be refactored to use a DemuxerStreamProvider instead of
27 // a Demuxer, MediaUrlProvider should be refactored to inherit directly from
28 // DemuxerStreamProvider.
29 class MediaUrlProvider : public Demuxer {
DaleCurtis 2016/06/24 00:42:30 It's called a provider, but extends a Demuxer? :)
tguilbert 2016/06/24 03:13:19 Done.
30 public:
31 MediaUrlProvider(const GURL& url);
DaleCurtis 2016/06/24 00:42:30 Use explicit with single parameter constructors.
tguilbert 2016/06/24 03:13:20 Done.
32 ~MediaUrlProvider() override;
33
34 // DemuxerStreamProvider interface.
35 DemuxerStream* GetStream(DemuxerStream::Type type) override;
36 GURL* GetUrl() override;
37
38 // Demuxer interface.
39 std::string GetDisplayName() const override;
40 void Initialize(DemuxerHost* host,
41 const PipelineStatusCB& status_cb,
42 bool enable_text_tracks) override;
43 void StartWaitingForSeek(base::TimeDelta seek_time) override;
44 void CancelPendingSeek(base::TimeDelta seek_time) override;
45 void Seek(base::TimeDelta time, const PipelineStatusCB& status_cb) override;
46 void Stop() override;
47 base::TimeDelta GetStartTime() const override;
48 base::Time GetTimelineOffset() const override;
49 int64_t GetMemoryUsage() const override;
50
51 private:
52 GURL url_;
53
54 DISALLOW_COPY_AND_ASSIGN(MediaUrlProvider);
55 };
56
57 } // namespace media
58
59 #endif // MEDIA_BASE_ANDROID_MEDIA_URL_PRODIVDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698