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

Side by Side Diff: media/base/renderer.h

Issue 2491043003: MediaResource refactoring to support multiple streams (Closed)
Patch Set: rebase Created 3 years, 10 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_RENDERER_H_ 5 #ifndef MEDIA_BASE_RENDERER_H_
6 #define MEDIA_BASE_RENDERER_H_ 6 #define MEDIA_BASE_RENDERER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "media/base/buffering_state.h" 12 #include "media/base/buffering_state.h"
13 #include "media/base/cdm_context.h" 13 #include "media/base/cdm_context.h"
14 #include "media/base/media_export.h" 14 #include "media/base/media_export.h"
15 #include "media/base/pipeline_status.h" 15 #include "media/base/pipeline_status.h"
16 16
17 namespace media { 17 namespace media {
18 18
19 class DemuxerStreamProvider; 19 class MediaResource;
20 class RendererClient; 20 class RendererClient;
21 21
22 class MEDIA_EXPORT Renderer { 22 class MEDIA_EXPORT Renderer {
23 public: 23 public:
24 Renderer(); 24 Renderer();
25 25
26 // Stops rendering and fires any pending callbacks. 26 // Stops rendering and fires any pending callbacks.
27 virtual ~Renderer(); 27 virtual ~Renderer();
28 28
29 // Initializes the Renderer with |demuxer_stream_provider|, executing 29 // Initializes the Renderer with |media_resource|, executing
30 // |init_cb| upon completion. |demuxer_stream_provider| must be valid for 30 // |init_cb| upon completion. |media_resource| must be valid for
xhwang 2017/02/01 18:26:03 nit: please re-flow the comment
servolk 2017/02/01 22:29:17 Done.
31 // the lifetime of the Renderer object. |init_cb| must only be run after this 31 // the lifetime of the Renderer object. |init_cb| must only be run after this
32 // method has returned. Firing |init_cb| may result in the immediate 32 // method has returned. Firing |init_cb| may result in the immediate
33 // destruction of the caller, so it must be run only prior to returning. 33 // destruction of the caller, so it must be run only prior to returning.
34 virtual void Initialize(DemuxerStreamProvider* demuxer_stream_provider, 34 virtual void Initialize(MediaResource* media_resource,
35 RendererClient* client, 35 RendererClient* client,
36 const PipelineStatusCB& init_cb) = 0; 36 const PipelineStatusCB& init_cb) = 0;
37 37
38 // Associates the |cdm_context| with this Renderer for decryption (and 38 // Associates the |cdm_context| with this Renderer for decryption (and
39 // decoding) of media data, then fires |cdm_attached_cb| with the result. 39 // decoding) of media data, then fires |cdm_attached_cb| with the result.
40 virtual void SetCdm(CdmContext* cdm_context, 40 virtual void SetCdm(CdmContext* cdm_context,
41 const CdmAttachedCB& cdm_attached_cb) = 0; 41 const CdmAttachedCB& cdm_attached_cb) = 0;
42 42
43 // The following functions must be called after Initialize(). 43 // The following functions must be called after Initialize().
44 44
(...skipping 12 matching lines...) Expand all
57 // Returns the current media time. 57 // Returns the current media time.
58 virtual base::TimeDelta GetMediaTime() = 0; 58 virtual base::TimeDelta GetMediaTime() = 0;
59 59
60 private: 60 private:
61 DISALLOW_COPY_AND_ASSIGN(Renderer); 61 DISALLOW_COPY_AND_ASSIGN(Renderer);
62 }; 62 };
63 63
64 } // namespace media 64 } // namespace media
65 65
66 #endif // MEDIA_BASE_RENDERER_H_ 66 #endif // MEDIA_BASE_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698