cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / media / audio / shared_memory_util.h
blob9186d5c9529880e8c73b6a855cfde23ec59e7fea
1 // Copyright (c) 2012 The Chromium Authors. 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.
5 #ifndef MEDIA_AUDIO_SHARED_MEMORY_UTIL_H_
6 #define MEDIA_AUDIO_SHARED_MEMORY_UTIL_H_
8 #include "base/basictypes.h"
9 #include "base/memory/shared_memory.h"
10 #include "media/base/media_export.h"
12 namespace media {
14 // Value sent by the controller to the renderer in low-latency mode
15 // indicating that the stream is paused.
16 enum { kPauseMark = -1 };
18 // Functions that handle data buffer passed between processes in the shared
19 // memory. Called on both IPC sides. These are necessary because the shared
20 // memory has a layout: the last word in the block is the data size in bytes.
22 MEDIA_EXPORT uint32 TotalSharedMemorySizeInBytes(uint32 packet_size);
23 MEDIA_EXPORT uint32 PacketSizeInBytes(uint32 shared_memory_created_size);
24 MEDIA_EXPORT uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory,
25 uint32 packet_size);
26 MEDIA_EXPORT void SetActualDataSizeInBytes(base::SharedMemory* shared_memory,
27 uint32 packet_size,
28 uint32 actual_data_size);
29 MEDIA_EXPORT void SetActualDataSizeInBytes(void* shared_memory_ptr,
30 uint32 packet_size,
31 uint32 actual_data_size);
32 MEDIA_EXPORT void SetUnknownDataSize(base::SharedMemory* shared_memory,
33 uint32 packet_size);
34 MEDIA_EXPORT bool IsUnknownDataSize(base::SharedMemory* shared_memory,
35 uint32 packet_size);
37 } // namespace media
39 #endif // MEDIA_AUDIO_SHARED_MEMORY_UTIL_H_