OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // FilterHost describes an interface for individual filters to access and | 5 // FilterHost describes an interface for individual filters to access and |
6 // modify global playback information. Every filter is given a filter host | 6 // modify global playback information. Every filter is given a filter host |
7 // reference as part of initialization. | 7 // reference as part of initialization. |
8 // | 8 // |
9 // This interface is intentionally verbose to cover the needs for the different | 9 // This interface is intentionally verbose to cover the needs for the different |
10 // types of filters (see media/base/filters.h for filter definitions). Filters | 10 // types of filters (see media/base/filters.h for filter definitions). Filters |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "media/base/pipeline.h" | 21 #include "media/base/pipeline.h" |
22 | 22 |
23 namespace media { | 23 namespace media { |
24 | 24 |
25 class MEDIA_EXPORT FilterHost { | 25 class MEDIA_EXPORT FilterHost { |
26 public: | 26 public: |
27 // Stops execution of the pipeline due to a fatal error. Do not call this | 27 // Stops execution of the pipeline due to a fatal error. Do not call this |
28 // method with PIPELINE_OK. | 28 // method with PIPELINE_OK. |
29 virtual void SetError(PipelineStatus error) = 0; | 29 virtual void SetError(PipelineStatus error) = 0; |
30 | 30 |
31 // Gets the current time in microseconds. | 31 // Gets the current time. |
32 virtual base::TimeDelta GetTime() const = 0; | 32 virtual base::TimeDelta GetTime() const = 0; |
33 | 33 |
34 // Gets the duration in microseconds. | 34 // Gets the duration. |
35 virtual base::TimeDelta GetDuration() const = 0; | 35 virtual base::TimeDelta GetDuration() const = 0; |
36 | 36 |
37 // Updates the current time. Other filters should poll to examine the updated | 37 // Updates the current time. Other filters should poll to examine the updated |
38 // time. | 38 // time. |
39 virtual void SetTime(base::TimeDelta time) = 0; | 39 virtual void SetTime(base::TimeDelta time) = 0; |
40 | 40 |
41 // Get the duration of the media in microseconds. If the duration has not | |
42 // been determined yet, then returns 0. | |
43 virtual void SetDuration(base::TimeDelta duration) = 0; | |
44 | |
45 // Set the approximate amount of playable data buffered so far in micro- | |
46 // seconds. | |
47 virtual void SetBufferedTime(base::TimeDelta buffered_time) = 0; | |
48 | |
49 // Set the total size of the media file. | |
50 virtual void SetTotalBytes(int64 total_bytes) = 0; | |
51 | |
52 // Sets the total number of bytes that are buffered on the client and ready to | |
53 // be played. | |
54 virtual void SetBufferedBytes(int64 buffered_bytes) = 0; | |
55 | |
56 // Sets the natural size of the video output in pixel units. | 41 // Sets the natural size of the video output in pixel units. |
57 virtual void SetNaturalVideoSize(const gfx::Size& size) = 0; | 42 virtual void SetNaturalVideoSize(const gfx::Size& size) = 0; |
58 | 43 |
59 // Notifies that this filter has ended, typically only called by filter graph | 44 // Notifies that this filter has ended, typically only called by filter graph |
60 // endpoints such as renderers. | 45 // endpoints such as renderers. |
61 virtual void NotifyEnded() = 0; | 46 virtual void NotifyEnded() = 0; |
62 | 47 |
63 // Sets the flag to indicate current network activity. | |
64 virtual void SetNetworkActivity(bool is_downloading_data) = 0; | |
65 | |
66 // Disable audio renderer by calling OnAudioRendererDisabled() on all | 48 // Disable audio renderer by calling OnAudioRendererDisabled() on all |
67 // filters. | 49 // filters. |
68 virtual void DisableAudioRenderer() = 0; | 50 virtual void DisableAudioRenderer() = 0; |
69 | 51 |
70 // Sets the byte offset at which the client is requesting the video. | |
71 virtual void SetCurrentReadPosition(int64 offset) = 0; | |
72 | |
73 // Gets the byte offset at which the client is requesting the video. | |
74 virtual int64 GetCurrentReadPosition() = 0; | |
75 | |
76 protected: | 52 protected: |
77 virtual ~FilterHost() {} | 53 virtual ~FilterHost() {} |
78 }; | 54 }; |
79 | 55 |
80 } // namespace media | 56 } // namespace media |
81 | 57 |
82 #endif // MEDIA_BASE_FILTER_HOST_H_ | 58 #endif // MEDIA_BASE_FILTER_HOST_H_ |
OLD | NEW |