Lines Matching refs:format

44     FALSE_RETURN_V_MSG_E(audioFormat != nullptr, nullptr, "new format is nullptr!");
55 FALSE_RETURN_V_MSG_E(videoFormat != nullptr, nullptr, "new format is nullptr!");
62 void OH_AVFormat_Destroy(struct OH_AVFormat *format)
64 delete format;
69 FALSE_RETURN_V_MSG_E(to != nullptr, false, "to format is nullptr!");
71 FALSE_RETURN_V_MSG_E(from != nullptr, false, "from format is nullptr!");
78 bool OH_AVFormat_SetIntValue(struct OH_AVFormat *format, const char *key, int32_t value)
80 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
81 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
84 return format->format_.PutIntValue(key, value);
87 bool OH_AVFormat_SetLongValue(struct OH_AVFormat *format, const char *key, int64_t value)
89 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
90 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
93 return format->format_.PutLongValue(key, value);
96 bool OH_AVFormat_SetFloatValue(struct OH_AVFormat *format, const char *key, float value)
98 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
99 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
102 return format->format_.PutFloatValue(key, value);
105 bool OH_AVFormat_SetDoubleValue(struct OH_AVFormat *format, const char *key, double value)
107 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
108 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
111 return format->format_.PutDoubleValue(key, value);
114 bool OH_AVFormat_SetStringValue(struct OH_AVFormat *format, const char *key, const char *value)
116 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
117 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
121 return format->format_.PutStringValue(key, value);
124 bool OH_AVFormat_SetBuffer(struct OH_AVFormat *format, const char *key, const uint8_t *addr, size_t size)
126 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
127 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
132 return format->format_.PutBuffer(key, addr, size);
135 bool OH_AVFormat_GetIntValue(struct OH_AVFormat *format, const char *key, int32_t *out)
137 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
138 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
142 return format->format_.GetIntValue(key, *out);
145 bool OH_AVFormat_GetLongValue(struct OH_AVFormat *format, const char *key, int64_t *out)
147 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
148 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
152 return format->format_.GetLongValue(key, *out);
155 bool OH_AVFormat_GetFloatValue(struct OH_AVFormat *format, const char *key, float *out)
157 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
158 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
162 return format->format_.GetFloatValue(key, *out);
165 bool OH_AVFormat_GetDoubleValue(struct OH_AVFormat *format, const char *key, double *out)
167 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
168 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
172 return format->format_.GetDoubleValue(key, *out);
175 bool OH_AVFormat_GetStringValue(struct OH_AVFormat *format, const char *key, const char **out)
177 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
178 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
182 if (format->outString_ != nullptr) {
183 free(format->outString_);
184 format->outString_ = nullptr;
188 bool ret = format->format_.GetStringValue(key, str);
194 format->outString_ = static_cast<char *>(malloc((bufLength + 1) * sizeof(char)));
195 FALSE_RETURN_V_MSG_E(format->outString_ != nullptr, false, "malloc out string nullptr!");
197 if (strcpy_s(format->outString_, bufLength + 1, str.c_str()) != EOK) {
199 free(format->outString_);
200 format->outString_ = nullptr;
204 *out = format->outString_;
208 bool OH_AVFormat_GetBuffer(struct OH_AVFormat *format, const char *key, uint8_t **addr, size_t *size)
210 FALSE_RETURN_V_MSG_E(format != nullptr, false, "input format is nullptr!");
211 FALSE_RETURN_V_MSG_E(format->magic_ == MFMagic::MFMAGIC_FORMAT, false, "magic error!");
216 return format->format_.GetBuffer(key, addr, *size);
219 const char *OH_AVFormat_DumpInfo(struct OH_AVFormat *format)
221 FALSE_RETURN_V_MSG_E(format != nullptr, nullptr, "input format is nullptr!");
222 if (format->dumpInfo_ != nullptr) {
223 free(format->dumpInfo_);
224 format->dumpInfo_ = nullptr;
226 std::string info = format->format_.Stringify();
231 format->dumpInfo_ = static_cast<char *>(malloc((bufLength + 1) * sizeof(char)));
232 FALSE_RETURN_V_MSG_E(format->dumpInfo_ != nullptr, nullptr, "malloc dump info nullptr!");
233 if (strcpy_s(format->dumpInfo_, bufLength + 1, info.c_str()) != EOK) {
235 free(format->dumpInfo_);
236 format->dumpInfo_ = nullptr;
238 return format->dumpInfo_;