Lines Matching refs:buffer
36 std::shared_ptr<AVBuffer> buffer = AVBuffer::CreateAVBuffer(allocator, capacity); in OH_AVBuffer_Create() local
37 FALSE_RETURN_V_MSG_E(buffer != nullptr, nullptr, "create OH_AVBuffer failed"); in OH_AVBuffer_Create()
38 FALSE_RETURN_V_MSG_E(buffer->memory_ != nullptr, nullptr, "memory is nullptr"); in OH_AVBuffer_Create()
39 … FALSE_RETURN_V_MSG_E(buffer->memory_->GetAddr() != nullptr, nullptr, "memory's addr is nullptr"); in OH_AVBuffer_Create()
41 struct OH_AVBuffer *buf = new (std::nothrow) OH_AVBuffer(buffer); in OH_AVBuffer_Create()
42 FALSE_RETURN_V_MSG_E(buffer != nullptr, nullptr, "failed to new OH_AVBuffer"); in OH_AVBuffer_Create()
47 OH_AVErrCode OH_AVBuffer_Destroy(struct OH_AVBuffer *buffer) in OH_AVBuffer_Destroy() argument
49 FALSE_RETURN_V_MSG_E(buffer != nullptr, AV_ERR_INVALID_VAL, "input buffer is nullptr!"); in OH_AVBuffer_Destroy()
50 …FALSE_RETURN_V_MSG_E(buffer->magic_ == MFMagic::MFMAGIC_AVBUFFER, AV_ERR_INVALID_VAL, "magic error… in OH_AVBuffer_Destroy()
51 …FALSE_RETURN_V_MSG_E(buffer->isUserCreated, AV_ERR_OPERATE_NOT_PERMIT, "input buffer is not user c… in OH_AVBuffer_Destroy()
52 delete buffer; in OH_AVBuffer_Destroy()
56 OH_AVErrCode OH_AVBuffer_GetBufferAttr(OH_AVBuffer *buffer, OH_AVCodecBufferAttr *attr) in OH_AVBuffer_GetBufferAttr() argument
58 FALSE_RETURN_V_MSG_E(buffer != nullptr, AV_ERR_INVALID_VAL, "input buffer is nullptr!"); in OH_AVBuffer_GetBufferAttr()
59 …FALSE_RETURN_V_MSG_E(buffer->magic_ == MFMagic::MFMAGIC_AVBUFFER, AV_ERR_INVALID_VAL, "magic error… in OH_AVBuffer_GetBufferAttr()
60 FALSE_RETURN_V_MSG_E(buffer->buffer_ != nullptr, AV_ERR_INVALID_VAL, "buffer is nullptr!"); in OH_AVBuffer_GetBufferAttr()
62 attr->pts = buffer->buffer_->pts_; in OH_AVBuffer_GetBufferAttr()
63 attr->flags = static_cast<uint32_t>(buffer->buffer_->flag_); in OH_AVBuffer_GetBufferAttr()
64 if (buffer->buffer_->memory_ != nullptr) { in OH_AVBuffer_GetBufferAttr()
65 attr->offset = buffer->buffer_->memory_->GetOffset(); in OH_AVBuffer_GetBufferAttr()
66 attr->size = buffer->buffer_->memory_->GetSize(); in OH_AVBuffer_GetBufferAttr()
74 OH_AVErrCode OH_AVBuffer_SetBufferAttr(OH_AVBuffer *buffer, const OH_AVCodecBufferAttr *attr) in OH_AVBuffer_SetBufferAttr() argument
76 FALSE_RETURN_V_MSG_E(buffer != nullptr, AV_ERR_INVALID_VAL, "input buffer is nullptr!"); in OH_AVBuffer_SetBufferAttr()
77 …FALSE_RETURN_V_MSG_E(buffer->magic_ == MFMagic::MFMAGIC_AVBUFFER, AV_ERR_INVALID_VAL, "magic error… in OH_AVBuffer_SetBufferAttr()
78 FALSE_RETURN_V_MSG_E(buffer->buffer_ != nullptr, AV_ERR_INVALID_VAL, "buffer is nullptr!"); in OH_AVBuffer_SetBufferAttr()
80 buffer->buffer_->pts_ = attr->pts; in OH_AVBuffer_SetBufferAttr()
81 buffer->buffer_->flag_ = attr->flags; in OH_AVBuffer_SetBufferAttr()
83 if (buffer->buffer_->memory_ != nullptr) { in OH_AVBuffer_SetBufferAttr()
84 Status ret = buffer->buffer_->memory_->SetSize(attr->size); in OH_AVBuffer_SetBufferAttr()
87 ret = buffer->buffer_->memory_->SetOffset(attr->offset); in OH_AVBuffer_SetBufferAttr()
93 OH_AVFormat *OH_AVBuffer_GetParameter(OH_AVBuffer *buffer) in OH_AVBuffer_GetParameter() argument
95 FALSE_RETURN_V_MSG_E(buffer != nullptr, nullptr, "input buffer is nullptr!"); in OH_AVBuffer_GetParameter()
96 FALSE_RETURN_V_MSG_E(buffer->magic_ == MFMagic::MFMAGIC_AVBUFFER, nullptr, "magic error!"); in OH_AVBuffer_GetParameter()
97 FALSE_RETURN_V_MSG_E(buffer->buffer_ != nullptr, nullptr, "buffer is nullptr!"); in OH_AVBuffer_GetParameter()
98 FALSE_RETURN_V_MSG_E(buffer->buffer_->meta_ != nullptr, nullptr, "buffer's meta is nullptr!"); in OH_AVBuffer_GetParameter()
101 if (!avFormat->format_.SetMeta(buffer->buffer_->meta_)) { in OH_AVBuffer_GetParameter()
109 OH_AVErrCode OH_AVBuffer_SetParameter(OH_AVBuffer *buffer, const OH_AVFormat *format) in OH_AVBuffer_SetParameter() argument
111 FALSE_RETURN_V_MSG_E(buffer != nullptr, AV_ERR_INVALID_VAL, "input buffer is nullptr!"); in OH_AVBuffer_SetParameter()
112 …FALSE_RETURN_V_MSG_E(buffer->magic_ == MFMagic::MFMAGIC_AVBUFFER, AV_ERR_INVALID_VAL, "magic error… in OH_AVBuffer_SetParameter()
113 FALSE_RETURN_V_MSG_E(buffer->buffer_ != nullptr, AV_ERR_INVALID_VAL, "buffer is nullptr!"); in OH_AVBuffer_SetParameter()
121 *(buffer->buffer_->meta_) = *(meta); in OH_AVBuffer_SetParameter()
125 uint8_t *OH_AVBuffer_GetAddr(OH_AVBuffer *buffer) in OH_AVBuffer_GetAddr() argument
127 FALSE_RETURN_V_MSG_E(buffer != nullptr, nullptr, "input buffer is nullptr!"); in OH_AVBuffer_GetAddr()
128 FALSE_RETURN_V_MSG_E(buffer->magic_ == MFMagic::MFMAGIC_AVBUFFER, nullptr, "magic error!"); in OH_AVBuffer_GetAddr()
129 FALSE_RETURN_V_MSG_E(buffer->buffer_ != nullptr, nullptr, "buffer is nullptr!"); in OH_AVBuffer_GetAddr()
130 … FALSE_RETURN_V_MSG_E(buffer->buffer_->memory_ != nullptr, nullptr, "buffer's memory is nullptr!"); in OH_AVBuffer_GetAddr()
131 return buffer->buffer_->memory_->GetAddr(); in OH_AVBuffer_GetAddr()
134 int32_t OH_AVBuffer_GetCapacity(OH_AVBuffer *buffer) in OH_AVBuffer_GetCapacity() argument
136 FALSE_RETURN_V_MSG_E(buffer != nullptr, -1, "input buffer is nullptr!"); in OH_AVBuffer_GetCapacity()
137 FALSE_RETURN_V_MSG_E(buffer->magic_ == MFMagic::MFMAGIC_AVBUFFER, -1, "magic error!"); in OH_AVBuffer_GetCapacity()
138 FALSE_RETURN_V_MSG_E(buffer->buffer_ != nullptr, -1, "buffer is nullptr!"); in OH_AVBuffer_GetCapacity()
139 FALSE_RETURN_V_MSG_E(buffer->buffer_->memory_ != nullptr, -1, "buffer's memory is nullptr!"); in OH_AVBuffer_GetCapacity()
140 return buffer->buffer_->memory_->GetCapacity(); in OH_AVBuffer_GetCapacity()
143 OH_NativeBuffer *OH_AVBuffer_GetNativeBuffer(OH_AVBuffer *buffer) in OH_AVBuffer_GetNativeBuffer() argument
145 FALSE_RETURN_V_MSG_E(buffer != nullptr, nullptr, "input buffer is nullptr!"); in OH_AVBuffer_GetNativeBuffer()
146 FALSE_RETURN_V_MSG_E(buffer->magic_ == MFMagic::MFMAGIC_AVBUFFER, nullptr, "magic error!"); in OH_AVBuffer_GetNativeBuffer()
147 FALSE_RETURN_V_MSG_E(buffer->buffer_ != nullptr, nullptr, "buffer is nullptr!"); in OH_AVBuffer_GetNativeBuffer()
148 … FALSE_RETURN_V_MSG_E(buffer->buffer_->memory_ != nullptr, nullptr, "buffer's memory is nullptr!"); in OH_AVBuffer_GetNativeBuffer()
149 sptr<SurfaceBuffer> surfaceBuffer = buffer->buffer_->memory_->GetSurfaceBuffer(); in OH_AVBuffer_GetNativeBuffer()