OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PIPELINE_H_ | 5 #ifndef MEDIA_BASE_PIPELINE_H_ |
6 #define MEDIA_BASE_PIPELINE_H_ | 6 #define MEDIA_BASE_PIPELINE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
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_metadata.h" | 15 #include "media/base/pipeline_metadata.h" |
16 #include "media/base/pipeline_status.h" | 16 #include "media/base/pipeline_status.h" |
17 #include "media/base/ranges.h" | 17 #include "media/base/ranges.h" |
18 #include "media/base/text_track.h" | 18 #include "media/base/text_track.h" |
19 #include "media/base/video_rotation.h" | 19 #include "media/base/video_rotation.h" |
20 #include "ui/gfx/geometry/size.h" | 20 #include "ui/gfx/geometry/size.h" |
21 | 21 |
22 namespace media { | 22 namespace media { |
23 | 23 |
24 class Demuxer; | 24 class Demuxer; |
25 class DemuxerStream; | |
25 class Renderer; | 26 class Renderer; |
26 class VideoFrame; | 27 class VideoFrame; |
27 | 28 |
28 class MEDIA_EXPORT Pipeline { | 29 class MEDIA_EXPORT Pipeline { |
29 public: | 30 public: |
30 class Client { | 31 class Client { |
31 public: | 32 public: |
32 // Executed whenever an error occurs except when the error occurs during | 33 // Executed whenever an error occurs except when the error occurs during |
33 // Start/Seek/Resume or Suspend. Those errors are reported via |seek_cb| | 34 // Start/Seek/Resume or Suspend. Those errors are reported via |seek_cb| |
34 // and |suspend_cb| respectively. | 35 // and |suspend_cb| respectively. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 | 69 |
69 // Build a pipeline to using the given |demuxer| and |renderer| to construct | 70 // Build a pipeline to using the given |demuxer| and |renderer| to construct |
70 // a filter chain, executing |seek_cb| when the initial seek has completed. | 71 // a filter chain, executing |seek_cb| when the initial seek has completed. |
71 // Methods on PipelineClient may be called up until Stop() has completed. | 72 // Methods on PipelineClient may be called up until Stop() has completed. |
72 // It is an error to call this method after the pipeline has already started. | 73 // It is an error to call this method after the pipeline has already started. |
73 virtual void Start(Demuxer* demuxer, | 74 virtual void Start(Demuxer* demuxer, |
74 std::unique_ptr<Renderer> renderer, | 75 std::unique_ptr<Renderer> renderer, |
75 Client* client, | 76 Client* client, |
76 const PipelineStatusCB& seek_cb) = 0; | 77 const PipelineStatusCB& seek_cb) = 0; |
77 | 78 |
79 // Restarts playback of the given demuxer |stream| from the |time| position. | |
80 virtual void RestartStreamPlayback(DemuxerStream* stream, | |
81 base::TimeDelta time) = 0; | |
xhwang
2016/06/04 00:09:43
What if our current media time is at t1, and |time
servolk
2016/06/09 21:00:13
Well, I suppose if we move the 'resume playback' l
| |
82 | |
78 // Stops the pipeline. This is a blocking function. | 83 // Stops the pipeline. This is a blocking function. |
79 // If the pipeline is started, it must be stopped before destroying it. | 84 // If the pipeline is started, it must be stopped before destroying it. |
80 // It it permissible to call Stop() at any point during the lifetime of the | 85 // It it permissible to call Stop() at any point during the lifetime of the |
81 // pipeline. | 86 // pipeline. |
82 // | 87 // |
83 // Once Stop is called any outstanding completion callbacks | 88 // Once Stop is called any outstanding completion callbacks |
84 // for Start/Seek/Suspend/Resume or Client methods will *not* be called. | 89 // for Start/Seek/Suspend/Resume or Client methods will *not* be called. |
85 virtual void Stop() = 0; | 90 virtual void Stop() = 0; |
86 | 91 |
87 // Attempt to seek to the position specified by time. |seek_cb| will be | 92 // Attempt to seek to the position specified by time. |seek_cb| will be |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 // Gets the current pipeline statistics. | 162 // Gets the current pipeline statistics. |
158 virtual PipelineStatistics GetStatistics() const = 0; | 163 virtual PipelineStatistics GetStatistics() const = 0; |
159 | 164 |
160 virtual void SetCdm(CdmContext* cdm_context, | 165 virtual void SetCdm(CdmContext* cdm_context, |
161 const CdmAttachedCB& cdm_attached_cb) = 0; | 166 const CdmAttachedCB& cdm_attached_cb) = 0; |
162 }; | 167 }; |
163 | 168 |
164 } // namespace media | 169 } // namespace media |
165 | 170 |
166 #endif // MEDIA_BASE_PIPELINE_H_ | 171 #endif // MEDIA_BASE_PIPELINE_H_ |
OLD | NEW |