c403fff3a3ca62772e9b70e2678f1919fcff8f97
[platform/framework/web/crosswalk-tizen.git] /
1 // Copyright 2014 Samsung Electronics Inc. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_BASE_TIZEN_DEMUXER_EFL_H_
6 #define MEDIA_BASE_TIZEN_DEMUXER_EFL_H_
7
8 #include "base/memory/shared_memory_handle.h"
9 #include "media/base/tizen/demuxer_stream_player_params_efl.h"
10
11 namespace media {
12
13 // Defines the client callback interface.
14 class MEDIA_EXPORT DemuxerEflClient {
15  public:
16   // Called when the demuxer has initialized.
17   virtual void OnDemuxerConfigsAvailable(const DemuxerConfigs& params) = 0;
18
19 #if defined(OS_TIZEN_TV_PRODUCT)
20   // Called when the demuxer state changed.
21   virtual void OnDemuxerStateChanged(const DemuxerConfigs& params) = 0;
22 #endif
23
24   // Called in response to RequestDemuxerData().
25   virtual void OnDemuxerDataAvailable(
26       base::SharedMemoryHandle foreign_memory_handle,
27       const media::DemuxedBufferMetaData& meta_data) = 0;
28
29   // Called to inform demuxer seek completion.
30   virtual void OnDemuxerSeekDone(
31       const base::TimeDelta& actual_browser_seek_time) = 0;
32
33   // Called whenever the demuxer has detected a duration change.
34   virtual void OnDemuxerDurationChanged(base::TimeDelta duration) = 0;
35
36  protected:
37   virtual ~DemuxerEflClient() {}
38 };
39
40 // Defines a demuxer with asynchronous operations.
41 class MEDIA_EXPORT DemuxerEfl {
42  public:
43   virtual ~DemuxerEfl() {}
44
45   // Initializes this demuxer with |client| as the callback handler.
46   // Must be called prior to calling any other methods.
47   virtual void Initialize(DemuxerEflClient* client) = 0;
48
49   // Called to request demuxer seek.
50   virtual void RequestDemuxerSeek(const base::TimeDelta& time_to_seek) = 0;
51
52   // Called to request additional data from the demuxer.
53   virtual void RequestDemuxerData(media::DemuxerStream::Type type) = 0;
54 };
55
56 }  // namespace media
57
58 #endif  // MEDIA_BASE_TIZEN_DEMUXER_EFL_H_