OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MOJO_SERVICES_MOJO_DEMUXER_STREAM_IMPL_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_IMPL_H_ |
6 #define MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_IMPL_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "media/base/demuxer_stream.h" | 10 #include "media/base/demuxer_stream.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // |stream| is the underlying DemuxerStream we are proxying for. | 21 // |stream| is the underlying DemuxerStream we are proxying for. |
22 // Note: |this| does not take ownership of |stream|. | 22 // Note: |this| does not take ownership of |stream|. |
23 explicit MojoDemuxerStreamImpl(media::DemuxerStream* stream); | 23 explicit MojoDemuxerStreamImpl(media::DemuxerStream* stream); |
24 ~MojoDemuxerStreamImpl() override; | 24 ~MojoDemuxerStreamImpl() override; |
25 | 25 |
26 // mojo::DemuxerStream implementation. | 26 // mojo::DemuxerStream implementation. |
27 void Read(const mojo::Callback<void(mojo::DemuxerStream::Status, | 27 void Read(const mojo::Callback<void(mojo::DemuxerStream::Status, |
28 mojo::MediaDecoderBufferPtr)>& callback) | 28 mojo::MediaDecoderBufferPtr)>& callback) |
29 override; | 29 override; |
30 | 30 |
31 // mojo::InterfaceImpl overrides. | 31 void DidConnect(); |
32 void OnConnectionEstablished() override; | |
33 | 32 |
34 private: | 33 private: |
35 // |callback| is the callback that was passed to the initiating Read() | 34 // |callback| is the callback that was passed to the initiating Read() |
36 // call by our client. | 35 // call by our client. |
37 // |status| and |buffer| are the standard media::ReadCB parameters. | 36 // |status| and |buffer| are the standard media::ReadCB parameters. |
38 typedef mojo::Callback<void(mojo::DemuxerStream::Status, | 37 typedef mojo::Callback<void(mojo::DemuxerStream::Status, |
39 mojo::MediaDecoderBufferPtr)> BufferReadyCB; | 38 mojo::MediaDecoderBufferPtr)> BufferReadyCB; |
40 void OnBufferReady(const BufferReadyCB& callback, | 39 void OnBufferReady(const BufferReadyCB& callback, |
41 media::DemuxerStream::Status status, | 40 media::DemuxerStream::Status status, |
42 const scoped_refptr<media::DecoderBuffer>& buffer); | 41 const scoped_refptr<media::DecoderBuffer>& buffer); |
43 | 42 |
44 // See constructor. We do not own |stream_|. | 43 // See constructor. We do not own |stream_|. |
45 media::DemuxerStream* stream_; | 44 media::DemuxerStream* stream_; |
46 | 45 |
47 base::WeakPtrFactory<MojoDemuxerStreamImpl> weak_factory_; | 46 base::WeakPtrFactory<MojoDemuxerStreamImpl> weak_factory_; |
48 DISALLOW_COPY_AND_ASSIGN(MojoDemuxerStreamImpl); | 47 DISALLOW_COPY_AND_ASSIGN(MojoDemuxerStreamImpl); |
49 }; | 48 }; |
50 | 49 |
51 } // namespace media | 50 } // namespace media |
52 | 51 |
53 #endif // MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_IMPL_H_ | 52 #endif // MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_IMPL_H_ |
OLD | NEW |