1 /* 2 * Copyright (C) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef HCODEC_HCODEC_H 17 #define HCODEC_HCODEC_H 18 19 #include <queue> 20 #include <array> 21 #include <functional> 22 #include "securec.h" 23 #include "OMX_Component.h" // third_party/openmax/api/1.1.2 24 #include "codecbase.h" 25 #include "avcodec_errors.h" 26 #include "state_machine.h" 27 #include "v2_0/codec_types.h" 28 #include "v2_0/icodec_callback.h" 29 #include "v2_0/icodec_component.h" 30 #include "v2_0/icodec_component_manager.h" 31 #include "type_converter.h" 32 #include "buffer/avbuffer.h" 33 #include "meta/meta_key.h" // foundation/multimedia/histreamer/interface/inner_api/ 34 35 namespace OHOS::MediaAVCodec { 36 class HCodec : public CodecBase, protected StateMachine { 37 public: 38 static std::shared_ptr<HCodec> Create(const std::string &name); 39 int32_t SetCallback(const std::shared_ptr<MediaCodecCallback> &callback) override; 40 int32_t Configure(const Format &format) override; 41 sptr<Surface> CreateInputSurface() override; 42 int32_t SetInputSurface(sptr<Surface> surface) override; 43 int32_t SetOutputSurface(sptr<Surface> surface) override; 44 45 int32_t QueueInputBuffer(uint32_t index) override; 46 int32_t NotifyEos() override; 47 int32_t ReleaseOutputBuffer(uint32_t index) override; 48 int32_t RenderOutputBuffer(uint32_t index) override; 49 50 int32_t SignalRequestIDRFrame() override; 51 int32_t SetParameter(const Format& format) override; 52 int32_t GetInputFormat(Format& format) override; 53 int32_t GetOutputFormat(Format& format) override; 54 55 int32_t Start() override; 56 int32_t Stop() override; 57 int32_t Flush() override; 58 int32_t Reset() override; 59 int32_t Release() override; 60 61 protected: 62 enum MsgWhat : MsgType { 63 INIT, 64 SET_CALLBACK, 65 CONFIGURE, 66 CREATE_INPUT_SURFACE, 67 SET_INPUT_SURFACE, 68 SET_OUTPUT_SURFACE, 69 START, 70 GET_INPUT_FORMAT, 71 GET_OUTPUT_FORMAT, 72 SET_PARAMETERS, 73 REQUEST_IDR_FRAME, 74 FLUSH, 75 QUEUE_INPUT_BUFFER, 76 NOTIFY_EOS, 77 RELEASE_OUTPUT_BUFFER, 78 RENDER_OUTPUT_BUFFER, 79 STOP, 80 RELEASE, 81 82 INNER_MSG_BEGIN = 1000, 83 CODEC_EVENT, 84 OMX_EMPTY_BUFFER_DONE, 85 OMX_FILL_BUFFER_DONE, 86 GET_BUFFER_FROM_SURFACE, 87 CHECK_IF_STUCK, 88 FORCE_SHUTDOWN, 89 }; 90 91 enum BufferOperationMode { 92 KEEP_BUFFER, 93 RESUBMIT_BUFFER, 94 FREE_BUFFER, 95 }; 96 97 enum BufferOwner { 98 OWNED_BY_US = 0, 99 OWNED_BY_USER = 1, 100 OWNED_BY_OMX = 2, 101 OWNED_BY_SURFACE = 3, 102 OWNER_CNT = 4, 103 }; 104 105 struct PortInfo { 106 uint32_t width; 107 uint32_t height; 108 OMX_VIDEO_CODINGTYPE codingType; 109 std::optional<PixelFmt> pixelFmt; 110 double frameRate; 111 std::optional<uint32_t> inputBufSize; 112 }; 113 114 enum DumpMode : unsigned long { 115 DUMP_NONE = 0, 116 DUMP_ENCODER_INPUT = 0b1000, 117 DUMP_ENCODER_OUTPUT = 0b0100, 118 DUMP_DECODER_INPUT = 0b0010, 119 DUMP_DECODER_OUTPUT = 0b0001, 120 }; 121 122 struct BufferInfo { BufferInfoBufferInfo123 BufferInfo() : lastOwnerChangeTime(std::chrono::steady_clock::now()) {} 124 bool isInput = true; 125 BufferOwner owner = OWNED_BY_US; 126 std::chrono::time_point<std::chrono::steady_clock> lastOwnerChangeTime; 127 uint32_t bufferId = 0; 128 std::shared_ptr<OHOS::HDI::Codec::V2_0::OmxCodecBuffer> omxBuffer; 129 sptr<SurfaceBuffer> surfaceBuffer; 130 std::shared_ptr<AVBuffer> avBuffer; 131 132 void BeginCpuAccess(); 133 void EndCpuAccess(); 134 bool IsValidFrame() const; 135 void Dump(const std::string& prefix, DumpMode dumpMode, bool isEncoder) const; 136 137 private: 138 void Dump(const std::string& prefix) const; 139 void DumpSurfaceBuffer(const std::string& prefix) const; 140 void DecideDumpInfo(std::optional<uint32_t>& assumeAlignedH, std::string& suffix, bool& dumpAsVideo) const; 141 void DumpLinearBuffer(const std::string& prefix) const; 142 static constexpr char DUMP_PATH[] = "/data/misc/hcodecdump"; 143 }; 144 145 protected: 146 HCodec(OHOS::HDI::Codec::V2_0::CodecCompCapability caps, OMX_VIDEO_CODINGTYPE codingType, bool isEncoder); 147 ~HCodec() override; 148 static const char* ToString(MsgWhat what); 149 static const char* ToString(BufferOwner owner); 150 void ReplyErrorCode(MsgId id, int32_t err); 151 void PrintAllBufferInfo(); 152 std::array<uint32_t, OWNER_CNT> CountOwner(bool isInput); 153 void ChangeOwner(BufferInfo& info, BufferOwner newOwner); 154 void UpdateInputRecord(const BufferInfo& info, std::chrono::time_point<std::chrono::steady_clock> now); 155 void UpdateOutputRecord(const BufferInfo& info, std::chrono::time_point<std::chrono::steady_clock> now); 156 157 // configure 158 virtual int32_t OnConfigure(const Format &format) = 0; 159 bool GetPixelFmtFromUser(const Format &format); 160 static std::optional<double> GetFrameRateFromUser(const Format &format); 161 int32_t SetVideoPortInfo(OMX_DIRTYPE portIndex, const PortInfo& info); 162 virtual int32_t UpdateInPortFormat() = 0; 163 virtual int32_t UpdateOutPortFormat() = 0; UpdateColorAspects()164 virtual void UpdateColorAspects() {} 165 void PrintPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& def); 166 int32_t SetFrameRateAdaptiveMode(const Format &format); 167 int32_t SetProcessName(const Format &format); 168 OnSetOutputSurface(const sptr<Surface> & surface)169 virtual int32_t OnSetOutputSurface(const sptr<Surface> &surface) { return AVCS_ERR_UNSUPPORT; } OnSetParameters(const Format & format)170 virtual int32_t OnSetParameters(const Format &format) { return AVCS_ERR_OK; } OnCreateInputSurface()171 virtual sptr<Surface> OnCreateInputSurface() { return nullptr; } OnSetInputSurface(sptr<Surface> & inputSurface)172 virtual int32_t OnSetInputSurface(sptr<Surface> &inputSurface) { return AVCS_ERR_UNSUPPORT; } RequestIDRFrame()173 virtual int32_t RequestIDRFrame() { return AVCS_ERR_UNSUPPORT; } 174 175 // start 176 virtual bool ReadyToStart() = 0; 177 virtual int32_t AllocateBuffersOnPort(OMX_DIRTYPE portIndex) = 0; 178 virtual void UpdateFormatFromSurfaceBuffer() = 0; 179 int32_t GetPortDefinition(OMX_DIRTYPE portIndex, OMX_PARAM_PORTDEFINITIONTYPE& def); 180 int32_t AllocateAvSurfaceBuffers(OMX_DIRTYPE portIndex); 181 int32_t AllocateAvLinearBuffers(OMX_DIRTYPE portIndex); 182 int32_t AllocateAvHardwareBuffers(OMX_DIRTYPE portIndex, const OMX_PARAM_PORTDEFINITIONTYPE& def); 183 int32_t AllocateAvSharedBuffers(OMX_DIRTYPE portIndex, const OMX_PARAM_PORTDEFINITIONTYPE& def); 184 std::shared_ptr<OHOS::HDI::Codec::V2_0::OmxCodecBuffer> SurfaceBufferToOmxBuffer( 185 const sptr<SurfaceBuffer>& surfaceBuffer); 186 std::shared_ptr<OHOS::HDI::Codec::V2_0::OmxCodecBuffer> DynamicSurfaceBufferToOmxBuffer(); 187 188 virtual int32_t SubmitAllBuffersOwnedByUs() = 0; SubmitOutputBuffersToOmxNode()189 virtual int32_t SubmitOutputBuffersToOmxNode() { return AVCS_ERR_UNSUPPORT; } 190 BufferInfo* FindBufferInfoByID(OMX_DIRTYPE portIndex, uint32_t bufferId); 191 std::optional<size_t> FindBufferIndexByID(OMX_DIRTYPE portIndex, uint32_t bufferId); 192 virtual void OnGetBufferFromSurface() = 0; 193 uint32_t UserFlagToOmxFlag(AVCodecBufferFlag userFlag); 194 AVCodecBufferFlag OmxFlagToUserFlag(uint32_t omxFlag); 195 196 // input buffer circulation 197 virtual void NotifyUserToFillThisInBuffer(BufferInfo &info); 198 virtual void OnQueueInputBuffer(const MsgInfo &msg, BufferOperationMode mode); 199 void OnQueueInputBuffer(BufferOperationMode mode, BufferInfo* info); 200 virtual void OnSignalEndOfInputStream(const MsgInfo &msg); 201 int32_t NotifyOmxToEmptyThisInBuffer(BufferInfo& info); 202 virtual void OnOMXEmptyBufferDone(uint32_t bufferId, BufferOperationMode mode) = 0; 203 204 // output buffer circulation 205 int32_t NotifyOmxToFillThisOutBuffer(BufferInfo &info); 206 void OnOMXFillBufferDone(const OHOS::HDI::Codec::V2_0::OmxCodecBuffer& omxBuffer, BufferOperationMode mode); 207 void OnOMXFillBufferDone(BufferOperationMode mode, BufferInfo& info, size_t bufferIdx); 208 void NotifyUserOutBufferAvaliable(BufferInfo &info); 209 void OnReleaseOutputBuffer(const MsgInfo &msg, BufferOperationMode mode); 210 virtual void OnRenderOutputBuffer(const MsgInfo &msg, BufferOperationMode mode); 211 212 // stop/release 213 void ReclaimBuffer(OMX_DIRTYPE portIndex, BufferOwner owner, bool erase = false); 214 bool IsAllBufferOwnedByUsOrSurface(OMX_DIRTYPE portIndex); 215 bool IsAllBufferOwnedByUsOrSurface(); 216 void EraseOutBuffersOwnedByUsOrSurface(); 217 void ClearBufferPool(OMX_DIRTYPE portIndex); 218 virtual void EraseBufferFromPool(OMX_DIRTYPE portIndex, size_t i) = 0; 219 void FreeOmxBuffer(OMX_DIRTYPE portIndex, const BufferInfo& info); OnEnterUninitializedState()220 virtual void OnEnterUninitializedState() {} 221 222 // template 223 template <typename T> InitOMXParam(T & param)224 static inline void InitOMXParam(T& param) 225 { 226 (void)memset_s(¶m, sizeof(T), 0x0, sizeof(T)); 227 param.nSize = sizeof(T); 228 param.nVersion.s.nVersionMajor = 1; 229 } 230 231 template <typename T> InitOMXParamExt(T & param)232 static inline void InitOMXParamExt(T& param) 233 { 234 (void)memset_s(¶m, sizeof(T), 0x0, sizeof(T)); 235 param.size = sizeof(T); 236 param.version.s.nVersionMajor = 1; 237 } 238 239 template <typename T> 240 bool GetParameter(uint32_t index, T& param, bool isCfg = false) 241 { 242 int8_t* p = reinterpret_cast<int8_t*>(¶m); 243 std::vector<int8_t> inVec(p, p + sizeof(T)); 244 std::vector<int8_t> outVec; 245 int32_t ret = isCfg ? compNode_->GetConfig(index, inVec, outVec) : 246 compNode_->GetParameter(index, inVec, outVec); 247 if (ret != HDF_SUCCESS) { 248 return false; 249 } 250 if (outVec.size() != sizeof(T)) { 251 return false; 252 } 253 ret = memcpy_s(¶m, sizeof(T), outVec.data(), outVec.size()); 254 if (ret != EOK) { 255 return false; 256 } 257 return true; 258 } 259 260 template <typename T> 261 bool SetParameter(uint32_t index, const T& param, bool isCfg = false) 262 { 263 const int8_t* p = reinterpret_cast<const int8_t*>(¶m); 264 std::vector<int8_t> inVec(p, p + sizeof(T)); 265 int32_t ret = isCfg ? compNode_->SetConfig(index, inVec) : 266 compNode_->SetParameter(index, inVec); 267 if (ret != HDF_SUCCESS) { 268 return false; 269 } 270 return true; 271 } 272 AlignTo(uint32_t side,uint32_t align)273 static inline uint32_t AlignTo(uint32_t side, uint32_t align) 274 { 275 if (align == 0) { 276 return side; 277 } 278 return (side + align - 1) / align * align; 279 } 280 281 protected: 282 OHOS::HDI::Codec::V2_0::CodecCompCapability caps_; 283 OMX_VIDEO_CODINGTYPE codingType_; 284 bool isEncoder_; 285 bool isSecure_ = false; 286 uint32_t componentId_ = 0; 287 std::string componentName_; 288 std::string compUniqueStr_; 289 bool debugMode_ = false; 290 DumpMode dumpMode_ = DUMP_NONE; 291 sptr<OHOS::HDI::Codec::V2_0::ICodecCallback> compCb_ = nullptr; 292 sptr<OHOS::HDI::Codec::V2_0::ICodecComponent> compNode_ = nullptr; 293 sptr<OHOS::HDI::Codec::V2_0::ICodecComponentManager> compMgr_ = nullptr; 294 295 std::shared_ptr<MediaCodecCallback> callback_; 296 PixelFmt configuredFmt_; 297 BufferRequestConfig requestCfg_; 298 std::shared_ptr<Format> configFormat_; 299 std::shared_ptr<Format> inputFormat_; 300 std::shared_ptr<Format> outputFormat_; 301 302 std::vector<BufferInfo> inputBufferPool_; 303 std::vector<BufferInfo> outputBufferPool_; 304 bool isBufferCirculating_ = false; 305 bool inputPortEos_ = false; 306 bool outputPortEos_ = false; 307 bool gotFirstOutput_ = false; 308 309 struct TotalCntAndCost { 310 uint64_t totalCnt = 0; 311 uint64_t totalCostUs = 0; 312 }; 313 std::array<std::array<TotalCntAndCost, OWNER_CNT>, OWNER_CNT> inputHoldTimeRecord_; 314 std::chrono::time_point<std::chrono::steady_clock> firstInTime_; 315 uint64_t inTotalCnt_ = 0; 316 std::array<std::array<TotalCntAndCost, OWNER_CNT>, OWNER_CNT> outputHoldTimeRecord_; 317 std::chrono::time_point<std::chrono::steady_clock> firstOutTime_; 318 TotalCntAndCost outRecord_; 319 std::unordered_map<int64_t, std::chrono::time_point<std::chrono::steady_clock>> inTimeMap_; 320 321 static constexpr char BUFFER_ID[] = "buffer-id"; 322 static constexpr uint32_t WAIT_FENCE_MS = 1000; 323 static constexpr uint32_t STRIDE_ALIGNMENT = 32; 324 325 private: 326 struct BaseState : State { 327 protected: 328 BaseState(HCodec *codec, const std::string &stateName, 329 BufferOperationMode inputMode = KEEP_BUFFER, BufferOperationMode outputMode = KEEP_BUFFER) StateBaseState330 : State(stateName), codec_(codec), inputMode_(inputMode), outputMode_(outputMode) {} 331 void OnMsgReceived(const MsgInfo &info) override; 332 void ReplyErrorCode(MsgId id, int32_t err); 333 void OnCodecEvent(const MsgInfo &info); 334 virtual void OnCodecEvent(OHOS::HDI::Codec::V2_0::CodecEventType event, uint32_t data1, uint32_t data2); 335 void OnGetFormat(const MsgInfo &info); 336 virtual void OnShutDown(const MsgInfo &info) = 0; 337 void OnCheckIfStuck(const MsgInfo &info); 338 void OnForceShutDown(const MsgInfo &info); OnStateExitedBaseState339 void OnStateExited() override { codec_->stateGeneration_++; } 340 341 protected: 342 HCodec *codec_; 343 BufferOperationMode inputMode_; 344 BufferOperationMode outputMode_; 345 }; 346 347 struct UninitializedState : BaseState { UninitializedStateUninitializedState348 explicit UninitializedState(HCodec *codec) : BaseState(codec, "Uninitialized") {} 349 private: 350 void OnStateEntered() override; 351 void OnMsgReceived(const MsgInfo &info) override; 352 int32_t OnAllocateComponent(const std::string &name); 353 void OnShutDown(const MsgInfo &info) override; 354 }; 355 356 struct InitializedState : BaseState { InitializedStateInitializedState357 explicit InitializedState(HCodec *codec) : BaseState(codec, "Initialized") {} 358 private: 359 void OnStateEntered() override; 360 void ProcessShutDownFromRunning(); 361 void OnMsgReceived(const MsgInfo &info) override; 362 void OnSetCallBack(const MsgInfo &info); 363 void OnConfigure(const MsgInfo &info); 364 void OnSetSurface(const MsgInfo &info, bool isInput); 365 void OnStart(const MsgInfo &info); 366 void OnShutDown(const MsgInfo &info) override; 367 }; 368 369 struct StartingState : BaseState { StartingStateStartingState370 explicit StartingState(HCodec *codec) : BaseState(codec, "Starting") {} 371 private: 372 void OnStateEntered() override; 373 void OnStateExited() override; 374 void OnMsgReceived(const MsgInfo &info) override; 375 int32_t AllocateBuffers(); 376 void OnCodecEvent(OHOS::HDI::Codec::V2_0::CodecEventType event, uint32_t data1, uint32_t data2) override; 377 void OnShutDown(const MsgInfo &info) override; 378 void ReplyStartMsg(int32_t errCode); 379 bool hasError_ = false; 380 }; 381 382 struct RunningState : BaseState { RunningStateRunningState383 explicit RunningState(HCodec *codec) : BaseState(codec, "Running", RESUBMIT_BUFFER, RESUBMIT_BUFFER) {} 384 private: 385 void OnStateEntered() override; 386 void OnMsgReceived(const MsgInfo &info) override; 387 void OnCodecEvent(OHOS::HDI::Codec::V2_0::CodecEventType event, uint32_t data1, uint32_t data2) override; 388 void OnShutDown(const MsgInfo &info) override; 389 void OnFlush(const MsgInfo &info); 390 void OnSetParameters(const MsgInfo &info); 391 }; 392 393 struct OutputPortChangedState : BaseState { OutputPortChangedStateOutputPortChangedState394 explicit OutputPortChangedState(HCodec *codec) 395 : BaseState(codec, "OutputPortChanged", RESUBMIT_BUFFER, FREE_BUFFER) {} 396 private: 397 void OnStateEntered() override; 398 void OnMsgReceived(const MsgInfo &info) override; 399 void OnCodecEvent(OHOS::HDI::Codec::V2_0::CodecEventType event, uint32_t data1, uint32_t data2) override; 400 void OnShutDown(const MsgInfo &info) override; 401 void HandleOutputPortDisabled(); 402 void HandleOutputPortEnabled(); 403 void OnFlush(const MsgInfo &info); 404 }; 405 406 struct FlushingState : BaseState { FlushingStateFlushingState407 explicit FlushingState(HCodec *codec) : BaseState(codec, "Flushing") {} 408 private: 409 void OnStateEntered() override; 410 void OnMsgReceived(const MsgInfo &info) override; 411 void OnCodecEvent(OHOS::HDI::Codec::V2_0::CodecEventType event, uint32_t data1, uint32_t data2) override; 412 void OnShutDown(const MsgInfo &info) override; 413 void ChangeStateIfWeOwnAllBuffers(); 414 bool IsFlushCompleteOnAllPorts(); 415 int32_t UpdateFlushStatusOnPorts(uint32_t data1, uint32_t data2); 416 bool flushCompleteFlag_[2] {false, false}; 417 }; 418 419 struct StoppingState : BaseState { StoppingStateStoppingState420 explicit StoppingState(HCodec *codec) : BaseState(codec, "Stopping"), 421 omxNodeInIdleState_(false), 422 omxNodeIsChangingToLoadedState_(false) {} 423 private: 424 void OnStateEntered() override; 425 void OnMsgReceived(const MsgInfo &info) override; 426 void OnCodecEvent(OHOS::HDI::Codec::V2_0::CodecEventType event, uint32_t data1, uint32_t data2) override; 427 void OnShutDown(const MsgInfo &info) override; 428 void ChangeStateIfWeOwnAllBuffers(); 429 void ChangeOmxNodeToLoadedState(bool forceToFreeBuffer); 430 bool omxNodeInIdleState_; 431 bool omxNodeIsChangingToLoadedState_; 432 }; 433 434 class HdiCallback : public OHOS::HDI::Codec::V2_0::ICodecCallback { 435 public: HdiCallback(HCodec * codec)436 explicit HdiCallback(HCodec* codec) : codec_(codec) { } 437 virtual ~HdiCallback() = default; 438 int32_t EventHandler(OHOS::HDI::Codec::V2_0::CodecEventType event, 439 const OHOS::HDI::Codec::V2_0::EventInfo& info); 440 int32_t EmptyBufferDone(int64_t appData, const OHOS::HDI::Codec::V2_0::OmxCodecBuffer& buffer); 441 int32_t FillBufferDone(int64_t appData, const OHOS::HDI::Codec::V2_0::OmxCodecBuffer& buffer); 442 private: 443 HCodec* codec_; 444 }; 445 446 private: 447 int32_t DoSyncCall(MsgWhat msgType, std::function<void(ParamSP)> oper); 448 int32_t DoSyncCallAndGetReply(MsgWhat msgType, std::function<void(ParamSP)> oper, ParamSP &reply); 449 int32_t InitWithName(const std::string &name); 450 void ReleaseComponent(); 451 void CleanUpOmxNode(); 452 void ChangeOmxToTargetState(OHOS::HDI::Codec::V2_0::CodecStateType &state, 453 OHOS::HDI::Codec::V2_0::CodecStateType targetState); 454 bool RollOmxBackToLoaded(); 455 456 int32_t ForceShutdown(int32_t generation); 457 void SignalError(AVCodecErrorType errorType, int32_t errorCode); 458 void DeferMessage(const MsgInfo &info); 459 void ProcessDeferredMessages(); 460 void ReplyToSyncMsgLater(const MsgInfo& msg); 461 bool GetFirstSyncMsgToReply(MsgInfo& msg); 462 463 private: 464 static constexpr size_t MAX_HCODEC_BUFFER_SIZE = 8192 * 4096 * 4; // 8K RGBA 465 static constexpr uint32_t THREE_SECONDS_IN_US = 3'000'000; 466 static constexpr double FRAME_RATE_COEFFICIENT = 65536.0; 467 468 std::shared_ptr<UninitializedState> uninitializedState_; 469 std::shared_ptr<InitializedState> initializedState_; 470 std::shared_ptr<StartingState> startingState_; 471 std::shared_ptr<RunningState> runningState_; 472 std::shared_ptr<OutputPortChangedState> outputPortChangedState_; 473 std::shared_ptr<FlushingState> flushingState_; 474 std::shared_ptr<StoppingState> stoppingState_; 475 476 int32_t stateGeneration_ = 0; 477 bool isShutDownFromRunning_ = false; 478 bool notifyCallerAfterShutdownComplete_ = false; 479 bool keepComponentAllocated_ = false; 480 bool hasFatalError_ = false; 481 std::list<MsgInfo> deferredQueue_; 482 std::map<MsgType, std::queue<std::pair<MsgId, ParamSP>>> syncMsgToReply_; 483 }; // class HCodec 484 } // namespace OHOS::MediaAVCodec 485 #endif // HCODEC_HCODEC_H 486