Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ANDROID_DEMUXER_ANDROID_H_ | 5 #ifndef MEDIA_BASE_ANDROID_DEMUXER_ANDROID_H_ |
| 6 #define MEDIA_BASE_ANDROID_DEMUXER_ANDROID_H_ | 6 #define MEDIA_BASE_ANDROID_DEMUXER_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "media/base/demuxer_stream.h" | 10 #include "media/base/demuxer_stream.h" |
| 11 #include "media/base/media_export.h" | 11 #include "media/base/media_export.h" |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 | 14 |
| 15 class DemuxerAndroidClient; | 15 class DemuxerAndroidClient; |
| 16 struct DemuxerConfigs; | 16 struct DemuxerConfigs; |
| 17 struct DemuxerData; | 17 struct DemuxerData; |
| 18 | 18 |
| 19 // Defines a demuxer with asynchronous operations. | 19 // Defines a demuxer with asynchronous operations. |
| 20 class MEDIA_EXPORT DemuxerAndroid { | 20 class MEDIA_EXPORT DemuxerAndroid { |
| 21 public: | 21 public: |
| 22 virtual ~DemuxerAndroid() {} | 22 virtual ~DemuxerAndroid() {} |
| 23 | 23 |
| 24 // Initializes this demuxer with |client| as the callback handler. | 24 // Initializes this demuxer with |client| as the callback handler. |
| 25 // Must be called prior to calling any other methods. | 25 // Must be called prior to calling any other methods. |
| 26 virtual void Initialize(DemuxerAndroidClient* client) = 0; | 26 virtual void Initialize(DemuxerAndroidClient* client) = 0; |
| 27 | 27 |
| 28 // Called to request the current audio/video decoder configurations. | |
| 29 virtual void RequestDemuxerConfigs() = 0; | |
| 30 | |
| 31 // Called to request additional data from the demuxer. | 28 // Called to request additional data from the demuxer. |
| 32 virtual void RequestDemuxerData(media::DemuxerStream::Type type) = 0; | 29 virtual void RequestDemuxerData(media::DemuxerStream::Type type) = 0; |
| 33 | 30 |
| 34 // Called to request the demuxer to seek to a particular media time. | 31 // Called to request the demuxer to seek to a particular media time. |
| 35 // |is_browser_seek| is true if the renderer is not previously expecting this | 32 // |is_browser_seek| is true if the renderer is not previously expecting this |
| 36 // seek and must coordinate with other regular seeks. Browser seek existence | 33 // seek and must coordinate with other regular seeks. Browser seek existence |
| 37 // should be hidden as much as possible from the renderer player and web apps. | 34 // should be hidden as much as possible from the renderer player and web apps. |
| 38 // TODO(wolenetz): Instead of doing browser seek, replay cached data since | 35 // TODO(wolenetz): Instead of doing browser seek, replay cached data since |
| 39 // last keyframe. See http://crbug.com/304234. | 36 // last keyframe. See http://crbug.com/304234. |
| 40 virtual void RequestDemuxerSeek(const base::TimeDelta& time_to_seek, | 37 virtual void RequestDemuxerSeek(const base::TimeDelta& time_to_seek, |
| 41 bool is_browser_seek) = 0; | 38 bool is_browser_seek) = 0; |
| 42 }; | 39 }; |
| 43 | 40 |
| 44 // Defines the client callback interface. | 41 // Defines the client callback interface. |
| 45 class MEDIA_EXPORT DemuxerAndroidClient { | 42 class MEDIA_EXPORT DemuxerAndroidClient { |
| 46 public: | 43 public: |
| 47 // Called in response to RequestDemuxerConfigs() and also when the demuxer has | 44 // Called in response to RequestDemuxerConfigs() and also when the demuxer has |
|
wolenetz
2014/05/02 22:25:30
Comment references the deleted method.
qinmin
2014/05/05 20:52:19
Done.
| |
| 48 // initialized. | 45 // initialized. |
| 49 // | 46 // |
| 50 // TODO(scherkus): Perhaps clients should be required to call | 47 // TODO(scherkus): Perhaps clients should be required to call |
| 51 // RequestDemuxerConfigs() to initialize themselves instead of the demuxer | 48 // RequestDemuxerConfigs() to initialize themselves instead of the demuxer |
|
wolenetz
2014/05/02 22:25:30
ditto
qinmin
2014/05/05 20:52:19
Done.
| |
| 52 // calling this method without being prompted. | 49 // calling this method without being prompted. |
| 53 virtual void OnDemuxerConfigsAvailable(const DemuxerConfigs& params) = 0; | 50 virtual void OnDemuxerConfigsAvailable(const DemuxerConfigs& params) = 0; |
| 54 | 51 |
| 55 // Called in response to RequestDemuxerData(). | 52 // Called in response to RequestDemuxerData(). |
| 56 virtual void OnDemuxerDataAvailable(const DemuxerData& params) = 0; | 53 virtual void OnDemuxerDataAvailable(const DemuxerData& params) = 0; |
| 57 | 54 |
| 58 // Called in response to RequestDemuxerSeek(). | 55 // Called in response to RequestDemuxerSeek(). |
| 59 // If this is in response to a request with |is_browser_seek| set to true, | 56 // If this is in response to a request with |is_browser_seek| set to true, |
| 60 // then |actual_browser_seek_time| may differ from the requested | 57 // then |actual_browser_seek_time| may differ from the requested |
| 61 // |time_to_seek|, and reflects the actual time seeked to by the demuxer. | 58 // |time_to_seek|, and reflects the actual time seeked to by the demuxer. |
| 62 // For regular demuxer seeks, |actual_browser_seek_time| is kNoTimestamp() and | 59 // For regular demuxer seeks, |actual_browser_seek_time| is kNoTimestamp() and |
| 63 // should be ignored by browser player. | 60 // should be ignored by browser player. |
| 64 virtual void OnDemuxerSeekDone( | 61 virtual void OnDemuxerSeekDone( |
| 65 base::TimeDelta actual_browser_seek_time) = 0; | 62 base::TimeDelta actual_browser_seek_time) = 0; |
| 66 | 63 |
| 67 // Called whenever the demuxer has detected a duration change. | 64 // Called whenever the demuxer has detected a duration change. |
| 68 virtual void OnDemuxerDurationChanged(base::TimeDelta duration) = 0; | 65 virtual void OnDemuxerDurationChanged(base::TimeDelta duration) = 0; |
| 69 | 66 |
| 70 protected: | 67 protected: |
| 71 virtual ~DemuxerAndroidClient() {} | 68 virtual ~DemuxerAndroidClient() {} |
| 72 }; | 69 }; |
| 73 | 70 |
| 74 } // namespace media | 71 } // namespace media |
| 75 | 72 |
| 76 #endif // MEDIA_BASE_ANDROID_DEMUXER_ANDROID_H_ | 73 #endif // MEDIA_BASE_ANDROID_DEMUXER_ANDROID_H_ |
| OLD | NEW |