| OLD | NEW | 
|   1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |   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 |   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_BASE_BITSTREAM_BUFFER_H_ |   5 #ifndef MEDIA_BASE_BITSTREAM_BUFFER_H_ | 
|   6 #define MEDIA_BASE_BITSTREAM_BUFFER_H_ |   6 #define MEDIA_BASE_BITSTREAM_BUFFER_H_ | 
|   7  |   7  | 
|   8 #include <stddef.h> |   8 #include <stddef.h> | 
|   9 #include <stdint.h> |   9 #include <stdint.h> | 
|  10  |  10  | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
|  26 // data.  This is the media-namespace equivalent of PP_VideoBitstreamBuffer_Dev. |  26 // data.  This is the media-namespace equivalent of PP_VideoBitstreamBuffer_Dev. | 
|  27 class MEDIA_EXPORT BitstreamBuffer { |  27 class MEDIA_EXPORT BitstreamBuffer { | 
|  28  public: |  28  public: | 
|  29   BitstreamBuffer(); |  29   BitstreamBuffer(); | 
|  30  |  30  | 
|  31   // Constructs a new BitstreamBuffer. The content of the bitstream is located |  31   // Constructs a new BitstreamBuffer. The content of the bitstream is located | 
|  32   // at |offset| bytes away from the start of the shared memory and the payload |  32   // at |offset| bytes away from the start of the shared memory and the payload | 
|  33   // is |size| bytes. When not provided, the default value for |offset| is 0. |  33   // is |size| bytes. When not provided, the default value for |offset| is 0. | 
|  34   // |presentation_timestamp| is when the decoded frame should be displayed. |  34   // |presentation_timestamp| is when the decoded frame should be displayed. | 
|  35   // When not provided, |presentation_timestamp| will be |  35   // When not provided, |presentation_timestamp| will be | 
|  36   // |media::kNoTimestamp()|. |  36   // |media::kNoTimestamp|. | 
|  37   BitstreamBuffer(int32_t id, |  37   BitstreamBuffer(int32_t id, | 
|  38                   base::SharedMemoryHandle handle, |  38                   base::SharedMemoryHandle handle, | 
|  39                   size_t size, |  39                   size_t size, | 
|  40                   off_t offset = 0, |  40                   off_t offset = 0, | 
|  41                   base::TimeDelta presentation_timestamp = kNoTimestamp()); |  41                   base::TimeDelta presentation_timestamp = kNoTimestamp); | 
|  42  |  42  | 
|  43   BitstreamBuffer(const BitstreamBuffer& other); |  43   BitstreamBuffer(const BitstreamBuffer& other); | 
|  44  |  44  | 
|  45   ~BitstreamBuffer(); |  45   ~BitstreamBuffer(); | 
|  46  |  46  | 
|  47   void SetDecryptConfig(const DecryptConfig& decrypt_config); |  47   void SetDecryptConfig(const DecryptConfig& decrypt_config); | 
|  48  |  48  | 
|  49   int32_t id() const { return id_; } |  49   int32_t id() const { return id_; } | 
|  50   base::SharedMemoryHandle handle() const { return handle_; } |  50   base::SharedMemoryHandle handle() const { return handle_; } | 
|  51  |  51  | 
|  52   // The number of bytes of the actual bitstream data. It is the size of the |  52   // The number of bytes of the actual bitstream data. It is the size of the | 
|  53   // content instead of the whole shared memory. |  53   // content instead of the whole shared memory. | 
|  54   size_t size() const { return size_; } |  54   size_t size() const { return size_; } | 
|  55  |  55  | 
|  56   // The offset to the start of actual bitstream data in the shared memory. |  56   // The offset to the start of actual bitstream data in the shared memory. | 
|  57   off_t offset() const { return offset_; } |  57   off_t offset() const { return offset_; } | 
|  58  |  58  | 
|  59   // The timestamp is only valid if it's not equal to |media::kNoTimestamp()|. |  59   // The timestamp is only valid if it's not equal to |media::kNoTimestamp|. | 
|  60   base::TimeDelta presentation_timestamp() const { |  60   base::TimeDelta presentation_timestamp() const { | 
|  61     return presentation_timestamp_; |  61     return presentation_timestamp_; | 
|  62   } |  62   } | 
|  63  |  63  | 
|  64   void set_handle(const base::SharedMemoryHandle& handle) { handle_ = handle; } |  64   void set_handle(const base::SharedMemoryHandle& handle) { handle_ = handle; } | 
|  65  |  65  | 
|  66   // The following methods come from DecryptConfig. |  66   // The following methods come from DecryptConfig. | 
|  67  |  67  | 
|  68   const std::string& key_id() const { return key_id_; } |  68   const std::string& key_id() const { return key_id_; } | 
|  69   const std::string& iv() const { return iv_; } |  69   const std::string& iv() const { return iv_; } | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
|  89   std::vector<SubsampleEntry> subsamples_;  // clear/cypher sizes |  89   std::vector<SubsampleEntry> subsamples_;  // clear/cypher sizes | 
|  90  |  90  | 
|  91   friend struct IPC::ParamTraits<media::BitstreamBuffer>; |  91   friend struct IPC::ParamTraits<media::BitstreamBuffer>; | 
|  92  |  92  | 
|  93   // Allow compiler-generated copy & assign constructors. |  93   // Allow compiler-generated copy & assign constructors. | 
|  94 }; |  94 }; | 
|  95  |  95  | 
|  96 }  // namespace media |  96 }  // namespace media | 
|  97  |  97  | 
|  98 #endif  // MEDIA_BASE_BITSTREAM_BUFFER_H_ |  98 #endif  // MEDIA_BASE_BITSTREAM_BUFFER_H_ | 
| OLD | NEW |