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

Side by Side Diff: services/media/common/media_pipe_base.h

Issue 1823833003: Take advantage of MojoGetBufferInformation (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 SERVICES_MEDIA_COMMON_MEDIA_PIPE_BASE_H_ 5 #ifndef SERVICES_MEDIA_COMMON_MEDIA_PIPE_BASE_H_
6 #define SERVICES_MEDIA_COMMON_MEDIA_PIPE_BASE_H_ 6 #define SERVICES_MEDIA_COMMON_MEDIA_PIPE_BASE_H_
7 7
8 #include <atomic> 8 #include <atomic>
9 #include <deque> 9 #include <deque>
10 #include <memory> 10 #include <memory>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 public: 60 public:
61 static MappedSharedBufferPtr Create(ScopedSharedBufferHandle handle, 61 static MappedSharedBufferPtr Create(ScopedSharedBufferHandle handle,
62 uint64_t size); 62 uint64_t size);
63 ~MappedSharedBuffer(); 63 ~MappedSharedBuffer();
64 64
65 const ScopedSharedBufferHandle& handle() const { return handle_; } 65 const ScopedSharedBufferHandle& handle() const { return handle_; }
66 uint64_t size() const { return size_; } 66 uint64_t size() const { return size_; }
67 void* base() const { return base_; } 67 void* base() const { return base_; }
68 68
69 private: 69 private:
70 MappedSharedBuffer(ScopedSharedBufferHandle handle, size_t size); 70 MappedSharedBuffer(ScopedSharedBufferHandle handle, uint64_t size);
71 71
72 ScopedSharedBufferHandle handle_; 72 ScopedSharedBufferHandle handle_;
73 size_t size_; 73 uint64_t size_;
74 void* base_ = nullptr; 74 void* base_ = nullptr;
75 }; 75 };
76 76
77 // Interface to be implemented by derived classes 77 // Interface to be implemented by derived classes
78 virtual void OnPacketReceived(MediaPacketStatePtr state) = 0; 78 virtual void OnPacketReceived(MediaPacketStatePtr state) = 0;
79 virtual bool OnFlushRequested(const FlushCallback& cbk) = 0; 79 virtual bool OnFlushRequested(const FlushCallback& cbk) = 0;
80 80
81 MappedSharedBufferPtr buffer_; 81 MappedSharedBufferPtr buffer_;
82 82
83 private: 83 private:
84 Binding<MediaConsumer> binding_; 84 Binding<MediaConsumer> binding_;
85 85
86 // MediaConsumer.mojom implementation. 86 // MediaConsumer.mojom implementation.
87 void SetBuffer(ScopedSharedBufferHandle handle, 87 void SetBuffer(ScopedSharedBufferHandle handle,
88 uint64_t size,
89 const SetBufferCallback& cbk) final; 88 const SetBufferCallback& cbk) final;
90 void SendPacket(MediaPacketPtr packet, 89 void SendPacket(MediaPacketPtr packet,
91 const SendPacketCallback& cbk) final; 90 const SendPacketCallback& cbk) final;
92 void Prime(const PrimeCallback& cbk) final; 91 void Prime(const PrimeCallback& cbk) final;
93 void Flush(const FlushCallback& cbk) final; 92 void Flush(const FlushCallback& cbk) final;
94 }; 93 };
95 94
96 } // namespace media 95 } // namespace media
97 } // namespace mojo 96 } // namespace mojo
98 97
99 #endif // SERVICES_MEDIA_COMMON_MEDIA_PIPE_BASE_H_ 98 #endif // SERVICES_MEDIA_COMMON_MEDIA_PIPE_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698