blob: 3510776d2933935b40da77654e9ece5df44e37ad [file] [log] [blame]
[email protected]e785780e2011-03-30 19:31:301// Copyright (c) 2011 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.
4
5#ifndef MEDIA_BASE_BITSTREAM_BUFFER_H_
6#define MEDIA_BASE_BITSTREAM_BUFFER_H_
7
8#include "base/basictypes.h"
[email protected]05699652011-05-23 18:05:509#include "base/shared_memory.h"
[email protected]e785780e2011-03-30 19:31:3010
11namespace media {
12
[email protected]05699652011-05-23 18:05:5013// Class for passing bitstream buffers around. Does not take ownership of the
14// data. This is the media-namespace equivalent of PP_VideoBitstreamBuffer_Dev.
[email protected]e785780e2011-03-30 19:31:3015class BitstreamBuffer {
16 public:
[email protected]05699652011-05-23 18:05:5017 BitstreamBuffer(int32 id, base::SharedMemoryHandle handle, size_t size)
[email protected]1357ae72011-05-13 18:28:0818 : id_(id),
[email protected]05699652011-05-23 18:05:5019 handle_(handle),
[email protected]1357ae72011-05-13 18:28:0820 size_(size) {
[email protected]e785780e2011-03-30 19:31:3021 }
22
[email protected]1357ae72011-05-13 18:28:0823 int32 id() const { return id_; }
[email protected]05699652011-05-23 18:05:5024 base::SharedMemoryHandle handle() const { return handle_; }
[email protected]1357ae72011-05-13 18:28:0825 size_t size() const { return size_; }
[email protected]e785780e2011-03-30 19:31:3026
27 private:
[email protected]05699652011-05-23 18:05:5028 const int32 id_;
29 const base::SharedMemoryHandle handle_;
30 const size_t size_;
[email protected]e785780e2011-03-30 19:31:3031
[email protected]05699652011-05-23 18:05:5032 // Allow compiler-generated copy & assign constructors.
[email protected]e785780e2011-03-30 19:31:3033};
34
35} // namespace media
36
37#endif // MEDIA_BASE_BITSTREAM_BUFFER_H_