Update V8 to version 4.7.56.
[chromium-blink-merge.git] / media / base / bitstream_buffer.h
blobc015b92ab5a143aca99f5218ec2dc39792b12ebd
1 // 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.
5 #ifndef MEDIA_BASE_BITSTREAM_BUFFER_H_
6 #define MEDIA_BASE_BITSTREAM_BUFFER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/shared_memory.h"
10 #include "base/time/time.h"
11 #include "media/base/timestamp_constants.h"
13 namespace media {
15 // Class for passing bitstream buffers around. Does not take ownership of the
16 // data. This is the media-namespace equivalent of PP_VideoBitstreamBuffer_Dev.
17 class BitstreamBuffer {
18 public:
19 BitstreamBuffer(int32 id, base::SharedMemoryHandle handle, size_t size)
20 : id_(id),
21 handle_(handle),
22 size_(size),
23 presentation_timestamp_(kNoTimestamp()) {}
25 BitstreamBuffer(int32 id,
26 base::SharedMemoryHandle handle,
27 size_t size,
28 base::TimeDelta presentation_timestamp)
29 : id_(id),
30 handle_(handle),
31 size_(size),
32 presentation_timestamp_(presentation_timestamp) {}
34 int32 id() const { return id_; }
35 base::SharedMemoryHandle handle() const { return handle_; }
36 size_t size() const { return size_; }
38 // The timestamp is only valid if it's not equal to |media::kNoTimestamp()|.
39 base::TimeDelta presentation_timestamp() const {
40 return presentation_timestamp_;
43 private:
44 int32 id_;
45 base::SharedMemoryHandle handle_;
46 size_t size_;
48 // This is only set when necessary. For example, AndroidVideoDecodeAccelerator
49 // needs the timestamp because the underlying decoder may require it to
50 // determine the output order.
51 base::TimeDelta presentation_timestamp_;
53 // Allow compiler-generated copy & assign constructors.
56 } // namespace media
58 #endif // MEDIA_BASE_BITSTREAM_BUFFER_H_