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

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

Issue 257323003: Remove the IPC to request DemuxerConfigs when config changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding CHECK to enforce the optional demuxer_configs only has 0 or 1 element Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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 when the demuxer has initialized.
48 // initialized.
49 //
50 // TODO(scherkus): Perhaps clients should be required to call
51 // RequestDemuxerConfigs() to initialize themselves instead of the demuxer
52 // calling this method without being prompted.
53 virtual void OnDemuxerConfigsAvailable(const DemuxerConfigs& params) = 0; 45 virtual void OnDemuxerConfigsAvailable(const DemuxerConfigs& params) = 0;
54 46
55 // Called in response to RequestDemuxerData(). 47 // Called in response to RequestDemuxerData().
56 virtual void OnDemuxerDataAvailable(const DemuxerData& params) = 0; 48 virtual void OnDemuxerDataAvailable(const DemuxerData& params) = 0;
57 49
58 // Called in response to RequestDemuxerSeek(). 50 // Called in response to RequestDemuxerSeek().
59 // If this is in response to a request with |is_browser_seek| set to true, 51 // 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 52 // then |actual_browser_seek_time| may differ from the requested
61 // |time_to_seek|, and reflects the actual time seeked to by the demuxer. 53 // |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 54 // For regular demuxer seeks, |actual_browser_seek_time| is kNoTimestamp() and
63 // should be ignored by browser player. 55 // should be ignored by browser player.
64 virtual void OnDemuxerSeekDone( 56 virtual void OnDemuxerSeekDone(
65 base::TimeDelta actual_browser_seek_time) = 0; 57 base::TimeDelta actual_browser_seek_time) = 0;
66 58
67 // Called whenever the demuxer has detected a duration change. 59 // Called whenever the demuxer has detected a duration change.
68 virtual void OnDemuxerDurationChanged(base::TimeDelta duration) = 0; 60 virtual void OnDemuxerDurationChanged(base::TimeDelta duration) = 0;
69 61
70 protected: 62 protected:
71 virtual ~DemuxerAndroidClient() {} 63 virtual ~DemuxerAndroidClient() {}
72 }; 64 };
73 65
74 } // namespace media 66 } // namespace media
75 67
76 #endif // MEDIA_BASE_ANDROID_DEMUXER_ANDROID_H_ 68 #endif // MEDIA_BASE_ANDROID_DEMUXER_ANDROID_H_
OLDNEW
« no previous file with comments | « content/renderer/media/android/renderer_demuxer_android.cc ('k') | media/base/android/demuxer_stream_player_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698